Sajid Saiyed wrote:
Hi,
My data is not this simple or static.
???not static - your XML changes after you have read it???
I gave this sample XML just to explain the structure.
The XML is going to be dynamic, hence I need to parse it using
something like XPATH (I suppose).
If the XML changes while you are using it, you will have to use it
dynamically and then you do not need the arrays and objects - just a set
of parsing routines that wander through the tree looking for data.
This is a bit more complicated but we do it often; even for static data
sometimes.
Unless you change your XML structure to be a bit more "normal", XPath
will be hard to use and you will have to climb up and down the tree
yourself.
Ron
Regards
On 6/5/06, Weldon MacDonald <[EMAIL PROTECTED]> wrote:
If your data is that consistent and all you need is to transfer it to
arrays, then why do you need xpath, you could write your own parser,
using while loops, to do this in very little time.
I'm not an experrt, but it seems to me that xpath is more useful for
dynamic access to the xml. Is that not correct?
If I am correct, an interesting question is; what is more efficient,
transferring to arrays and using the arrays, or dynamically accessing
the xml directly?
On 6/5/06, Sajid Saiyed <[EMAIL PROTECTED]> wrote:
> Hi,
> I have an XML like this:
>
> <root>
> <totalLayers>
> <number>5</number>
> </totalLayers>
> <LayerOne>
> <asset>
> <name>somename0.bmp</name>
> <width>20</width>
> <height>10</height>
> <xPos>50</xPos>
> <yPos>30</yPos>
> </asset>
> <asset>
> <name>somename1.bmp</name>
> <width>20</width>
> <height>10</height>
> <xPos>50</xPos>
> <yPos>30</yPos>
> </asset>
> </LayerOne>
> <Layertwo>
> <asset>
> <name>somename2.bmp</name>
> <width>20</width>
> <height>10</height>
> <xPos>50</xPos>
> <yPos>30</yPos>
> </asset>
> </LayerTwo>
> </root>
>
> I want to use XPATH or something similar to create dynamic
> arrays/string and store values respectivele like this:
>
> String:
> totalLayers = "5";
>
> LayerOne and LayerTwo will be a multidimentional array"
>
>
LayerOne[[asset[name,width,height,xpos,ypos]][asset[name,width,height,xpos,ypos]]...]
>
LayerTwo[[asset[name,width,height,xpos,ypos]][asset[name,width,height,xpos,ypos]]...]
> etc...
>
> Any hint or suggestion...?
> _______________________________________________
> [email protected]
> 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
>
--
Weldon MacDonald
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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