Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Schema Not working

From: Anne van Rossum <anne4theweb@-----.--->
To: xmlschema-dev@--.---
Date: 8/26/2006 11:03:00 PM
Hi Satya,

Don't know what your objectives are. But anyway, the way you close the 
elements in your schema is not correct. These elements should be in this 
way: </xs:sequence> etc. So

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://example.com">
   <xs:element name="person">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="familyName" type="xs:integer" />
         <xs:element name="firstName" type="xs:string" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>
</xs:schema>

And secondly, familyName is defined as integer so this xml-file is invalid:

<foo:person xmlns:foo="http://example.com">
   <familyName> test </familyName>
   <firstName> Kohsuke </firstName>
</foo:person>

You can check it for yourself using one of a dozen 
<http://tools.decisionsoft.com/schemaValidate/>online validators. With some 
you can only use more or less "official" schemas, with others you have to 
enter URLs and with some you can enter files from your local system.

Enjoy!

Andy

At 04:29 26-8-2006, Babu Gummadi wrote:

>Hi,
>
>   I am new to XML Schemas, I am learning now, I wrote an xml file and 
> schema to validate that xml file. i applyed xsd on that, Still its not 
> validating the xml and just displaying the xml text on browser, Please 
> help me to resolve the issue
>
>   here is my XSD:
>
>   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>       targetNamespace="http://example.com">
>   <xs:element name="person">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element name="familyName" type="xs:integer" />
>         <xs:element name="firstName" type="xs:string" />
>       <xs:sequence>
>     <xs:complexType>
>   <xs:element>
><xs:schema>
>
>
>   XML File
>   <foo:person xmlns:foo="http://example.com">
>   <familyName> test </familyName>
>   <firstName> Kohsuke </firstName>
></foo:person>
>
>
>
>   Regards
>   Satya


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent