[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fw: XSL macros stronger then XSLT
> I got the following error message: > DID NOT EXPECT cannot convert to node-set > I hope this is just a problem in XT No I think it's just a problem of semantics (if I may mention semantics on this list, which is of course mainly concerned with style) The error message means: You didn't declare the parameter in the template. <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" result-ns=""> <xsl:template name="Wrapper"> <xsl:param-variable name="Content"/> <!-- ADDED THIS LINE --> <xsl:element name="W"> <xsl:copy-of select="$Content"/> </xsl:element> </xsl:template> <xsl:template match="C"> <xsl:call-template name="Wrapper"> <xsl:param name="Content"> <xsl:attribute name="B">b value</xsl:attribute> </xsl:param> </xsl:call-template> </xsl:template> </xsl:stylesheet> applied to <C B="hello"> <xxx/> c text </C> produces no error and this output <W B="b value"/> which is I think what you wanted? David 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
|