Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XSL:Count on a passed parameter >Thread Next - Re: XSL:Count on a passed parameter Re: XSL:Count on a passed parameterTo: NULL Date: 7/30/2008 2:09:00 PM Kevin Burton wrote: > I am building an XML string and passing it as a parameter to the XSL style > sheet. Currently I have something like: > > Identical Errors - <xsl:value-of > select="count($IdenticalList/root/list/sku)"/> > > Where $IdenticalList is the XML string that is passed in. Which XSLT processor are you using? If you have a string with XML markup and you want that to be parsed as XML then you can't simply pass it to the XSLT processor, rather you first need to parse it yourself and then, if the XSLT processor supports it, you can pass in a node to the XSLT processor. For instance, for MSXML and the addParameter method, the documentation http://msdn.microsoft.com/en-us/library/ms762312(VS.85).aspx shows that you can pass in an XML DOM node or a node list. With .NET and XslCompiledTransform and XsltArgumentList, see http://msdn.microsoft.com/en-us/library/system.xml.xsl.xsltargumentlist.addparam.aspx you can pass in an XPathNavigator so you would first parse your XML string with XPathDocument, then create an XPathNavigator and pass that in. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
