473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 2526
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wolfgang | last post by:
XSLT transformations by default seem to pass name space attributes into the root element of their output (example below). QUESTION: Is it possible to control this, i.e. not genrating a name...
1
by: Rosa | last post by:
hallo! it must be very easy, but I don't get the function document (explained in http://www.w3.org/TR/1999/REC-xslt-19991116#document) to work. I'm parsing an XML document with XSLT to write a...
6
by: RC | last post by:
Hello World, I am try do call a JavaScript function from XSLT, but I got function not avaible error. See "????" below. Would someone out there tell me how? Thank Q! <xsl:stylesheet...
8
by: Eric Phetteplace | last post by:
Hello, I am moving over from using msxml2.domdocument to system.xml and system.xml.xsl. I'd like to present this to my group today, so your help is appreciated. I want to transform an XML...
4
by: dar_imiro | last post by:
Hi, I'm trying to get rid of frames as menu holder in my html-page. I'd also like to separate the menu structure to xml and xslt. Also the actual content is divided to xml and its corresponding...
2
by: Scamjunk | last post by:
I have been desperately looking for a treeview-type solution for my problem for the past three weeks and have been greatly unsuccessful. I am totally new to the world of XSLT and I *don't know*...
4
by: Mario Vázquez | last post by:
Hi, I'm trying to put the links (href attribute of the <a> element) out of my XSLT files, in a XML file, and read it from the stylesheet. I suppose that I have to use the document() function to...
4
by: Michal | last post by:
Hi everyone, Microsoft states that the System.XML 1.0 included in framework 1.1 supports the W3C XSLT Specification. However, I am having a problem using the document() fuction specified in...
3
by: RC | last post by:
Let's say: if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { // Now I got an XML object here var xmlDocument = XMLHttpRequestObject.responseXML; // next I have...
0
by: ManWithNoName | last post by:
The following question is related to this thread: XSLT, document() function, filename, read non-standard/English characters (like µ) I have a XML file with a non-English character in its name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.