[thelist] XSLT XML output to XML

David Johansson thelist at dlade.net
Tue Apr 17 10:29:30 CDT 2007

Jon Molesa wrote:
> What I don't exactly get is: do namespaces become part of the path?  I
> can see it in gnc:transaction and slot:key, but does XPath require them
> to transverse the tree?  Or is this one of the generally preferred way
> to do things since it's more explicit?  IOW, would the above work
> without the ns?

The match happens on the full name of the node, so namespaces do become 
part of the match. There is a function called local-name() that would 
allow you to do something like *[local-name(.) = 'transaction'] if you 
wanted to be namespace insensitive if you really wanted to.

> Figured the normalize-space() as well, but it is a rather odd function
> name.  At least when compared to programming languages.

Agreed. But I think the name reflects the fact that it doesn't just 
strip spaces from the start and end, it also "normalizes" multiple 
spaces into single ones in the same style a web browser does.

> Is it fair to say then that most of an XML file(not always true) is
> going to be structure, and small amounts of content?

This very much depends on your perspective and what kind of XML you're 
working with. A lot of arguments in the XML world have come from the 
difference in opinion between "document heads" (say, someone marking up 
a book) and "data heads" (using XML for accounting, for example =).


More information about the thelist mailing list