471,610 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Can't get xslt document() function to work.

Hi,

I can't get the following call to document() to work in a VB .Net (1.0)
application, but it works in IE6.

Can anyone tell me why this doesn't work?

== XSLT fragment
<xsl:param name="docstructurepath"/>

<xsl:value-of select="document($docstructurepath)//servinfo[@id =
$target]/@title"/>

==

== VB .Net fragment
Dim xdoc As New XmlDocument()
xdoc.LoadXml(strTgtText) 'strTgtText is generated string of xml data

Dim msWriter As New MemoryStream()

Dim xslParam As XsltArgumentList = New XsltArgumentList()
xslParam.AddParam("docstructurepath", "", strTgtFolder & "\docstructure.xml")
Dim resolver As XmlUrlResolver = New XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials

xdoc.XmlResolver = resolver
xsldoc.Transform(xdoc.CreateNavigator, xslParam, msWriter)

==

<xsl:value-of select="$docstructurepath"/> shows the correct path in the
output.

Nov 12 '05 #1
1 2485
Harry wrote:

== VB .Net fragment
Dim xdoc As New XmlDocument()
xdoc.LoadXml(strTgtText) 'strTgtText is generated string of xml data

Dim msWriter As New MemoryStream()

Dim xslParam As XsltArgumentList = New XsltArgumentList()
xslParam.AddParam("docstructurepath", "", strTgtFolder & "\docstructure.xml")
Dim resolver As XmlUrlResolver = New XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials

xdoc.XmlResolver = resolver
xsldoc.Transform(xdoc.CreateNavigator, xslParam, msWriter)


Is your URI absolute or relative? Relative URIs are resolved relatiev to
XSLT stylesheet's base URI - show us how you load xsldoc.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Eric Phetteplace | last post: by
2 posts views Thread by Scamjunk | last post: by
4 posts views Thread by Mario Vázquez | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.