OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XPath: how to select based on element type?



Hi,

I am fairly new to XPath and XML schema.
I have a couple of newbie questions:

(1) Is there a way a in XPath to select nodes based on their element type?

(2) My second question is on the proper use of XML schema:

Say, we are modeling a line segment in geometry.
To give an example, should it look like

(a)

  <Line>
    <Point>
     <Number>0</Number>
     <Number>0</Number>
    </Point>
    <Point>
     <Number>3</Number>
     <Number>3</Number>
    </Point>
  </Line>

or

(b)

  <Line>
    <a>
      <x>0</x>
      <y>0</y>
    </a>
    <b>
      <x>0</x>
      <y>0</y>
    </b>
  </Line>

with a and b being of type Point (specified in a scheme definition) and
x and y of some appropriate simple type.

If we are following an approach as that in (b), how do we represent
sequences of arbitrary length -- e.g., a polyline figure.

If one is following an approach as that in (a), how are scheme types
helpful? Should one have elements corresponding to each schema type?

Regards
Sankar

-- 
Sankaranarayanan K. V.          | sankar@migv.mot.com
Motorola India Electronics Ltd  | http://www.mot.com/miel