Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > WXS: Empty element with attributes

Reply
Thread Tools

WXS: Empty element with attributes

 
 
Gustaf Liljegren
Guest
Posts: n/a
 
      08-21-2003
I ran into this example in the XML Schema Primer:

<internationalPrice currency="EUR" value="423.46"/>

The element is defined like this:

<xsd:element name="internationalPrice">
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="currency" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:decimal"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>

It looks complex indeed. I wonder what the difference is between the
above and this:

<xsd:element name="internationalPrice">
<xsd:complexType>
<xsd:attribute name="currency" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:decimal"/>
</xsd:complexType>
</xsd:element>

Both works on the XML snippet, according to those WXS validators I've
tried.

Thanks,

Gustaf
 
Reply With Quote
 
 
 
 
Gustaf Liljegren
Guest
Posts: n/a
 
      08-21-2003
Gustaf Liljegren <(E-Mail Removed)> wrote:

> It looks complex indeed. I wonder what the difference is between the
> above and this:


Forget the question. It's explained in the next paragraph in the primer!
Both are correct. I wish there was only one way to do it...

Gustaf
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xtml: combining attributes from one element into a different element Mike N. XML 3 03-17-2008 01:30 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
Query : Number of Attributes under an element & atleast 1 occurence of element/Attribute kosaraju.puneeth@gmail.com XML 0 10-26-2005 07:09 AM
how to validate a non empty element with only attributes edkawas XML 0 06-24-2005 09:36 PM
empty/non-empty element John XML 1 07-16-2003 10:23 AM



Advertisments