realbasic-nug
[Top] [All Lists]

Re: XML Formatting

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: XML Formatting
From: Michael Diehr <md03@xochi.com>
Date: Fri, 29 May 2009 09:04:35 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <A17A9771-AC05-4DD4-9355-D79C4F2CB7DD@llnl.gov>
References: <A17A9771-AC05-4DD4-9355-D79C4F2CB7DD@llnl.gov>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
try this:

  dim xml as xmldocument
  dim r as string

 if prettyFormat then

  dim transformXSLT as string = "<xsl:stylesheet version='1.0'" +_
  " xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +_
  "<xsl:output method='xml' indent='yes' />" +_
  "<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>"

    r = xml.Transform(transformXSLT)
  else
    r = xml.ToString
  end if


On May 29, 2009, at 8:37 AM, Charles E. Heizer wrote:

Hello,
Is there a function/class to format my XML output similar to Apple's "NSXMLNodePrettyPrint"?

Thanks,
- Charles

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>