Thanks,
I went back a search through them and found one good thread but it
did not work.
Here is what I found ...
I use this simple snippet of XSLT I found on the web:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/
XSL/ Transform"> <xsl:output method="xml" indent="yes" /> <!--
here's the trick --> <xsl:template match="*"> <xsl:copy> <xsl:copy-
of select="@*" /> <xsl:apply-templates /> </xsl:copy> </
xsl:template> <xsl:template match="comment()|processing-instruction
()"> <xsl:copy / > </xsl:template> </xsl:stylesheet>
Throw this in a constant called kXLTPrettyPrint and then just:
tos.Write(XMLDoc.Transform(kXLTPrettyPrint)) //tos is your
TextOutputStream
I tried this and all I got was a error that says "An exception of
class XmlException was not handeled." "XML parser error 4: not well-
formed(invalid token)"
Here is what I but in to a push button as a test...
Dim xml as XmlDocument
Dim root, person, firstname, lastname as XMLNode
Dim f As FolderItem
f = GetFolderItem("test.xml")
Dim t As TextOutputStream
t = f.createTextFile
xml = New XmlDocument
root = xml.AppendChild(xml.CreateElement("root"))
person = root.AppendChild(xml.CreateElement("person"))
firstname = person.AppendChild(xml.CreateElement("firstname"))
firstname.AppendChild(xml.CreateTextNode("John"))
lastname = person.AppendChild(xml.CreateElement("lastname"))
lastname.AppendChild(xml.CreateTextNode("Doe"))
t.write(xml.Transform(kXLTPrettyPrint))
t.close
Can someone please point out what I'm going wrong...
Thanks,
Charles
On Sep 21, 2006, at 6:36 AM, Ian R wrote:
On Sep 20, 2006, at 6:32 PM, Charles E. Heizer wrote:
Hello,
I just got a copy of RB 2006r3 and it's been a while since I last
used RB (5.5). I have written a small console app which tries to
create a xml results file. It creates the file just fine it's only
that it does not format the text in a good way. I have not been
able to find any good info on how to get the output formatted in
such a way that it's not all on one line. Can someone please help
me on this.
Due to my own inexperience, I believe, I have never personally
gotten it to work, but there is an XML function called (I think)
XSLTransform, or something to that effect. It's definitely in the
archives, try doing a search for that.
Ian
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>