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] using xpointer with modular DocBook

Hello Thomas,

On 04/14/2013 02:56 PM, Thomas Schraitle wrote:
> Hello Stefan,
> Am Sonntag, 14. April 2013, 14:08:03 schrieb Stefan Seefeld:
>> [...]
>>       <variablelist>
>>     <xi:include href="../vsip/signal.xml"
>> xpointer="xmlns(db=http://docbook.org/ns/docbook)xpointer(//db:varlistentry[
>> @xml:id='foo'])"/> ...
>>       </variablelist>
> If I'm not mistaken, you can simplify the above xpointer expression as
>   xpointer(id(foo))
> Not sure if this scheme is supported, but it maybe worth a try. Maybe you need 
> quotes for id(...) so try both notations.

Yes, that works indeed. Unfortunately my real references are a little
more complex, as they don't have (explicit) ids. So I typically need to
refer to things such as "the first varlistentry child of the node with
id <ID>".

>> This works well, but introduces a lot of redundancy as for each chunk
>> I'd like to include I have to redefine the namespace used in the xpath
>> expression. Is there a way to avoid that, by making this the default in
>> some way ? If I just leave out the xmlns() I get an error as the
>> xpointer can't be resolved.
>> (I'm using xsltproc to process the DB documents.)
> I don't think you can avoid the namespace. Have you tried entities? You could 
> define a entity (let's say "dbxmlns") inside the internal subset of the DTD:
>   <!DOCTYPE chapter 
>   [
>     <!ENTITY dbxmlns "xmlns(db=http://docbook.org/ns/docbook)">
>   ]>
> and use it like this:
>   <xi:include href="../vsip/signal.xml"
>               xpointer="&dbxmlns;xpointer(id(foo))"/>
> Entites are resolved before any xinclude processing is done. If this works, I 
> think this should be compact enough. ;)

Indeed, that works. Thanks for the tip !
However, I'd rather prefer to avoid entities. The document will be
edited with XML editors such as XMLMind's XXE, which would discard
(substitute) the entities.
(Of course, if everyone used such editors it wouldn't matter, but since
some use normal text-based editors, I'm looking for a solution that
works everywhere.

Thanks again for your help,


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

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