[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Re: Sort XML based on Tokenized String of sort by
> I tried to create a variable to hold this stylesheet but when > I output the variable - it is empty. > > Like I try > > > <?xml version="1.0"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="2.0" xmlns:saxon="http://saxon.sf.net/"> > > <xsl:variable name="PATH" select="REPORT/REPORT_FORMAT/PARENT_NODE"/> > <xsl:variable name="ORDER_BY" > select="REPORT/REPORT_FORMAT/ORDER_BY"/> > <xsl:variable name="ORDER_BY_TOKEN" > select="tokenize($ORDER_BY,'\s*,\s*')"/> > > <xsl:strip-space elements="*"/> > > <xsl:output indent="yes"/> > > <xsl:template match="/"> > <xsl:variable name="NEW_STYLESHEET" > <xsl:element name="xsl:transform"> > .... > </xsl:element> > </xsl:variable> That's fine so far. > <xsl:value-of select="$NEW_STYLESHEET"/> xsl:value-of flattens whatever you give it into a single text node: it loses all the markup. If you want to see what's in the variable, use xsl:copy-of. To do the transformation, you just want <xsl:copy-of select="saxon:transform(/, $NEW_STYLESHEET)"/> Michael Kay http://www.saxonica.com/
|
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
|