Re: [xml] empty xmlns attributes

On Thu, Feb 13, 2003 at 12:56:18AM +0000, Peter McGarvey wrote:
Now the question is "How to get the stylesheet to assume a namespace if
none is given?"

 If you mean ... if none is given in the input document ? If yes I don't
think it's possible to have xsl:copy and similar operations do magical
 If you mean ... if none is given in the stylesheet itself ? Then the
simplest is to define that default namespace on the root of the xsl:stylesheet
with xmlns="...."

But I think that would best be left for another time...

  The best is to reread the (relatively short but a bit dense) descriptions
of node selections in the XPath specs. XPath only manipulates nodes
as their (namespace href, local name) pairs, all the computations are done
that way, similary for XSLT. It's easy to forget about this when learning
them on non-namespaced vocabularies (like DocBook), and have surprises
when first encountering them.


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]