This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: matching templates without attributes


> Hi,
>  I am new to XSLT. I am trying to match an element through 
> XSLT as follow.
> 
> Input XML is like:
> 	<shipment xmns="http://www.foo.com/namespaces/v";>
> 		 ....
> 		 ....
> 	</shipment>

Think of the element name as a namespace URI plus local name:
("http://www.foo.com/namespaces/v";, shipment).
> 
> in XSLT, i have:
> 	<xsl:template match="/">
> 		<xsl:apply-templates select="shipment"/>
> 	</xsl:template>

This is selecting nodes named ("", shipment). To select nodes named
("http://www.foo.com/namespaces/v";, shipment) you need to write

<xsl:apply-templates select="v:shipment" 
   xmlns:v="http://www.foo.com/namespaces/v"/>

and similarly for the match="shipment".

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 
> 
> 	<xsl:template match="shipment">
> 		.. do some thing ....
> 	</xsl:template>
> 
> 
> In above case i dont get any transformed output. And if 
> comment out xmns from <shipment> element it results proper 
> output. So How to specify in XSLT to ignore xmns attribute 
> for shipment template to get output?
> 
> thanks
> VENKAT
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]