xsl-list
[Top] [All Lists]

[xsl] How to test with XPath the existence of a certain branch of a <choice> statement?

2010-02-03 13:51:56
For an XSLT script I need to check wether one certain branch of a <choice> 
statement is present.
The critical part of the XML statement look like as follows (<choice> and 
<sequence> are taken/inserted from the 
underlying XSD schema file):

<parent>
  <choice>
     <sequence>
        <aaa>...</aaa>
        <bbb>...</bbb>
    </sequence>
      <sequence>
        <aaa>...</aaa>
        <ccc>...</ccc>
    </sequence>
     <sequence>
        .....
    </sequence>
  </choice>
</parent>

As you can see a XML doc can contain one of the three sequence branches.

How do I check with XPath if the first branch is currently filled in an XML doc?

If I code e.g.

  test=.../parent/aaa

then it is not clear if the first or second branch is present.

Can anyone give me a hint?

Thank you
Ben






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>