I guess you haven't explained very well yet. But let's present you some
approach that MAY be what you are looking. That's saving the reference.
var lastMatch:XML;
for (...){
if( condition_matched){
lastMatch = (absolute path); //
myXml.books[0].book.covers.cover[2].items[2].data123
for example
break;
}
}
then you can use lastMatch as a reference to that absolute path.
On Jan 31, 2008 10:18 PM, helihobby <[EMAIL PROTECTED]> wrote:
> I mean, I would like to be able to get the same exact location in the
> XML path every time I run my for loop and stop on some condition.
>
> For example some sort of function that returns:
>
>
> myXml.books[0].book.covers.cover[2].items[2].data123
>
> if data123 is the value in my For Loop that I break on ( match on ) on
> the XML in question.
>
> Hope this helps,
>
> Sean.
>
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Tracy
> Spratt" <[EMAIL PROTECTED]> wrote:
> >
> > What do you mean by "...save the absolute path..."?
> >
> >
> >
> > Save a reference?
> >
> >
> >
> > Save a string representation of the ancestor chain?
> >
> >
> >
> > What do you want to do?
> >
> >
> >
> > Tracy
> >
> >
> >
> > ________________________________
> >
> > From: [email protected] <flexcoders%40yahoogroups.com> [mailto:
> [email protected] <flexcoders%40yahoogroups.com>] On
> > Behalf Of helihobby
> > Sent: Thursday, January 31, 2008 6:42 PM
> > To: [email protected] <flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] How can I save XML path deep inside my XML data ?
> >
> >
> >
> > Hello,
> >
> > I have a very large XML.
> >
> > I have a function which reads the XML and finds something that I am
> > looking for ( lets say data123 )
> >
> > Once I find it I wish to save the absolute path to it ...
> > Is that possible ?
> >
> > For example:
> >
> > I wish to save:
> >
> > myXml.books[0].book.covers.cover[2].items[2].data123
> >
> > However I can not build the above statement since the XML is dynamic.
> > I wish for the function to return the absolute path of the item after
> > I find it ...
> >
> > Thanks in advance,
> >
> > Sean.
> >
>
>
>
--
Jhonny Everson