Re: [xslt] Namespace problem

On Mon, Apr 30, 2001 at 05:20:54PM +0000, Bjorn Reese wrote:
> Thomas Broyer wrote:
> > That's the expected behaviour.
> > 
> > Matching is done against the namespace URI, not the prefix.
> > This stylesheet is invalid since the ns namespace prefix isn't declared.
> Thanks for the reply.
> Now, this is were my ignorance sets in. Does all namespaces in the xml
> file have to be defined in the stylesheet?
> If so, is it possible to have a template that matches only the tag name?
> (e.g. 'root' in 'ns:root')

  Hum, I'm afraid it would be wrong. XSLT allows name test as from the
XPath production:
[37]   NameTest ::=   '*'
		  |   NCName ':' '*'
		  |   QName

QName is actually inherited from the namespace in XML REC

[6] QName ::= (Prefix ':')? LocalPart
[7] Prefix ::= NCName

  which means that:
  is allowed but
  is not allowed

  and I'm afraid that just 'root' does only match root elements without
a namespace...


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]