[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] From a string to node-set


Subject: [xsl] From a string to node-set
From: Dongling Ding <dling61@xxxxxxxxx>
Date: Wed, 27 Aug 2003 16:05:22 -0700 (PDT)

Hi,

I know there was difficulty to convert a string to
node-set before. Here I just want to check if there is
any new development regarding to this. Any workaround
to the following problem is very appreciated!


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.


Thanks


Dongling


try.xslt:

<xsl:template name="replacement">
<xsl:param name="pName"/>
<xsl:choose>
	<xsl:when test="$pName">
		<dd>it is there </dd>
	</xsl:when>
	<xsl:otherwise>
		<xsl:element name="?????name($pName)"/>
		<dd>it is not there</dd>
	</xsl:otherwise>
	</xsl:choose>
</xsl:template>




__________________________________
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