[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] using xpointer with modular DocBook
Hi Stefan, Am Sonntag, 14. April 2013, 15:09:07 schrieb Stefan Seefeld: > [...] > > 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>". I think that's also possible by just appending an XPath expression. If your variablelist has the ID "foo" and you want to refer to the first varlistentry you can write: xmlns(db=http://docbook.org/ns/docbook)xpointer(id(foo)/db:varlistentry[1]) > > [... using entities ...] > > 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. That's true. > (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. I don't think there is a general solution where you define somewhere the namespace and just refer to it. It seems, you need to add the namespace xmlns() scheme every time. Maybe you add the xmlns() XPointer scheme before passing it to your XML parser. You could (theoretically) apply an XSLT transformation step and add the xmlns() scheme. That way you could avoid entities, however, you add an additional step (which may not be useful). -- Gruß/Regards Thomas Schraitle
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]