Re: [Flashcoders] [semi-OT] XPath expressions

2007-04-11 Thread Ron Wheeler
You might try asking this in a forum dedicated to XPATH and XSLT. 
(Perhaps on Apache)


http://xml.apache.org/xalan-j/

They recommend
http://mulberrytech.com/xsl/xsl-list/index.html


I suspect you will find some real XPATH gurus who can fix you up in a 
hurry .


Ron

Hairy Dog Digital wrote:

Hi all,

I've been giving myself a crash course on XPath using XFactor Studios XPath
(AS2) in Flash and also with the XML Spy's built in XPath evaluator tool.
I'm still having some difficulty constructing some XPath expressions to best
fit my needs -- assuming that it can be done.

I'm working on a project that is a database of different document types for
various parts/products. The structure of the XML is...

family ID= label=
group ID= label=
part ID=ABCDE type= partNo= description=
document type=A label= file=ABCDE-A.pdf/
document type=B label= file=/
document type=C label= file=/
document type=D label= file=ABCDE-docD.pdf/
document type=E label=
file=installation.pdf/
document type=F label= file=/
document type=G label= file=/
/part
part ID=XYZ type= partNo= description=
document type=A label= file=XYzee.pdf/
document type=B label= file=/
document type=C label= file=/
document type=D label= file=ex2why.doc/
document type=E label=
file=installation.pdf/
document type=F label= file=/
document type=G label= file=/
/part
/group
/family 

There is no text in the elements. All data is presented as values of
attributes.

What I am trying to achieve is generating a new XML object based on specific
ID criteria and file attributes of document elements not being null.

For example, if I need all existing documents of parts that have CD in
their ID, the output XML object should be:

family ID= label=
group ID= label=
part ID=ABCDE type= partNo= description=
document type=A label= file=ABCDE-A.pdf/
document type=D label= file=ABCDE-docD.pdf/
document type=E label=
file=installation.pdf/
/part
/group
/family 

I can select the part nodes based on criteria by using -- //part
[contains(@ID,\'HD2FB\')] -- which spits back an array of found part
elements and included child nodes. And, I can select documents where the
file attribute is not null by using -- //document [EMAIL PROTECTED] != ''] -- 
which
spits out the document elements. But, is it possible to get back the full
hierarchy based on selection criteria without having to reiterate and
rebuild the XML on the fly?

...Rob

___
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


  

___
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


RE: [Flashcoders] [semi-OT] XPath expressions

2007-04-11 Thread Hairy Dog Digital
Thanks Ron!

I realized I was wandering off-topic with this thread. As it turns out,
short of an XSLT implementation in Flash MX 04 (or Flash 8), I'm not going
to get any further with transforming my input XML to the desired output
XML/XHTML. 

I burned the night working on traversing nodes and extract relevant
attributes a la DOM-style. While not the most efficient way to do it, it
might be the only way to do it. That is, of course, unless someone knows of
an XLST implementation for Flash MX04.

...Rob

___
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