Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL:Count on a passed parameter

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent