hi jason,

the issues you mentioned about the lack of usability regarding the (absolutely brilliant) XPath-Class really sound familiar... :-[ would you mind to share your solution with the list? especially the mentioned CDATA-stuff sounds promising...

tia!

henrik

--
Henrik Weber
Certified Flash Developer
__freemind-design__
http://www.freemind-design.de

flashcoders@chattyfig.figleaf.com wrote:
Date: Tue, 27 Jun 2006 22:34:45 -0400
From: Doug Tangren <[EMAIL PROTECTED]>
Subject: Re: [Flashcoders] > Documentation of the XFactor's XPath
        class?
To: Flashcoders mailing list <flashcoders@chattyfig.figleaf.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

While recently poking around for information on using xfactorstudio's xpath I came across this thread. If possible can you share the source for this utility class you wrote? These would be very helpful. Thanks.

Doug Tangren
[EMAIL PROTECTED]



On Jun 27, 2006, at 4:30 PM, Merrill, Jason wrote:

I have some classes I wrote which make using xfactorstudio's Xpath
classes easier, if you want them.  Comes with a little bit of example
code commented in the class.  Requires xfactorstudio's classes to be
installed already.

Here is the comment and example code in one of the classes:

Description: This class was created to make getting xfactorstudios'
XPath node values much simpler and easier. It handles CDATA nodes, which
can be very tricky with XPath. It also converts the raw strings
representations of booleans and numbers to their actual primitive
values.  It will decode character entities in XML values to real
representations. For example, it converts "&amp;" to "&".
        
Usage Example:

//initialize the object:
var xd:XData = new XData(myXMLObject);

 //get value from an attribute:
var myAttributeString:String = xd.getString("menu/items/item[3] @width");


//get value from a node value:
var myNodeString:String = xd.getString("menu/items/item[3]/text()");

//finds the array position of "Welcome" in example node <item
title="Welcome"/>
var myAttributePosition:Number = xd.getNodePosition("menu/items/item",
"title", "Welcome");

//get a CDATA string:
var myCDATAParagraph:String = xd.getString("menu/items/item[3]/ content",
true);


Jason Merrill
Bank of America
Learning & Organization Effectiveness - Technology Solutions

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to