OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] support for xpointer

On 2014-09-14 16:36, Richard Hamilton wrote:
> Hi Stefan,
> I didn't say it was elegant:-).
> I agree that DocBook transclusion may be the way to go. I need to look into it further for our book process.
> And a multi-stage process works well for us. Maybe it's my long experience with Unix, but I use multi-stage processes all the time. They let you use the right tool for each step in the process and give you intermediate files that you can examine when things go wrong.

Right. The disadvantage is that the original document no longer is a
valid DocBook document, and thus requires RNG customization to make my
editor happy (not to mention that the transclusion no longer is a
transparent process).

Ideally I would like to be able to encode the query in an attribute,
much as I would have preferred with xpointer, such as

<listitem my:ref="*[@xml:id='foo']//d:listitem" />

However, I can't manage to extract the above "ref" into a variable and
concatenate that into a valid xpath expression inside a custom stylesheet:

<xsl:template match="*[@my:ref]">
  <xsl:variable name="ref" select="@my:ref" />
  <xsl:variable name=content select="document('dict.xml')//$ref" />

It seems I'm misunderstanding something, as no matter how I spell the
above, I get XPath errors from xsltproc.
The only thing that seems to work is me injecting individual names into
an XPath expression, such as

  <xsl:variable name=content
select="document('dict.xml')//d:section[@xml:id=$ref]//listitem[2]" />

which however severely limits my flexibility as it supposes a fixed
structure ("include the second listitem of the identified section"). Am
I asking too much ?

Many thanks,


      ...ich hab' noch einen Koffer in Berlin...

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]