[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: matching templates without attributes

Subject: RE: matching templates without attributes
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 8 Jul 2002 22:56:46 +0100
v shipment
> 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@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 
> 
> 	<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.