No, there is no such limitation in the XML Schema specification. It may
be possible that you have no access to the resources on the server, for
instance if you are behind a proxy or behind a firewall.
Note also that you should be able to use also XML Catalogs to resolve
the references to the online version of the schemas to local copies of
those files - that is useful when working offline and when the
connection with the server is slow.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Error at file /home/jmoon/xmlServer/test.xml, line 4, char 87
Message: Schema in http://ws14.design.amis.com/test.xsd has a
different target namespace from the one specified in the instance
document http://ws14.design.amis.com/.
If you can help on this I can send you the schema I'm using and such
if that would help. I basically just want to get it working with a
really simple example.
<library
xmlns="http://ws14.design.amis.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://ws14.design.amis.com/
http://ws14.design.amis.com/test.xsd">
</library>
Errors occurred, no output available
On Sep 19, 12:56 pm, "Jeff Moon" <moontu...@gmail.com> wrote:
> I control the server and I can get to the schemas if I type them into
> my browser, so I don't think that the problem is a proxy or firewall.
> It gives me an error:
>
> Error at file /home/jmoon/xmlServer/test.xml, line 4, char 87
> Message: Schema inhttp://ws14.design.amis.com/test.xsdhas a
> different target namespace from the one specified in the instance
> documenthttp://ws14.design.amis.com/.
>
> If you can help on this I can send you the schema I'm using and such
> if that would help. I basically just want to get it working with a
> really simple example.
>
> <library
> xmlns="http://ws14.design.amis.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
> xs:schemaLocation="http://ws14.design.amis.com/http://ws14.design.amis.com/test.xsd">
> </library>
>
> Errors occurred, no output available
>
> On 9/19/07, George Cristian Bina <geo...@oxygenxml.com> wrote:
>
>
>
> > Hi Jeff,
>
> > No, there is no such limitation in the XML Schema specification. It may
> > be possible that you have no access to the resources on the server, for
> > instance if you are behind a proxy or behind a firewall.
> > Note also that you should be able to use also XML Catalogs to resolve
> > the references to the online version of the schemas to local copies of
> > those files - that is useful when working offline and when the
> > connection with the server is slow.
>
> > Best Regards,
> > George
> > ---------------------------------------------------------------------
> > George Cristian Bina -http://aboutxml.blogspot.com/
> > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> >http://www.oxygenxml.com
>
You have a namespace mismatch, see
<library
xmlns="http://ws14.design.amis.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://ws14.design.amis.com/
http://ws14.design.amis.com/test.xsd">
</library>
You declare library element to be in the http://ws14.design.amis.com
namespace while when you associate the schema with the document you
use xs:schemaLocation="http://ws14.design.amis.com/
http://ws14.design.amis.com/test.xsd", note the trailing / at the end
of the namespace. Check the target namespace in your schema file and
make sure you use that both for the element declaration and inside the
schemaLocation attribute.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
test.xsd:
<?xml version="1.0"?>
<xsd:schema
xmlns="http://ws14.design.amis.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
version="1.0">
<xsd:element name="library" type="xsd:string"/>
</xsd:schema>
Output:
> DOMCount -s -n -v=always -f test.xml
Error at file /home/jmoon/xmlServer/test.xml, line 5, char 60
Message: Schema in http://ws14.design.amis.com/test.xsd has a
different target namespace from the one specified in the instance
document http://ws14.design.amis.com.
Error at file /home/jmoon/xmlServer/test.xml, line 5, char 60
Message: Unknown element 'library'
Errors occurred, no output available
Any more help would be appreciated. I'm sort of a newbie with xml validation.
Thanks!
<xsd:schema
xmlns="http://ws14.design.amis.com"
targetNamespace="http://ws14.design.amis.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
version="1.0">
etc.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina -http://aboutxml.blogspot.com/
On 9/20/07, George Bina <geo...@oxygenxml.com> wrote:
>