This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: XSL: Docbook to foreign DTD


On Mon, Jan 07, 2002 at 01:10:14PM -0800, Bob Stayton wrote:
> On Sun, Jan 06, 2002 at 11:24:32AM -0500, Daniel Veillard wrote:
> >   Example: there is no way to know whether "ns:val" in the following
> >     <foo xmlns:ns="http://example.org/bar"; bar="ns:val"/>
> > is actually to be consumed as a simple string, or as a CName value anchored
> > in the http://example.org/bar namespace, assuming foo is to be copied as
> > part of the output of an XSLT transformation, the rule is to actually serialize
> > xmlns:ns="http://example.org/bar"; to be sure that applications using 
> > the namespace in attribute (or text) content do not break.
> 
> Could you clarify your example for me?  Does your "bar"
> attribute have a declared attribute type of Nmtoken?
> Otherwise the colon in the attribute value has no 
> special signficance, right?

  Well the XSLT processor operates only on the XPath data model of
the document, so it's doesn't even have access to DTD related informations.
Yes, the ':' has no significance for it, in general. And there is no
way (at least there was, I don't know if XML Schemas provides this) to
know if "ns:val" is consumed by the application as a simple string or
expect to match the "ns" prefix with the in-scope namespace. So the processor
has to make sure the prefix stays in-scope and with the same namespace 
name (URI) if the element foo is generated in the output. That's one of the
reason the XSLT processors tends to generate more namespace declarations
in the output than what the stylesheet authors would expect when looking just
at the templates.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]