xsl-list
[Top] [All Lists]

Re: [xsl] Why doesn't this simple XSLT (Identity transform) work?

2009-12-02 09:20:25
At 2009-12-01 21:46 -0500, ohaya(_at_)cox(_dot_)net 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(_at_)cox(_dot_)net 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.

I hope this helps.

. . . . . . . . . . . . Ken


--
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--