Subject: Re: [xsl] namespace problem From: "Ruud Grosmann r.grosmann@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 15 Sep 2014 08:26:49 -0000 |
As to your question (how to match in the xhtml namespace only), one helpful insight could be that the prefixes used in the XSLT do *not* have to be the same as the prefixes used in the source documents (which, indeed, may not always be consistent with one another either). Or anywhere else. Only the namespaces must correspond; the prefixes are only a way to get to the namespaces.
So neither of these would match 'char' in no namespace; one matches 'char' in the xhtml namespace ... and so does the other:
<xsl:template match="char" xpath-default-namespace="http://www.w3.org/1999/xhtml"> ... matches 'char' in the xhtml namespace
<xsl:template match="xh:char" xmlns:xh="http://www.w3.org/1999/xhtml"> ... matches 'char' in ... the xhtml namespace
I use saxon, and indeed, it gives a warning.Indeed, a helpful processor, when it sees both of these together in the same XSLT, will warn you that you have a template clash. (Try it. :-)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] namespace problem, Wendell Piez wapiez@ | Thread | [xsl] Replacing an apostrophe in a , Craig Sampson craig. |
Re: [xsl] How to Do Random "Shuffle, Dimitre Novatchev dn | Date | Re: [xsl] process xslt and xml spre, Wendell Piez wapiez@ |
Month |