469,361 Members | 2,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

XPATH and concat question

We have an xml viz.
<element>
<component>....</component>
<event>....</event>
<event>....</event>
<event>....</event>
<event>....</event>
</element>

The number of events will be dynamic.
For a relevant component,we need to return the cooresponding events pipe-delimited.
We arrive at the particular component through SelectNodes - is there a smart,concise XPATH expression which can allow me to return the set of events in the way we want,rather than recursing through the set.
Note that component and event nodes are parent(ed) by 'element'.
We are using javascript.
Mar 11 '07 #1
2 1872
dorinbogdan
839 Expert 512MB
You do must loop through the selected nodes when use an XML DOM node list.
In Javascript just an Array object has the "join" method that concatenates the array elements (separated by pipe, or any char), but an XML node list object has not a such method.

Eventually, you can use an XSL with "for-each" command.
If not know how, see this simple tutorial.
Mar 12 '07 #2
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Mar 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Anna | last post: by
5 posts views Thread by Tom Alsberg | last post: by
7 posts views Thread by Ot | last post: by
1 post views Thread by DN | last post: by
3 posts views Thread by Bob | last post: by
1 post views Thread by DN | last post: by
3 posts views Thread by Bloody Viking | last post: by
1 post views Thread by webjay | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.