Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   new to xml schemas (http://www.velocityreviews.com/forums/t564978-new-to-xml-schemas.html)

tshad 12-31-2007 09:34 AM

new to xml schemas
 
I am trying to read an xml document into a dataSet and am unsure how to set
it up.

If I have a document such as:

<?xml version="1.0"?>
<address country="Italy">
<tag name="street" flag="5">One Microsoft Way</tag>
<tag name="number">1</tag>
<tag name="city">Redmond</tag>
<tag name="state" unit="25">WA</tag>
<tag name="zip">98052</tag>
</address>

I want there to be one table: Address and each record would be the "tag"
lines. The line would have a name (such as "street" or "city") a value
(such as ""One Microsoft Way") and a possible attribute or 2 (such as flag).

I would want the table to be something like:

street 5 One Microsoft Way
number 1
city Redmond
state 25 WA
zip 98052

There is more to this but this would be the first cut.

I tried:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="address" type="AddressType" />
<xs:complexType name="AddressType">
<xs:sequence>
<xs:element name="tag" minOccurs="0" maxOccurs="unbounded"
type="xs:string" />
</xs:sequence>
<xs:attribute name="country" type="xs:string" />
</xs:complexType>
</xs:schema>

I didn't expect this to work and it didn't. What I got was:

Italy 0

How would I change this to make this work?

Thanks,

Tom




All times are GMT. The time now is 05:24 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.