xsl-list
[Top] [All Lists]

Re: [xsl] Template matching with multiple namespaces

2009-03-20 04:56:35
Try,

<xsl:apply-templates select=".//*[local-name() = 'LandXML']" />

-- Jeff

On 03 20, 09, at 4:41 PM, Hermann Stamm-Wilbrandt wrote:


I think this would work:

<xsl:apply-templates select=".//*:LandXML" />

It does not work for xsltproc:
$ xsltproc a.xsl
Error xpath.c:10147: Invalid expression
.//*:LandXML
   ^
compilation error: file a.xsl line 17 element apply-templates
xsl:apply-templates : could not compile select expression '.// *:LandXML'
$


"local-name(.)='LandXML'" works fine for <xsl:when test=...>.
It does work neither for <template match=...> nor for <xsl:apply- templates
select=...> ...


Mit besten Grüßen / Best wishes,

Hermann Stamm-Wilbrandt
Developer, XML Compiler
WebSphere DataPower SOA Appliances
----- Forwarded by Hermann Stamm-Wilbrandt/Germany/IBM on 03/20/2009 09:33
AM -----

            Jeff Sese
            <jeferson(_dot_)sese(_at_)as
iatype.com> To
                                      
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
03/20/2009 06:54 cc
            AM
Subject
                                      Re: [xsl] Template matching with
            Please respond to         multiple namespaces
            xsl-list(_at_)lists(_dot_)mu
             lberrytech.com








I think this would work:

<xsl:apply-templates select=".//*:LandXML" />

This will apply to all elements that has a local name of LandXML

-- Jeff

On 03 20, 09, at 11:18 AM, Tony Rowe wrote:

Hi,

I have a stylesheet which works with one namespace, prefix say
'lml'. I
now want the same stylesheet to work on documents under another
namespace, say lml10.

Here is my namespace defs...

<xsl:stylesheet version="1.0"
xmlns:lml=...
xmlns:lml10=...
xmlns:msxsl=...
xmlns:xsl="...


Now the stylesheet does, of course match nodes such as

<xsl:apply-templates select=".//lml:LandXML" />

But I want it to also match on

<xsl:apply-templates select=".//lml10:LandXML" />.

How can I set up some variable to allow me not to have to duplicate
code?

This doesn't work...NodeTest expected.
<xsl:apply-templates select=".//{$namespacevariable}:LandXML" />

Or is there a better way to get the one stylesheet to work over
multiple
namespaces?

I am using XSLT 1.0 still because I need to use the MSXML parser 6.0.

Tony

--~------------------------------------------------------------------
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>
--~--


Jeferson L. Sese
jeferson dot sese at asiatype dot com
Asiatype Inc.
Suite 114 Columbia Tower
Ortigas Ave., Greenhills
Mandaluyong City 1550 Philippines
Tel: +632-744-6262
Mobile: +63927-671-7901




--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--


Jeferson L. Sese
jeferson dot sese at asiatype dot com
Asiatype Inc.
Suite 114 Columbia Tower
Ortigas Ave., Greenhills
Mandaluyong City 1550 Philippines
Tel: +632-744-6262
Mobile: +63927-671-7901




--~------------------------------------------------------------------
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>
--~--