Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help with xml and schema

0 views
Skip to first unread message

akre...@hotmail.com

unread,
Feb 21, 2005, 4:34:41 PM2/21/05
to
This XML and Schema are for listing specific places in the world. Like
this...
<Earth><North_America><United_States><North_Carolina><Site_Name>

I am trying to import my old xml data into a new schema and need some
help with the schema.I almost have this working, but I need a little
help with some details.

Question: what do i need to include in the schema to check for
<Earth><North_America><United_States><North_Carolina><Site_Name>
or other possibilities like
<Earth><South_America><Brazil><Amazon_County???><Site_Name> along with
what the schema is already checking for.

I am a little new to the syntax and nesting heirarchy details of xml
schema.

Do these just need to be added as complex elements? if so how?

-------OR--------

I am opening to changing, but would prefer the previous structure.

Should I include <Earth><North_Carolina><United_States><North_Carolina>
as an element or attribute under the <Site_Name>. If I do this,
Site_Name would be the Root, which would be ok.

Any suggestions about the layout would also be appreciated, I dont want
to have to change schemata again in the future :-)
_________________________XML____________________________

<Earth>
<North_America>
<North_Carolina>
<Site_Name>
<ID/>
<Short_Name Long_Name=""/>
<Information>
<Main_Quote Quote_Source=""/>
<Info1 Info1_Source=""/>
<Info2 Info2_Source=""/>
<Info3 Info3_Source=""/>
</Information>
<Experience Rating=""/>
<Images>
<Map Map_Caption="" Map_Source=""/>
<Image1 Image1_Caption=""
Image1_Source="">1.tif</Image1>
<Image2 Image2_Caption=""
Image2_Source="">2.tif</Image2>
<Image3 Imag3_Caption=""
Image3_Source="">3.tif</Image3>
<Image4 Image4_Caption=""
Image4_Source="">4.tif</Image4>
<Image5 Image5_Caption=""
Image5_Source="">5.tif</Image5>
<Image6 Image6_Caption=""
Image6_Source="">6.tif</Image6>
<Image7 Image7_Caption=""
Image7_Source="">7.tif</Image7>
</Images>
<Details Type="" Hours="" Fees="" Elevation=""
Lattitude="" Longitude="">
<Accessibility/>
<Contact/>
<Directions/>
</Details>
</Site_Name>
</North_Carolina>
</North_America>
</Earth>

__________________________Schema________________________

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!-- definition of simple elements -->
<xs:element name="ID" type="xs:ID"/>
<!-- definition of attibutes-->
<xs:attribute name="Long_Name" type="xs:string"/>
<xs:attribute name="Quote_Source" type="xs:string"/>
<xs:attribute name="Info1_Source" type="xs:string"/>
<xs:attribute name="Info2_Source" type="xs:string"/>
<xs:attribute name="Info3_Source" type="xs:string"/>
<xs:attribute name="Rating" type="xs:string"/>
<xs:attribute name="Type" type="xs:string"/>
<xs:attribute name="Hours" type="xs:string"/>
<xs:attribute name="Fees" type="xs:string"/>
<xs:attribute name="Elevation" type="xs:string"/>
<xs:attribute name="Longitude" type="xs:string"/>
<xs:attribute name="Lattitude" type="xs:string"/>
<xs:attribute name="Directions" type="xs:string"/>
<xs:attribute name="Contact" type="xs:string"/>
<xs:attribute name="Accessability" type="xs:string"/>
<xs:attribute name="Map_Caption" type="xs:string"/>
<xs:attribute name="Map_Source" type="xs:string"/>
<xs:attribute name="Image1_Source" type="xs:string"/>
<xs:attribute name="Image2_Source" type="xs:string"/>
<xs:attribute name="Image3_Source" type="xs:string"/>
<xs:attribute name="Image4_Source" type="xs:string"/>
<xs:attribute name="Image5_Source" type="xs:string"/>
<xs:attribute name="Image6_Source" type="xs:string"/>
<xs:attribute name="Image7_Source" type="xs:string"/>
<xs:attribute name="Image1_Caption" type="xs:string"/>
<xs:attribute name="Image2_Caption" type="xs:string"/>
<xs:attribute name="Image3_Caption" type="xs:string"/>
<xs:attribute name="Image4_Caption" type="xs:string"/>
<xs:attribute name="Image5_Caption" type="xs:string"/>
<xs:attribute name="Image6_Caption" type="xs:string"/>
<xs:attribute name="Image7_Caption" type="xs:string"/>
<!-- definition of complex elements -->
<xs:complexType name="Short_Name">
<xs:attribute ref="Long_Name" use="optional"/>
</xs:complexType>
<xs:complexType name="Main_Quote">
<xs:attribute ref="Quote_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Info1">
<xs:attribute ref="Info1_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Info2">
<xs:attribute ref="Info2_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Info3">
<xs:attribute ref="Info3_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Experience">
<xs:attribute ref="Rating" use="optional"/>
</xs:complexType>
<xs:complexType name="Map">
<xs:attribute ref="Map_Caption" use="optional"/>
<xs:attribute ref="Map_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image1">
<xs:attribute ref="Image1_Caption" use="optional"/>
<xs:attribute ref="Image1_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image2">
<xs:attribute ref="Image2_Caption" use="optional"/>
<xs:attribute ref="Image2_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image3">
<xs:attribute ref="Image3_Caption" use="optional"/>
<xs:attribute ref="Image3_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image4">
<xs:attribute ref="Image4_Caption" use="optional"/>
<xs:attribute ref="Image4_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image5">
<xs:attribute ref="Image5_Caption" use="optional"/>
<xs:attribute ref="Image5_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image6">
<xs:attribute ref="Image6_Caption" use="optional"/>
<xs:attribute ref="Image6_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Image7">
<xs:attribute ref="Image7_Caption" use="optional"/>
<xs:attribute ref="Image7_Source" use="optional"/>
</xs:complexType>
<xs:complexType name="Details">
<xs:attribute ref="Type" use="optional"/>
<xs:attribute ref="Hours" use="optional"/>
<xs:attribute ref="Fees" use="optional"/>
<xs:attribute ref="Elevation" use="optional"/>
<xs:attribute ref="Longitude" use="optional"/>
<xs:attribute ref="Lattitude" use="optional"/>
<xs:attribute ref="Directions" use="optional"/>
<xs:attribute ref="Contact" use="optional"/>
<xs:attribute ref="Accessability" use="optional"/>
</xs:complexType>
</xs:schema>

0 new messages