|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Creating and passing XML String to xsl:call-templa
Avula, Raj wrote:
I want to create a XML String in a template and pass it as a paramter to xsl:call-template. There I want to parse that XML String and get the values. Reasons why I want to do this is to reduce number of parameters passed to xsl:call-template and other is to reduce the size of the calling template. First of all it's not really string but tree (rtf aka result tree fragment, see http://www.w3.org/TR/xslt.html#section-Result-Tree-Fragments). > <customer> <xsl:if test="cust_name1"> <name> <xsl:value-of select="cust_name1" /> </name> <xsl:if> <xsl:if test="cust_name2"> <name> <xsl:value-of select="cust_name2" /> </name> <xsl:if> You forgot </customer> </xsl:variable> for-each needs node-set, but you have rtf, so the only way is to convert it to node-set by xxx:node-set(rtf) ext function, where xxx - is your processor extension (see your xslt processor's doc). <xsl:for-each select="xxx:node-set($xmlstr)/customer/name"> .... </xsl:template> I think it's the best way.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








