By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

Id over multiple nodes

P: n/a
Is it possible to create an id over multiple nodes? I would like to
use generate-id which includes all of the Route nodes which has
a direction of 1.

So I don't want to for-each each Route node and run generate-id
on each on of them but bulk them all together and generate an id
for the nodes

<Routes>
<Route>
<City1>A</City1>
<City2>B</City2>
<DateTime1>10:00</DateTime1>
<DateTime2>11:15</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>2</Direction>
</Route>
</Routez>

I tired generate-id(Route[Direction=1]) but it stills only takes the
first Route element it encounters and I can't generate the id based
on the Routes node since it can contain both Route nodes which
contain Direction 1 and elements which cntain Direction 2.'

So what I want from the XML above is an ID which spans these
nodes at the same time

<Route>
<City1>A</City1>
<City2>B</City2>
<DateTime1>10:00</DateTime1>
<DateTime2>11:15</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>1</Direction>
</Route>

(This is me trying to break my problem into sub-problems =)

//Andreas
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


Andreas Håkansson wrote:
Is it possible to create an id over multiple nodes? I would like to
use generate-id which includes all of the Route nodes which has
a direction of 1.


An id unique indentifies a node in an XML document, there is no id for
several nodes nor is there an id restricted to indentify a node in some
subset of the document.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

P: n/a
Martin,

Thank you for your reply. Perhaps you have thought you could
contribute to my earlier post with the subject

"Grouping over multiple nodes - possible?"

Thanks,

Andreas

"Martin Honnen" <ma*******@yahoo.de> skrev i meddelandet
news:O5**************@TK2MSFTNGP09.phx.gbl...


Andreas Håkansson wrote:
Is it possible to create an id over multiple nodes? I would like to
use generate-id which includes all of the Route nodes which has
a direction of 1.


An id unique indentifies a node in an XML document, there is no id for
several nodes nor is there an id restricted to indentify a node in some
subset of the document.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3

P: n/a

Is it possible to create an id over multiple nodes? I would like to
use generate-id which includes all of the Route nodes which has
a direction of 1.

So I don't want to for-each each Route node and run generate-id
on each on of them but bulk them all together and generate an id
for the nodes

<Routes>
<Route>
<City1>A</City1>
<City2>B</City2>
<DateTime1>10:00</DateTime1>
<DateTime2>11:15</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>2</Direction>
</Route>
</Routez>

I tired generate-id(Route[Direction=1]) but it stills only takes the
first Route element it encounters and I can't generate the id based
on the Routes node since it can contain both Route nodes which
contain Direction 1 and elements which cntain Direction 2.'

So what I want from the XML above is an ID which spans these
nodes at the same time

<Route>
<City1>A</City1>
<City2>B</City2>
<DateTime1>10:00</DateTime1>
<DateTime2>11:15</DateTime2>
<Direction>1</Direction>
</Route>
<Route>
<City1>B</City1>
<City2>C</City2>
<DateTime1>12:00</DateTime1>
<DateTime2>14:00</DateTime2>
<Direction>1</Direction>
</Route>

(This is me trying to break my problem into sub-problems =)

//Andreas


User submitted from AEWNET (http://www.aewnet.com/)
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.