[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Root when the current node is part of Parameter Re
> -----Original Message----- > From: Colin Toal > > The problem is that - within the context of the ParamColour matching > template, the key object doesn't seem to be defined - in fact, Hi, The actual problem seems to be that your xsl:param is being defaulted to a string type. Try setting the type to RTF explicitly like: <xsl:param name="ParamColour"><default /></xsl:param> Then again, you would need exsl:node-set() or a similar extension function to pull it off completely... So to default it to a node-set, try: <xsl:param name="ParamColour" select="document('')" /> > even root of this context node ( i.e. <xsl:copy-of select="//" /> is only the > Parameter contents. This makes me very sad. Yes, but in the context of the Object template it makes you happy (?) Does it work in there? Fact is, in the case of the key, the param evaluated as a string would still give the correct result, where in the other case you *need* a node-set (apply-templates). If you insist on not using extension functions, I'd go for an approach like <!-- default to empty string --> <xsl:param name="ParamColour" /> <xsl:param name="ObjectName" /> <xsl:template match="/Objects"> <FoundObject> <xsl:apply-templates select="key('kObject',$ObjectName)" /> </FoundObject> </xsl:template> <xsl:template match="Object"> <xsl:copy-of select="." /> <xsl:if test="Colour = $ParamColour"> Is the same colour! </xsl:if> </xsl:template> Hope this helps! Cheers, Andreas 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
|