Groups | Blog | Home
all groups > dotnet xml > august 2005 >

dotnet xml : XslTransform return Xml.InnerText


Franck
8/8/2005 11:59:12 PM
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.
Franck
8/9/2005 12:45:34 AM
NeverMind, xsl syntax error.
AddThis Social Bookmark Button