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

Create a node-set from a string parameter?

Subject: Create a node-set from a string parameter?
From: "Super, Karen" <Karen.Super@xxxxxxxxxxxxx>
Date: Mon, 10 Apr 2000 12:29:24 -0500
karen super
How can I create a node-set out of a string?  What I currently have isn't
working.  I am getting an XSL exception of "cannot convert to node-set".
Here is a little more information:

I am using XT and I am passing in a String parameter into my stylesheet.  My
code looks like:

String xmlFields =
"<xml><fields><field>001</field><field>012</field><field>018</field></fields
></xml>";
xslProcessor.setParameter("DISP", xmlFields);

My stylesheet looks like:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' 
	xmlns:xt='http://www.jclark.com/xt' version='1.0'>
<xsl:output method='xml' indent='yes'/>
<xsl:param name='DISP'/>
<xsl:variable name='display'
select=\"xt:node-set($DISP)/xml/fields/field\"/>
<xsl:template match='/'>
	<Content><xsl:apply-templates select='//*[@fn=$display]'/>
	</Content>
</xsl:template>
</xsl:stylesheet>

My XML looks like:

<record fn='001'>
<citation fn='003'>001-01-0032</citation>
<name fn='012'>
	<last fn='012'>Jones</last>
	<first fn='012'>Joe</first>
</name>
<city fn='018'>CONCORD</city>
<state fn='018'>NH</state>
<zip.code fn='018'>03301</zip.code>
</record>

The idea is to only act on those elements whose attribute fn matches one of
numbers in the input DISP parameter.  Anyone have any ideas as to what might
be wrong?

Thanks,
Karen


 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.