Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: include and targetNamespace error

From: George Cristian Bina <george@---------.--->
To: Debora Vanni <debora.vanni@------.--->
Date: 5/18/2006 12:48:00 PM
Hi Debora,

The schemas look ok, except for a couple of missing closing tags that I 
had to add to make the document wellformed. I guess the problem is in 
your instance document, or in the way you associate the schema. Make 
sure you correctly place the root element in your schema target 
namespace and if you associate the schema in file then make sure you use 
the xsi:schemaLocation for that (and not xsi:noNamespaceSchemaLocation).
Assuming the schema name is sample.xsd you can find below a valid instance:

sample.xml

<?xml version="1.0" encoding="UTF-8"?>
<message_content xmlns="http://www.tvblob3.com/TVB"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.tvblob3.com/TVB sample.xsd">
   <filter-parameters xmlns=""></filter-parameters>
</message_content>


Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


Debora Vanni wrote:
> Hi!
> I have some problems with targetNamespace:
> I have a file .xsd with some simpleType that I want to use also in
> another file.xsd, so I would like to include it.
> When I do it it comes out this error
> element message_content: Schemas validity error : Element
> 'message_content': No matching global declaration available.
> (message_content is the root node of the message xml).
> I tried not to use the include and define types inside schema but it's
> the same. It only works without define targetNamespace and xmls.
> These are files...what's wrong?
> Please help me!
> 
> <?xml version="1.0"?>
> <xs:schema 
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.tvblob3.com/TVB"
> xmlns:tvb="http://www.tvblob3.com/TVB">
> 
> 
> <xs:include schemaLocation="common_types.xsd"/>
> 
> 
> <xs:element name="message_content">
> <xs:complexType>
> 	<xs:all>
> 	    	      
>         <xs:element name="filter-parameters" >
>           <xs:complexType>
> 	    <xs:all minOccurs="0">
> 
> 		<xs:element name="family-name" type="tvb:simple_text"/> 
> 				
> 		<xs:element name="first-name" type = "tvb:simple_text"/>
> 				
> 	    </xs:all>			
>          </xs:complexType>
>        </xs:element>
> 		
> 		
> 			
> 	
> </xs:element>
> 	     
> </xs:schema>
> 
> and the other file is
> <?xml version="1.0"?>
> <xs:schema 
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.tvblob3.com/TVB"
> xmlns:tvb="http://www.tvblob3.com/TVB">
> 
> <xs:simpleType name="simple_text">
>   <xs:restriction base="xs:string">
>     <xs:pattern
> value="([a-zA-Z'])+([ ])*([a-zA-Z'])*([ ])*([a-zA-Z'])*([ ])*([a-zA-Z'])*([ ])*([a-zA-Z'])*([ ])*([a-zA-Z'])*"/>
>   </xs:restriction>
> </xs:simpleType>
> 
> <xs:simpleType name="alfa_numeric_plus">
>   <xs:restriction base="xs:string">
>     <xs:pattern value="([a-zA-Z0-9])+[-_#*]*"/>
>   </xs:restriction>
> </xs:simpleType>
> 
> <xs:simpleType name="alfa_numeric">
>   <xs:restriction base="xs:string">
>     <xs:pattern value="([a-zA-Z0-9])+"/>
>   </xs:restriction>
> </xs:simpleType>
> 
> </xs:schema>
> 
> Thanks
> Debora Vanni
> debora.vanni@t...
> 
> 
> 
> 
> 

From gkholman@C... Thu May 18 07:36:53 2006
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.50


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