XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 5th, 2002, 06:18 PM
getchoo getchoo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 20 getchoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
multiple attributes in a simple type within agroup

Hi I'm having problems validating my schema and xsd files I think there maybe a problem placing multiple attributes in a simple type within a group below is my code

xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--definition of an element group -->
<xsd:group name="computerFeatures">
<xsd:sequence>
<!--definition of simple type elements -->
<xsd:element name="cpu" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="memory" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="hd" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="drive" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="video" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="modem" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:group>

<xsd:group name="computerOptions">
<xsd:sequence>
<!--definition of simple type elements -->
<xsd:element name="airport" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:attribute ref="picture">
<xsd:attribute ref="price">
</xsd:element>

<xsd:element name="ipod" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:complexType>
<xsd:attribute ref="picture">
<xsd:attribute ref="price">
</xsd:complexType>
</xsd:element>

<xsd:element name="app" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:complexType>
<xsd:attribute ref="picture">
<xsd:attribute ref="price">
</xsd:complexType>
</xsd:element>

</xsd:sequence>
</xsd:group>

<!--definition of attributes-->
<xsd:attribute name="storeName" type="xsd:string"/>
<xsd:attribute name="picture" type="xsd:string"/>
<xsd:attribute name="price" type="xsd:float"/>
<xsd:attribute name="tax" type="xsd:float"/>
<xsd:attribute name="shipping" type="xsd:float"/>

<!--definition of complex type elements -->
<xsd:element name="model">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="computerFeatures" minOccurs="1" maxOccurs="1"/>
<xsd:group ref="computerOptions" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="picture" type="xsd:string"/>
<xsd:attribute name="price" type="xsd:float"/>
<xsd:attribute name="tax" type="xsd:float"/>
<xsd:attribute name="shipping" type="xsd:float"/>
</xsd:complexType>
</xsd:element>

<xsd:element name="computerStore">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="model" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="storeName" type="xsd:string"/>
<xsd:attribute ref="picture"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>

xml file:

<?xml version="1.0" encoding="UTF-8"?>

<computerStore storeName="Mac Store">
<model picture="imac.jpg" price="799" tax="0.14" shipping="20" >
<cpu>600MHz PowerPC G3</cpu>
<memory>128MB SDRAM</memory>
<hd>40GB Ultra ATA drive</hd>
<drive>CD-ROM</drive>
<video>Rage 128 Ultra graphics</video>
<modem>56K internal modem</modem>
<options>
<airport picture="airport.gif">AirPort</airport>
<ipod picture="ipod.gif">iPod</ipod>
<app picture="app.gif">Apple Protection Plan</app>
</options>
</model>
</computerStore>

I been validating the two files at http://www.xmlforasp.net/content.as...SchemaValidator

Can anyone tell me whats wrong with my xsd

Thanx
getchoo

Reply With Quote
  #2  
Old August 11th, 2002, 07:27 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Double check your closing tags. You've got some <xsd:element> tags that close with />, that later have a closing tag </...>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > multiple attributes in a simple type within agroup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway