Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why am I getting an attribute error?

Status
Not open for further replies.

msummons76

Technical User
Aug 26, 2011
1
US
Hello All,

I'm fairly new to XML and trying to create a schema to set up the format of a table. The reference to the schema seems to work (which was a challenge in itself), but the schema itself gets errors when trying to open the XML file (using MS EXCEL). I have been able to resolve the errors as I see them but am getting an error in regards to the attributes. For some reason they are not being picked up in the XSD code and can not figure it out. I believe it may be a case of certain lines not being where they should but coming to you all as a second pair of eyes to see if my coding is correct. Schema code is below:

<?xml version="1.0" encoding="utf-8"?>
<schema xmlns=" <element name="table"/>
<complexType>
<sequence>
<element name="song"/>
</sequence>
</complexType>
<complexType name="songType">
<sequence>
<element name="artist"/>
<element name="length" type="dateTime"/>
<element name="year" type="integer"/>
<element name="album" type="string"/>
</sequence>
<attribute name="name" type="string"/>
</complexType>
</element>
</schema>

Any help would be greatly appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top