[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: DOCBOOK-APPS: Re: XSL: Docbook to foreign DTD
On Sun, Jan 06, 2002 at 10:04:55AM +0100, Jochen Hein wrote: > >>>>> "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... I don't know of a way to skip the namespace declaration entirely. When the output method is "xml", then the output must conform to the XML Namespace Recomendation, which means the namespace must be declared. Although the default #FIXED attribute on <xref> declares it, that is in the DTD, and the XSL processor doesn't validate the *output* against the output DTD that is declared by doctype-public or doctype-system. So the XSL processor doesn't know about the default attribute that declares the namespace, and so it must insert the declaration. If you could get it to output the namespace declaration attribute in each instance of <xref>, it would be valid (if verbose). But the XSL processors decide for themselves where to output the declaration. If there is a way to force it in <xref>, I don't know it. Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 Caldera International, Inc. fax: (831) 429-1887 email: bobs@caldera.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC