realbasic-nug
[Top] [All Lists]

Re: XML transform

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: XML transform
From: Andy Dent <dent@oofile.com.au>
Date: Thu, 31 Jul 2008 12:18:06 +0800
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: <DF43F488-AE44-4B3A-8CAA-FAFAFDB7E4F8@macsos.com.au>
References: <DF43F488-AE44-4B3A-8CAA-FAFAFDB7E4F8@macsos.com.au>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

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

Andy Dent
Freelance Designer-Developer - C++,  C#, Objective-C, Python, REALbasic


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