Use:
preceding::a[1]/@some_attr
Cheers,
Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,
http://fxsl.sourceforge.net/ -- the home of FXSL
Resume:
http://fxsl.sf.net/DNovatchev/Resume/Res.html
"GIMME" <gi*******************@yahoo.com> wrote in message
news:3f**************************@posting.google.c om...
hah. hah. hah ...
<root>
<a some_attr="AAA"/>
<b><c/></b>
<b><c/></b>
<b><c/></b>
<b><c><d/></c></b>
</root>
"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message
news:<c5*************@ID-152440.news.uni-berlin.de>...
Sorry, it's still not a well-formed xml document.
"GIMME" <gi*******************@yahoo.com> wrote in message
news:3f**************************@posting.google.c om... This xml should be better ...
<root>
<a some_attr="AAA"/>
<b><c/></b>
<b><c/></b>
<b><c/></b>
<b><c><d/></c><b/>
<root>
Is there a way to reference some_attr when processing both c and d
where the expression is the same for both?
"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message
news:<c5*************@ID-152440.news.uni-berlin.de>... > "GIMME" <gi*******************@yahoo.com> wrote in message
> news:3f**************************@posting.google.c om...
> > If I have
> >
> > <root>
> > <a some_attr="AAA"/>
> > <b><c/></b>
> > <b><c/></b>
> > <b><c/></b>
> > <b><c><d/></c><b>
> > <root>
> >
> > What expression will fetch the value of AAA when processing
> > elements c ?
> >
> > Is there an expression that works for both elements c and d ?
>
> Not in your case -- you must first have a well-formed xml document.