[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fwd: document() doesn't pick up a param
Michael, >The XSL statement "with-param" doesn't seem to be carried over to processing of >nodesets from "document(...)" calls. When you use document(), it gives you the *root node* of the document that's named. So when you do: <xsl:apply-templates select="document('incoming.xml')"> <xsl:with-param name="blah" select="555"/> </xsl:apply-templates> you're applying templates to the root node (/) of 'incoming.xml'. In your case, you have no template that explicitly matches the root node, so the built-in template matches instead: <xsl:template match="*|/"> <xsl:apply-templates /> </xsl:template> You'll notice that the built-in template doesn't declare any parameters nor pass any on within the xsl:apply-templates. Essentially this means that any parameters you pass in are ignored and forgotten, and therefore appear not to be being passed. Rather than applying templates to the root node of the document, you want to apply templates to the document element ('matchme'): <xsl:apply-templates select="document('incoming.xml')/matchme"> <xsl:with-param name="blah" select="555"/> </xsl:apply-templates> I hope that helps, Jeni Jeni Tennison http://www.jenitennison.com/ 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
|