Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: What is wrong with this .XSD?

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 3/2/2005 1:48:00 PM

Casper B wrote:

> I have trouble constructing an .xsd to validate the following simple XML:
> 
> ------
> <?xml version = "1.0" encoding="UTF-8"?>
> <FormatSpec FormatName="Test" Encoding="ISO-8859-1" TableName="RecordSet"
> xmlns="http://www.xyz.com"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="FormatSpec.xsd">

schemaLocation takes at list of white space separated namespaceURIs and 
schema URIs e.g.
   xsi:schemaLocation="http://www.xyz.com FormatSpec.xsd"

>  <RowSpec Iterations="1">
>   <ColSpec BeginOffset="0" EndOffset="8" RegExMatch="udgstart"/>
>  </RowSpec>
> 
>  <RowSpec RowName="Record">
>   <ColSpec BeginOffset="0" EndOffset="12" ColName="BuildingId"/>
>   <ColSpec BeginOffset="17" EndOffset="21" ColName="StartDateYear"/>
>   <ColSpec BeginOffset="55" EndOffset="80" Trim="true" ColName="Name"/>
>  </RowSpec>
> </FormatSpec>
> ------
> 
> My parser (oracle v2 for Java) only seems to validate the top element 
> and never any attributtes even though I (think) I specify this with the 
> following .xsd schema:
> 
> ------
> <?xml version="1.0" encoding="windows-1252" ?>
> 
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>             xmlns="http://www.xyz.com"
>             targetNamespace="http://www.xyz.com"
>             elementFormDefault="qualified" 
> attributeFormDefault="qualified">

Your attributes above are all unqualified (in no namespace) so here you 
should use
   attributeFormDefault="unqualified"


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/


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