Subject: Re: [xsl] Why doesn't this simple XSLT (Identity transform) work? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 02 Dec 2009 11:12:46 -0500 |
At 2009-12-01 21:46 -0500, ohaya@xxxxxxx wrote:the problem was that the match I was using was not matching anything, so that xsl:template was not "catching", and the reason for not matching was because of the namespace.
Is that right?
Indeed.
At 2009-12-01 21:48 -0500, ohaya@xxxxxxx wrote:Also, I think that what was 'throwing me off' was that the "sig:" namespace was implicit. That was why I was using just "Signature" instead of "sig:Signature".
That it was not implicit was the problem. And even if you had declared the default namespace in your stylesheet it still would not have worked, because in an XPath address in XSLT an element without a prefix is assumed to be in no namespace (note in XSLT 2 there is an option to declare the default namespace to use for elements in XPath addresses).
So, one has to associate the desired input namespace with a prefix to use in the stylesheet, regardless of whether the input file is or is not using a prefix for namespaces.
<illustration xmlns="data:,illustration"> <element attribute="value"/> </illustration>
<xsl:template xmlns="data:,illustration" match="element"> ... </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Why doesn't this simple X, G. Ken Holman | Thread | [xsl] Group Techniques by xslt, Joga Singh Rawat |
Re: [xsl] Why doesn't this simple X, G. Ken Holman | Date | Re: [xsl] Group Techniques by xslt, Martin Honnen |
Month |