W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2006

RE: include and targetNamespace error

From: Debora Vanni <debora.vanni@tvblob.com>
Date: Thu, 18 May 2006 11:57:05 +0200
To: "Buchcik, Kasimier" <k.buchcik@4commerce.de>
Cc: xmlschema-dev@w3.org, priscilla@walmsley.com
Message-Id: <1147946225.23847.84.camel@localhost.localdomain>

Thanks  Kasimier and George for your answer!
Yes, I'm using libxml2 but I'm not using head version(I still don't have
I'm using a .xsd file to validate an .xml file(two different files).
In the .xml file there is no targetNamespace, infact it works if I don't
put any targetNamespace(in both files)!
I have this .xml file
<iq message-id="FvG_O114" session="0" box-session="1323242123"
rc-session-id="157523655" to="tvblob" type="get">
    <service xmlns="tvblob:backend:directory">
        <action method="addsubscriber">
                <family-name>D'Orso Bianchi</family-name>
and the two .xsd I sent before.

The other problem is with ref and "all"(see my other message).
I change message.xml and .xsd to simplify messages for debug but the
problem is that I defined in common_types.xsd also some element(global)
and I would like to ref to that in add_subscriber.xsd. 
I have no targetNamespace in add_subscriber.xsd and I leave
targetNamespace("http://www.tvblob3.com/TVB") in common_types.xsd. I use
"import" instead of "include" but it only works with complexType -
sequence and not with complexType-all. Maybe the problem is always the
same(I don't have targetNamespace in .xml). 
But to use ref do I need a prefix(<xs:element ref =
"tvb:family-name"/>) ?
Because I also try to use NO targetNamespace(in both file .xsd) and
include ((<xs:element ref = "family-name"/>) but there still is the same
error(element note: Schemas validity error : Element 'note' [CT local]:
element content is not valid.)!
Thank you again

Il giorno gio, 18-05-2006 alle 11:02 +0200, Buchcik, Kasimier ha
> Hi,
> > -----Original Message-----
> > From: xmlschema-dev-request@w3.org 
> > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Debora Vanni
> > 
> > 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!
> The error message:
> "Element 'message_content': No matching global declaration available."
> means that the element in your instance is in no namespace. Libxml2
> uses James Clark's namespace notation for error reports, thus a
> 'message_content' is an element in no namespace, and a
> '{urn:test:foo}message_content' is an element in the namespace
> "urn:test:foo".
> The element declaration of "message_content" in the given schema,
> declares the element to be in the namespace
> "http://www.tvblob3.com/TVB".
> [...]
> Regards,
> Kasimier
Received on Thursday, 18 May 2006 10:02:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:10 UTC