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

RE: Finding out the existence of a node

Subject: RE: Finding out the existence of a node
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 1 Jul 2002 15:27:47 +0100
xsl node existence
> Hi,
>      is there a way to find out if a particular node exists in an 
> xml file or not?
> For example, I have an xml file which has a node <MyName>, how can 
> I know if the same node is also present in another xml file which 
> the stylesheet is processing?

A node can only be present in one document. I guess you mean you want to
test if the other document has at least one node with the same name.

<xsl:if test="document('other.xml')//*[name()=name(current())]">

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> 
> <xsl:variable name="node_name" select="local-name()"/>
> gives me the name of the node into the variable node_name.
> 
> <xsl:param name="source" select="./Doc.xml"/>
> gives selects the path of Doc.xml into $source
> 
> Now how do I know whether $node_name is present in Doc.xml or not? 
> Please help me out.
> 
> Thanks,
> 
> Kalyan _________________________________________________________
> There is always a better job for you at Monsterindia.com.
> Go now http://monsterindia.com/rediffin/
> 
> 
>  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.