realbasic-nug
[Top] [All Lists]

Re: XML transform

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: XML transform
From: Charles Yeomans <charles@declareSub.com>
Date: Thu, 31 Jul 2008 10:23:30 -0400
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: <6B048D21-721F-4156-B82B-BC56FAE420D6@oofile.com.au>
References: <DF43F488-AE44-4B3A-8CAA-FAFAFDB7E4F8@macsos.com.au> <6B048D21-721F-4156-B82B-BC56FAE420D6@oofile.com.au>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Jul 31, 2008, at 12:18 AM, Andy Dent wrote:


On 30/07/2008, at 2:25 PM, Gerard Hammond wrote:
Could someone please help me with some RB code to transform this fragment of XML into the simpler string at the bottom
          <Method>
              <Name>DrawPicture</Name>
              <Parameters>
                  <Parameter Number="0">
                      <Name>Image</Name>
                      <Type>Picture</Type>
...
Graphics.DrawPicture Image, X, Y, [DestWidth], [DestHeight], [SourceX], [SourceY], [SourceWidth], [SourceHeight]

Complete sample using XSL posted at http://www.oofile.com.au/files/REALbasic/MethodToText.zip as an RB2008r3.1 project.

The transformation bit for anyone using earlier versions is simply:
 dim xd as  new XmlDocument
 xd.LoadXml( sampleXML)
 dim result as string = xd.Transform( sampleXSL )

where sampleXML and sampleXSL are string constants containing the text of the XML and XSLT documents respectively.

My advice for anyone trying to debug XSLT like this is to buy the excellent Oxygen cross-platform XML editor which has fantastic XSLT debugging (both v1.0 and v2.0) and much more.

enjoy


I am.  Thanks for making it available.

Charles Yeomans

_______________________________________________
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>