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

Discussion in 'ASP .Net' started by KathyB, Jul 20, 2003.

  1. KathyB

    KathyB Guest

    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
    set?

    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.

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

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

    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
    elements.
    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
    @sn>???

    Any pointers would be great!

    Thanks, Kathy
     
    KathyB, Jul 20, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. goog
    Replies:
    0
    Views:
    512
  2. Steve Jorgensen
    Replies:
    2
    Views:
    742
    Steve Jorgensen
    Aug 14, 2005
  3. utab
    Replies:
    18
    Views:
    1,664
    Diego Martins
    Apr 27, 2006
  4. Jack Dowson
    Replies:
    0
    Views:
    459
    Jack Dowson
    May 7, 2007
  5. Peña, Botp
    Replies:
    1
    Views:
    242
    Robert Klemme
    Jan 24, 2004
Loading...

Share This Page