Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

How to design two root elements with same name

$
0
0

File1:TRAData.xml

<GeneralTrainTimeTableList>
   <TrainTimeTables>
   <TrainTimeTable>
   <TrainInfo>
<TrainNo>51</TrainNo>
<RouteID>WL-M</RouteID>
<Direction>1</Direction>
<TripHeadSign>ToKaihsiung</TripHeadSign>
<OverNightStationID>1001</OverNightStationID>
<TripLine>1</TripLine>
<WheelChairFlag>0</WheelChairFlag>
<PackageServiceFlag>0</PackageServiceFlag>
<DiningFlag>0</DiningFlag>
<BreastFeedFlag>0 </BreastFeedFlag>
<BikeFlag>0</BikeFlag>
        <DailyFlag>1</DailyFlag>
        <ExtraTrainFlag>0</ExtraTrainFlag>
        <Note>每日行駛。莒光號自由行,不發售團體票及無座票。另不提供TR-PASS學生版搭乘。</Note>
      </TrainInfo>
   </TrainTimeTable>
   </TrainTimeTables>
</GeneralTrainTimeTableList>



File2:THSRData.xml

<GeneralTrainTimeTableList>
   <TrainTimetables>
   <TrainTimeTable>
      <TrainInfo> 
         <TrainNo>583</TrainNo>
         <RouteID>HSRL</RouteID>
         <Direction>0</Direction>
         <TripHeadSign>往左營<TripHeadSign>
       </TrainInfo>
   </TrainTimeTable>
   </TrainTimetables>
</GeneralTrainTimeTableList>


File: TRA.xsd

<xs:element name="GeneralTrainTimeTableList" type="TRAGeneralTrainTimeTableListType">
</xs:element>


File: THSR.xsd

<xs:element name="GeneralTrainTimeTableList" type="THSRGeneralTrainTimeTableListType">
</xs:element>


The problem is both of TRA.xsd and THSR.xsd include the same xsd (Rail.xsd),so the result comes out "GeneralTrainTimeTableList" is already declared in the TRA.xsd, "GeneralTrainTimeTableList" can't  declared again in the THSR.xsd .


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>