469,591 Members | 1,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

xpath to determine program flow -- how to get there from here?

Hi, sorry if this is the wrong group...but I don't see an xpath group
and hoping someone here can help me.

How do you assign variable to different elements within a single node

I have a simple xml structure that I'm using to determine a workflow
process. I've read all the xpath documentation, but can't quite get my
brain around the precise methods I need. When a user enters a serial
number (sn), I need to find the last board with that serial number
that ALSO has a finish attribute (this one I can do). Then I need to
get the NEXT <instruction> element that does NOT have a <board>
element for that serial number attribute, so I know which @doc (xml
file) to serve up to the user. I hope this is clear enough.

<Station name="Station1">
<Instruction order="1" doc="test1.xml">
<Board sn="12345" start="07/15/03" finish="07/15/03"/>
<Board sn="12346" start="07/15/03" finish="07/16/03"/>

<Station name=Station2">
<Instruction order="1" doc="test2.xml">
<Board sn="12345" start="07/15/03" finish="07/15/03"/>
<Board sn="12346" start="07/15/03"/>
<Instruction order="2" doc="test3.xml">
<Board sn="12345" start="07/15/03" finish="07/15/03"/>

So if the user enters sn="12346" I need to determine that they never
finished Station2, Instruction order="1" and serve up doc="test2.xml".

I can figure out most of the xpath stuff, but not sure how to assign
variables to the results. For example:

xNode1 = Select(//Board[@sn="12346" and @finish != "")
I need to set variables for that node's Station and Instruction
strStation = the <station> for that <board> element.
strInstruction = the <instruction> for that <board> element.

Then need to find the next Station and/or Instruction for that <board

Any pointers would be great!

Thanks, Kathy
Nov 17 '05 #1
0 1044

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ot | last post: by
2 posts views Thread by Locusta | last post: by
9 posts views Thread by David Thielen | last post: by
2 posts views Thread by bignass04 | last post: by
1 post views Thread by Arndt Jonasson | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.