Non Sucking YAML parser
Robin Berjon
robin.berjon at expway.fr
Thu Sep 14 17:23:24 BST 2006
On Sep 14, 2006, at 17:27, David Wright wrote:
>> From my point of view it's very easy to have xsl:templates such as:
>
> <xsl:template match="//*[starts-with(name(), 'fooble:')]"/>
>
> That strips everything from a given namespace in one swoop. (I'm
> sure I came up with a cleaner way than that in XSL, but you see the
> economy.)
Ick! What happens when the same namespace is bound to a different
prefix? I sure hope you found a cleaner way :) One such way would be:
<xsl:template match="//*[namespace-uri() = 'http://ns.for.fooble']"/>
or even better, assuming you've declared the fooble prefix in your
stylesheet:
<xsl:template match="//fooble:*"/>
>> From the hand-mungers point of view, the XML is miles easier to read
> when they can easily identify the source of each element.
Like all rules of thumb, "don't use prefixes unless forced to" has
its exceptions (one of which is typically XSLT).
--
Robin Berjon
Senior Research Scientist
Expway, http://expway.com/
More information about the london.pm
mailing list