Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: 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 9:28:00 AM I am using the XSLT processor that .NET uses. I am assuming that it is with the latest version of MSXML. When I form the XML string and pass it as an argument it seems that the XSLT processor (at least with .NET) "automatically" turns it into an XmlDocument. I have been using this for some time now, using the expression as part of an XPath expression in the XSLT stylesheet: <xsl:if test="current()/Relationship/Relation/SKU = $IdenticalList/root/list/sku"> looping through the values, etc. I hae just run into this problem with the function count(). I think what you are describing below is the behavior that I have come to rely on. Now I just want to return the count of an XPath expression on that node list. Any ideas on how to do that? Thank you. Kevin "Martin Honnen" wrote: > 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 | |||
|
