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

RE: From a string to node-set

Subject: RE: From a string to node-set
From: Dongling Ding <dling61@xxxxxxxxx>
Date: Thu, 28 Aug 2003 10:05:12 -0700 (PDT)
xsl string to node set
Thanks for reply!

> > I created a template called replacement with one
> > parameter, which checks the test.xml to see if
> there
> > is an element there, if yes, copy that element and
> > value; if not, create that element.
> > 
> > My problem is that if i pass the parameter as
> node-set
> > i need to convert node-set to string. However,
> that
> > node-set is empty since the element is not there.
> If I
> > pass the parameter as string, I need to convert
> string
> > into node-set and test its existence. That causes
> me a
> > problem.
> 
> You won't be able to make the latter test even if
> you could convert a string into a node-set, because
> that new node-set wouldn't contain the same nodes as
> the source tree. You could only test if an element
> by that name exits, testing for identity wouldn't
> work.

At this moment I can only get string and pass it into
the template. How can I test if an element by that
name exists?

Thanks


Dongling



> Anyhow, pass both the name and the node-set, as two
> parameters. 
>  
> > 	<xsl:otherwise>
> > 		<xsl:element name="?????name($pName)"/>
> 
> You need to use AVT, ie.
> 
>   <xsl:element name="{name($pName)}">
>     ...
> 
> Cheers,
> 
> Jarno
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 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.