Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Moving from MSXML to .NET - document('') doesn't work? [Thread Next] Re: Moving from MSXML to .NET - document('') doesn't work?To: NULL Date: 11/5/2004 11:51:00 AM The following line outputs 0, which is surprising ...
<xsl:value-of select="count(document('')//*)" />
Vb.NET code is something like this ...
xsl = New System.Xml.Xsl.XslTransform()
url_rslv = New System.Xml.XmlUrlResolver()
url_rslv.Credentials = System.Net.CredentialCache.DefaultCredentials
xsl.XmlResolver = url_rslv
xsl.Load(xslTmp.CreateNavigator)
xw = New System.IO.StringWriter()
xsl.Transform(xmldoc.CreateNavigator, Nothing, xw)
Console.Write(xw.ToString)
--scott
"Martin Honnen" wrote:
>
>
> rox.scott wrote:
> > I am porting all code from MSXML4 to .NET parser.
> >
> > It appears that XPath Document() function is not working anymore ?!?!
> >
> > I am passing empty string as the parameter to search within the current XSL
> > document:
> > e.g (in this example, $cvf is always empty):
> >
> > <xsl:template name="conversion">
> > <!-- unit conversion table -->
> > <units>
> > <convert from="ppm" to="ppt">1000000</convert>
> > <convert from="ppm" to="oz/ton">0.029167</convert>
> > <convert from="ppm" to="mg/kg">1</convert>
> > <convert from="ppb" to="ppm">0.001</convert>
> > <convert from="g" to="mg">1000</convert>
> > <convert from="ppm" to="g/tonne">1</convert>
> > <convert from="ppm" to="%">0.0001</convert>
> > ...
> > <xsl:variable name="cvf">
> > <xsl:value-of select="document('')//units/convert[@from=$f and @to=$t]"/>
> > </xsl:variable>
>
> How are you running the transformation? You need to make sure you pass
> in a UrlResolver if you want to have document() calls executed.
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
