This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: XSL: Docbook to foreign DTD
>>>>> "Bob" == Bob Stayton <bobs@caldera.com> writes:
[Using Namespace in XSL to generate XSL from Docbook]
Bob> You need to make a couple of changes to get the namespace into
Bob> the attribute name. First, you need to declare the namespace
Bob> and prefix in your stylesheet:
Bob> <xsl:stylesheet
Bok> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Bob> xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0">
That leaves me with the top level element
<book xmlns:xlink="http://www.w3.org/1999/xlink">, where the
xmlns:xlink attribute is not declared in the DTD. What I do have in
the DTD is:
<!ATTLIST xref
%commonattr;
xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
xlink:type (simple | extended | resource | locator | arc | title | none) #IMPLIED
xlink:href CDATA #REQUIRED
So I think I can skip the xmlns declaration in the top level element.
Is there an XSL way to do it? Using sed might not be that
appropriate...
Bob> Then you need to remove the "xlink:" prefix from the name
Bob> attribute value, and add a namespace attribute to the
Bob> <xsl:attribute> element:
[deleted], yes that works. Thanks for your help.
Bob> This works with xsltproc and saxon.
I do use xsltproc for now.
Jochen
--
#include <~/.signature>: permission denied