[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: def anywhere Re: [docbook] Feedback on DocBook Transclusion proposal
Dave Pawson <davep@dpawson.co.uk> wrote on Thu, 16 Dec 2010 19:55:17 +0000: > On Thu, 16 Dec 2010 20:29:19 +0100 > Jirka Kosek <jirka@kosek.cz> wrote: > >> Of course it would be better to develop and use some more generic >> approach then to develop something specific to DocBook. The problem is >> that solution has to know which attributes are of ID/IDREF types -- it >> is hard to do this without schema introspection. > ... > My initial reaction is to restrict it to docbook, > If implemented, and if it works well there, then perhaps look for wider > adoption? Considering the complexity of the issue, I tend to agree with this viewpoint. Ultimately I would like to see transclusion become a first-class citizen of XML, perhaps using an xml* namespace to get around the ID/IDREF type issue. To make the already-complex proposal even more complex, I have an additional use case: As a heavy user of xinclude/xpointer, I routinely define reused content on the fly (mostly math, in practice). For example: <article xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Transclusion</title> <para>Here is a <phrase role="cphrase">complicated phrase</phrase> that will reoccur several times.</para> <para>For example, here this <xi:include xpointer="xpointer(//*[@role='cphrase'][1])"/> occurs again.</para> <para>And here, one more <xi:include xpointer="xpointer(//*[@role='cphrase'][1])"/>.</para> </article> (This XInclude notation is clearly a mess, and limits me to libxml2.) Now, how about *permitting the name attribute anywhere*, not only in <def/> elements, allowing me to write equivalently: <article xmlns="http://docbook.org/ns/docbook"> <title>Transclusion</title> <para>Here is a <phrase name="cphrase">complicated phrase</phrase> that will reoccur several times.</para> <para>For example, here this <ref name="cphrase"/> occurs again.</para> <para>And here, one more <ref name="cphrase"/>.</para> </article> Or, perhaps @def would be a better name for this attribute than @name. Of course, I could explicitly define the "complicated expression" via <definitions/> as in Jirka's proposal. In practice however, ripping content out of their context is often inconvenient. It is often more natural to simply reuse the first occurrence in the text. Or even better, allow forward references as well. Justus
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]