EDN Admin
Well-known member
Im trying to create a class from the two xsds (google product feed) and getting the following error:
<br/>
Error: Error generating classes for schema product_reviews_v1.
- The element http://schemas.google.com/schemas/pr/1.0:role is missing.
<br/>
The command I am using is:
xsd.exe /c /n:GooglePRoductReview product_reviews_v1.xsd
<br/>
And below is main schema (product_reviews_v1.xsd)
========================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified
<span style="white-spacere <xs:import namespace="http://schemas.google.com/schemas/pr/1.0" schemaLocation="prs_v1.xsd"/>
<span style="white-spacere <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
<span style="white-spacere <xs:element name="feed
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="author" type="authorType"/>
<span style="white-spacere <xs:element name="title" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element name="subtitle" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="published"/>
<span style="white-spacere <xs:element ref="rights" minOccurs="0"/>
<span style="white-spacere <xs:element ref="id"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="logo" type="xs:anyURI"/>
<span style="white-spacere <xs:element name="entry" minOccurs="0" maxOccurs="unbounded
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element ref="id"/>
<span style="white-spacere <xs:element ref="published"/>
<span style="white-spacere <xs:element name="title" type="titleType"/>
<span style="white-spacere <xs:element ref="pr:content_format"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="author" type="authorType" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="content" type="contentType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="video" type="videoType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prroducts" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prros" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:cons" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prverview" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:awards" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:custom" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="pr:ratings" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:related_products" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="deleted_entry" minOccurs="0" maxOccurs="unbounded
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element ref="id" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere </xs:sequence>
<span style="white-spacere <xs:attribute ref="xml:lang" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="id" type="xs:string"/>
<span style="white-spacere <xs:element name="published" type="xs:dateTime"/>
<span style="white-spacere <xs:element name="rights" type="xs:string"/>
<span style="white-spacere <xs:element name="link" type="linkType"/>
<span style="white-spacere <xs:complexType name="authorType
<span style="white-spacere <xs:all>
<span style="white-spacere <xs:element name="name" type="xs:string"/>
<span style="white-spacere <xs:element name="email" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:role" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:number_of_reviews" minOccurs="0"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:author_rating" minOccurs="0"/>
<span style="white-spacere </xs:all>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="videoType
<span style="white-spacere <xs:all>
<span style="white-spacere <xs:element ref="published" minOccurs="0"/>
<span style="white-spacere <xs:element name="title" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="summary" type="xs:string" minOccurs="0"/>
<span style="white-spacere </xs:all>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="contentType" mixed="true
<span style="white-spacere <xs:attribute name="full_length" type="xs:nonNegativeInteger" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="linkType
<span style="white-spacere <xs:attribute name="href" type="xs:anyURI" use="required"/>
<span style="white-spacere <xs:attribute name="rel" type="xs:NCName" use="required"/>
<span style="white-spacere <xs:attribute name="type"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="titleType" mixed="true
<span style="white-spacere <xs:attribute name="type" type="xs:NCName" use="required"/>
<span style="white-spacere </xs:complexType>
</xs:schema>
<br/>
And below is the nested schema (prs_v1.xsd)
=======================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.google.com/schemas/pr/1.0" xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified
<span style="white-spacere <xs:import schemaLocation="product_reviews_v1.xsd"/>
<span style="white-spacere <xs:element name="content_format
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:attribute name="type" type="pr:contentFormatType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="custom
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="custom_title" type="xs:string"/>
<span style="white-spacere <xs:element name="custom_description" type="xs:string"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="role" type="xs:string"/>
<span style="white-spacere <xs:element name="number_of_reviews" type="xs:integer"/>
<span style="white-spacere <xs:element name="average_rating" type="pr:ratingType"/>
<span style="white-spacere <xs:element name="author_rating" type="pr:ratingType"/>
<span style="white-spacere <xs:complexType name="ratingType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="attr" type="pr:attrType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:element name="pros" type="xs:string"/>
<span style="white-spacere <xs:element name="cons" type="xs:string"/>
<span style="white-spacere <xs:element name="overview" type="xs:string"/>
<span style="white-spacere <xs:element name="ratings" type="pr:ratingType"/>
<span style="white-spacere <xs:element name="awards
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="award" type="pr:awardType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:complexType name="awardType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="award_name" type="xs:string"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="attrType
<span style="white-spacere <xs:attribute name="name" type="xs:string" use="required"/>
<span style="white-spacere <xs:attribute name="max" type="xs:integer" use="optional"/>
<span style="white-spacere <xs:attribute name="min" type="xs:integer" use="optional"/>
<span style="white-spacere <xs:attribute name="value" type="xs:float" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:element name="products
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product" type="prroductType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="related_products
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="related_product" type="pr:relatedProductType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:complexType name="productType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product_id" type="prroductIDType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="brand" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element name="product_name" type="xs:string"/>
<span style="white-spacere <xs:element name="product_category" type="prroductCategoryType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="number_of_reviews" type="xs:integer" minOccurs="0"/>
<span style="white-spacere <xs:element name="average_rating" type="pr:ratingType" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="relatedProductType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product_id" type="prroductIDType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="brand" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element name="product_name" type="xs:string"/>
<span style="white-spacere <xs:element name="product_category" type="prroductCategoryType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere <xs:attribute name="relate" type="pr:relatedProductRelationType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="productIDType" mixed="true
<span style="white-spacere <xs:attribute name="contenttype" type="prroductIDTypeType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="productCategoryType" mixed="true
<span style="white-spacere <xs:attribute name="level" type="xs:integer" use="required"/>
<span style="white-spacere <xs:attribute name="category_id" type="xs:integer" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:simpleType name="contentFormatType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="buying_guide"/>
<span style="white-spacere <xs:enumeration value="editorial_review"/>
<span style="white-spacere <xs:enumeration value="user_review"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
<span style="white-spacere <xs:simpleType name="productIDTypeType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="EAN"/>
<span style="white-spacere <xs:enumeration value="ISBN"/>
<span style="white-spacere <xs:enumeration value="MPN"/>
<span style="white-spacere <xs:enumeration value="UPC"/>
<span style="white-spacere <xs:enumeration value="base_docid"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
<span style="white-spacere <xs:simpleType name="relatedProductRelationType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="complementary"/>
<span style="white-spacere <xs:enumeration value="substitute"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
</xs:schema>
<br/>
<br/>
Please note:
====================
both these schemas were extracted from the below sample xml doc
============================================
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:atom="http://www.w3.org/2005/Atom" xml:lang="en-US" xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://google.com/products/product_reviews_v1.xsd
<span style="white-spacere <author>
<span style="white-spacere <name>Review Source</name>
<span style="white-spacere <email>contact@example.com</email>
<span style="white-spacere </author>
....rest of xml fragment
<br/>
My plan was to use xsd tool to create an object in which to load the xml and validate it. If I cant get the object created Im in for a lot of typing/xslt transformation.
<br/>
Thanks for your help
View the full article
<br/>
Error: Error generating classes for schema product_reviews_v1.
- The element http://schemas.google.com/schemas/pr/1.0:role is missing.
<br/>
The command I am using is:
xsd.exe /c /n:GooglePRoductReview product_reviews_v1.xsd
<br/>
And below is main schema (product_reviews_v1.xsd)
========================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified
<span style="white-spacere <xs:import namespace="http://schemas.google.com/schemas/pr/1.0" schemaLocation="prs_v1.xsd"/>
<span style="white-spacere <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
<span style="white-spacere <xs:element name="feed
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="author" type="authorType"/>
<span style="white-spacere <xs:element name="title" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element name="subtitle" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="published"/>
<span style="white-spacere <xs:element ref="rights" minOccurs="0"/>
<span style="white-spacere <xs:element ref="id"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="logo" type="xs:anyURI"/>
<span style="white-spacere <xs:element name="entry" minOccurs="0" maxOccurs="unbounded
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element ref="id"/>
<span style="white-spacere <xs:element ref="published"/>
<span style="white-spacere <xs:element name="title" type="titleType"/>
<span style="white-spacere <xs:element ref="pr:content_format"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="author" type="authorType" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="content" type="contentType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="video" type="videoType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prroducts" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prros" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:cons" minOccurs="0"/>
<span style="white-spacere <xs:element ref="prverview" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:awards" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:custom" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="pr:ratings" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:related_products" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="deleted_entry" minOccurs="0" maxOccurs="unbounded
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element ref="id" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere </xs:sequence>
<span style="white-spacere <xs:attribute ref="xml:lang" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="id" type="xs:string"/>
<span style="white-spacere <xs:element name="published" type="xs:dateTime"/>
<span style="white-spacere <xs:element name="rights" type="xs:string"/>
<span style="white-spacere <xs:element name="link" type="linkType"/>
<span style="white-spacere <xs:complexType name="authorType
<span style="white-spacere <xs:all>
<span style="white-spacere <xs:element name="name" type="xs:string"/>
<span style="white-spacere <xs:element name="email" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:role" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:number_of_reviews" minOccurs="0"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0"/>
<span style="white-spacere <xs:element ref="pr:author_rating" minOccurs="0"/>
<span style="white-spacere </xs:all>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="videoType
<span style="white-spacere <xs:all>
<span style="white-spacere <xs:element ref="published" minOccurs="0"/>
<span style="white-spacere <xs:element name="title" type="titleType" minOccurs="0"/>
<span style="white-spacere <xs:element ref="link"/>
<span style="white-spacere <xs:element name="summary" type="xs:string" minOccurs="0"/>
<span style="white-spacere </xs:all>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="contentType" mixed="true
<span style="white-spacere <xs:attribute name="full_length" type="xs:nonNegativeInteger" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="linkType
<span style="white-spacere <xs:attribute name="href" type="xs:anyURI" use="required"/>
<span style="white-spacere <xs:attribute name="rel" type="xs:NCName" use="required"/>
<span style="white-spacere <xs:attribute name="type"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="titleType" mixed="true
<span style="white-spacere <xs:attribute name="type" type="xs:NCName" use="required"/>
<span style="white-spacere </xs:complexType>
</xs:schema>
<br/>
And below is the nested schema (prs_v1.xsd)
=======================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.google.com/schemas/pr/1.0" xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified
<span style="white-spacere <xs:import schemaLocation="product_reviews_v1.xsd"/>
<span style="white-spacere <xs:element name="content_format
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:attribute name="type" type="pr:contentFormatType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="custom
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="custom_title" type="xs:string"/>
<span style="white-spacere <xs:element name="custom_description" type="xs:string"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="role" type="xs:string"/>
<span style="white-spacere <xs:element name="number_of_reviews" type="xs:integer"/>
<span style="white-spacere <xs:element name="average_rating" type="pr:ratingType"/>
<span style="white-spacere <xs:element name="author_rating" type="pr:ratingType"/>
<span style="white-spacere <xs:complexType name="ratingType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="attr" type="pr:attrType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:element name="pros" type="xs:string"/>
<span style="white-spacere <xs:element name="cons" type="xs:string"/>
<span style="white-spacere <xs:element name="overview" type="xs:string"/>
<span style="white-spacere <xs:element name="ratings" type="pr:ratingType"/>
<span style="white-spacere <xs:element name="awards
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="award" type="pr:awardType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:complexType name="awardType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="award_name" type="xs:string"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="attrType
<span style="white-spacere <xs:attribute name="name" type="xs:string" use="required"/>
<span style="white-spacere <xs:attribute name="max" type="xs:integer" use="optional"/>
<span style="white-spacere <xs:attribute name="min" type="xs:integer" use="optional"/>
<span style="white-spacere <xs:attribute name="value" type="xs:float" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:element name="products
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product" type="prroductType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:element name="related_products
<span style="white-spacere <xs:complexType>
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="related_product" type="pr:relatedProductType" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere </xs:element>
<span style="white-spacere <xs:complexType name="productType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product_id" type="prroductIDType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="brand" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element name="product_name" type="xs:string"/>
<span style="white-spacere <xs:element name="product_category" type="prroductCategoryType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="number_of_reviews" type="xs:integer" minOccurs="0"/>
<span style="white-spacere <xs:element name="average_rating" type="pr:ratingType" minOccurs="0"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="relatedProductType
<span style="white-spacere <xs:sequence>
<span style="white-spacere <xs:element name="product_id" type="prroductIDType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element name="brand" type="xs:string" minOccurs="0"/>
<span style="white-spacere <xs:element name="product_name" type="xs:string"/>
<span style="white-spacere <xs:element name="product_category" type="prroductCategoryType" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere <xs:element ref="link" minOccurs="0" maxOccurs="unbounded"/>
<span style="white-spacere </xs:sequence>
<span style="white-spacere <xs:attribute name="relate" type="pr:relatedProductRelationType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="productIDType" mixed="true
<span style="white-spacere <xs:attribute name="contenttype" type="prroductIDTypeType" use="required"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:complexType name="productCategoryType" mixed="true
<span style="white-spacere <xs:attribute name="level" type="xs:integer" use="required"/>
<span style="white-spacere <xs:attribute name="category_id" type="xs:integer" use="optional"/>
<span style="white-spacere </xs:complexType>
<span style="white-spacere <xs:simpleType name="contentFormatType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="buying_guide"/>
<span style="white-spacere <xs:enumeration value="editorial_review"/>
<span style="white-spacere <xs:enumeration value="user_review"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
<span style="white-spacere <xs:simpleType name="productIDTypeType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="EAN"/>
<span style="white-spacere <xs:enumeration value="ISBN"/>
<span style="white-spacere <xs:enumeration value="MPN"/>
<span style="white-spacere <xs:enumeration value="UPC"/>
<span style="white-spacere <xs:enumeration value="base_docid"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
<span style="white-spacere <xs:simpleType name="relatedProductRelationType
<span style="white-spacere <xs:restriction base="xs:string
<span style="white-spacere <xs:enumeration value="complementary"/>
<span style="white-spacere <xs:enumeration value="substitute"/>
<span style="white-spacere </xs:restriction>
<span style="white-spacere </xs:simpleType>
</xs:schema>
<br/>
<br/>
Please note:
====================
both these schemas were extracted from the below sample xml doc
============================================
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:atom="http://www.w3.org/2005/Atom" xml:lang="en-US" xmlnsr="http://schemas.google.com/schemas/pr/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://google.com/products/product_reviews_v1.xsd
<span style="white-spacere <author>
<span style="white-spacere <name>Review Source</name>
<span style="white-spacere <email>contact@example.com</email>
<span style="white-spacere </author>
....rest of xml fragment
<br/>
My plan was to use xsd tool to create an object in which to load the xml and validate it. If I cant get the object created Im in for a lot of typing/xslt transformation.
<br/>
Thanks for your help
View the full article