Connecting Tech Pros Worldwide Help | Site Map

XslTransform return Xml.InnerText

  #1  
Old November 12th, 2005, 04:48 AM
Franck
Guest
 
Posts: n/a
Hi,
Getting crazy with the XslTransform Class.
I'm trying to transform an xml string with an xsl string with the
following code :

'Create the XslTransform object and load the stylesheet.
Dim oXslXmlReader As XmlTextReader = New XmlTextReader(MyXslString,
XmlNodeType.Document, Nothing)
Dim oXslXslTransform As XslTransform = New XslTransform
oXslXslTransform.Load(oXslXmlReader, Nothing, Nothing)

'Load the xml to transform.
Dim OXmlReader As XmlTextReader = New XmlTextReader(MyXmlString,
XmlNodeType.Document, Nothing)
Dim xPathDoc As XPathDocument = New XPathDocument(OXmlReader,
XmlSpace.None)

'Transform the file
Dim sw As New System.IO.StringWriter
oXslXslTransform.Transform(xPathDoc, Nothing, sw, Nothing)
return sw.ToString

---
And in the end, sw.ToString equals MyXmlString.InnerText

Help please. I can't figure out the solution.

  #2  
Old November 12th, 2005, 04:48 AM
Franck
Guest
 
Posts: n/a

re: XslTransform return Xml.InnerText


NeverMind, xsl syntax error.

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
XslTransform return InnerText Franck answers 1 November 21st, 2005 08:43 PM