[Home] [By Thread] [By Date] [Recent Entries]

  • From: Sankaranarayanan K V <sankar@m...>
  • To: xml-dev@l...
  • Date: Mon, 08 Jan 2001 15:24:38 +0530

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@m...
Motorola India Electronics Ltd  | http://www.mot.com/miel

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member