This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Convert String to node-set?
- From: "Manish M. Shah" <manish at catylist dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: 02 May 2002 09:56:20 -0500
- Subject: [xsl] Convert String to node-set?
- References: <000001c1f098$76c2aed0$936ab818@COM> <00e001c1f1c0$0232e7f0$dedeff70@BERYOZKIN>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello there,
I'm attempting to convert a String to a node-set, where I have two
different XML branches in one XML file.
Here's my XML file:
<JSPRoot>
<listing>
<saleTerms>a</saleTeerms>
<saleTerms>b</saleTerms>
</listing>
<WizardBluePrint>
<Property>
<Category>
<Group>
<Field>
<DataLocation>/listing></DataLocation>
<DatabaseVariableName>saleTerms</DataLocation>
<Option>a</Option>
<Option>b</Option>
<Option>c</Option>
</Field>
</Group>
</Category>
</Property>
</WizardBleuPrint>
</JSPRoot>
What I need to do is iterate through JSPRoot/listing/saleTerms,and since
it has a and b, i want to set a and b as selected in
JSPRoot/WizardBluePrint/Property/Category/Group/Field.
I tried saxon:node-set() to convert, and no luck. Anyone have any ideas.
Here's my code:
<xsl:for-each
select="saxon:node-set(normalize-space(concat('/JSPRoot',DataLocation,'/',DatabaseVariableName)))">
<xsl:for-each select="InputMechanism/Option">
<xsl:value-of select="$dataLocation"/>
<option>
<xsl:attribute name="value">
<xsl:value-of
select="normalize-space(@value)"/>
</xsl:attribute>
<xsl:if
test="normalize-space(saxon:evaluate($dataLocation))=normalize-space(@value)">
<xsl:attribute name="selected">
selected
</xsl:attribute>
</xsl:if>
<xsl:value-of
select="normalize-space(@value)"/>
</option>
</xsl:for-each>
</xsl:for-each>
Thanks.
Manish
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list