D
darrel
I can navigate an XML file to find a particular value as such:
Dim xpd As System.Xml.XPath.XPathDocument = New
System.Xml.XPath.XPathDocument(XMLfile)
Dim xpn As System.Xml.XPath.XPathNavigator = xpd.CreateNavigator()
and then I create an expression and navigate to the value I want.
I'm now wanting to cache this file. To do so, I read in the file, and then
set that string to the cache object:
Dim file As New
System.IO.StreamReader(HttpContext.Current.Server.MapPath("myfile.xml")
XMLfile = file.ReadToEnd
file.Close()
(set the cache object to this string).
The problem in doing that is that my XPD is now a string...not a reference
to a file. It appears that an XPathDocument needs to reference a physical
file, rather than the cached XML data itself.
I'm stuck as to what I need to do to make this work. Do I need to use
something other than an XPathDocument?
-Darrel
Dim xpd As System.Xml.XPath.XPathDocument = New
System.Xml.XPath.XPathDocument(XMLfile)
Dim xpn As System.Xml.XPath.XPathNavigator = xpd.CreateNavigator()
and then I create an expression and navigate to the value I want.
I'm now wanting to cache this file. To do so, I read in the file, and then
set that string to the cache object:
Dim file As New
System.IO.StreamReader(HttpContext.Current.Server.MapPath("myfile.xml")
XMLfile = file.ReadToEnd
file.Close()
(set the cache object to this string).
The problem in doing that is that my XPD is now a string...not a reference
to a file. It appears that an XPathDocument needs to reference a physical
file, rather than the cached XML data itself.
I'm stuck as to what I need to do to make this work. Do I need to use
something other than an XPathDocument?
-Darrel