Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   new to xml schemas (

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>

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="">
<xs:element name="address" type="AddressType" />
<xs:complexType name="AddressType">
<xs:element name="tag" minOccurs="0" maxOccurs="unbounded"
type="xs:string" />
<xs:attribute name="country" type="xs:string" />

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?



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.