DOM

Hi,
    I have XML schema and a made xml file from that.
===============================================================
<xs:element name="DateInterval" minOccurs="0">
    <xs:complexType>
            <xs:sequence>
            <xs:element name="start"  ref="com.foundation.Date" />
            <xs:element name="limit"  ref="com.foundation.Date" />
         </xs:sequence>
    </xs:complexType>
</xs:element>
<xs:element name="com.foundation.DateInterval" minOccurs="0">
    <xs:complexType>
            <xs:sequence>
            <xs:element name="startYear" type="xs:int"/>
            <xs:element name="startMonth" type="xs:int"/>
            <xs:element name="startDay" type="xs:int"/>
            <xs:element name="limitYear" type="xs:int"/>
            <xs:element name="limitMonth" type="xs:int"/>
            <xs:element name="limitDay" type="xs:int"/>
         </xs:sequence>
    </xs:complexType>
</xs:element>
<xs:element name="com.foundation.Date" minOccurs="0">
    <xs:complexType>
            <xs:sequence>
            <xs:element name="year" type="xs:int"/>
            <xs:element name="month" type="xs:int"/>
            <xs:element name="day" type="xs:int"/>
         </xs:sequence>
    </xs:complexType>
</xs:element>
=========================================================
and have .xml file like this
===========================================================
<DateInterval xmlns="">
      <start> <com.foundation.Date><year>1999</year> <month>2</month>
<day>23</day></com.foundation.Date>
      </start>
      <limit><com.foundation.Date><year>2004</year> <month>5</month>
<day>13</day></com.foundation.Date>
	</limit>
   </DateInterval>
   <com.foundation.DateInterval xmlns="">
      <startYear>2</startYear>
      <startMonth>2</startMonth>
      <startDay>2</startDay>
      <limitYear>2</limitYear>
      <limitMonth>2</limitMonth>
      <limitDay>2</limitDay>
   </com.foundation.DateInterval>
   <com.foundation.DateInterval xmlns="">
      <startYear>5</startYear>
      <startMonth>5</startMonth>
      <startDay>5</startDay>
      <limitYear>5</limitYear>
      <limitMonth>5</limitMonth>
      <limitDay>5</limitDay>
   </com..foundation.DateInterval>
===================================================================
I have few questions! I am new to schemas and DOM!
a)I can read 2,2,2,2,2 and 5,5,5,5,5 But I can't distinguish which one is
which . Is there any way to name the instances like we name different
instances of class.
b).I am not able to read first DateInterval through DOM. How can I do this?

Any refrerences or help is appreciated!!!
Thanks in advance
Bhaskar

Received on Monday, 1 July 2002 09:36:57 UTC