From: Guenter M. <mi...@us...> - 2025-10-07 18:42:08
|
Dear Schimon, On 2025-10-06, Schimon Jehudah via Docutils-users wrote: >> On 2025-09-28, Schimon Jehudah via Docutils-users wrote: >> > XLink might be helpful for both, Atom and (X)HTML, in order to set >> > accurate links to references. I don't think using XLink will give advantages to (X)HTML, as browser support is missing. (Except inside SVG, but even this is deprecated.) https://en.wikipedia.org/wiki/XLink#Implementations https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/xlink:href I don't know about Atom but it is not listed as a specification supporting XLink https://en.wikipedia.org/wiki/XLink#Within_other_specifications The Docutils Doctree documentation may gain a bit, when we could add a formal description of internal links (the "refid" and "refname" attributes) as an "xlink:href" with an XPath fragment specifier that for the "refid" value "my-id" would mean 'the element that contains "my-id" in the space-separated list of IDs that is the value of its "ids" attribute.' https://docutils.sourceforge.io/docs/ref/doctree.html#refid ... >> Can you provide a **minimal** working example of what you want to >> achieve? > Yes. I can. > I am working on a publication platform of which all produced documents > are XML (Atom Syndication Format), and these documents are transformed > to XHTML with XSLT stylesheets. How do you produce the XML (Atom) documents? With a custom Docutils writer or with XSLT from a standard output format? > As this platform utilizes The Atom Syndication Format, there is element > "atom:link" which is almost identical to element "link" of HTML. > The element "atom:link" is utilized to list related resources (i.e. > references) and attachments (i.e. enclosures). > I am interested to link to those links in a local fashion (i..e > utilizing the sign hash/number/pound (#), utilizing XSLT directives. ... I have only basic understanding of XML and a vague idea of XSLT so I cannot help with details. I suppose it should be possible with XSLT to convert the "ids" attribute, https://docutils.sourceforge.io/docs/ref/doctree.html#ids, to an "id" attribute (maybe just discarding eventual "alias IDs" and keeping just the first ID), e.g. :: - <citation ids="elk-70" names="elk:70"> + <citation id="elk-70"> Then, a "refid" can be replaced by a "refuri" (or "href") attribute with simple fragment syntax:: - <reference name="Elk:70" refid="elk-70">Elk:70</reference> + <link href="#elk-70">Elk:70</link> Günter |