You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Gergely Gati <ge...@isis-server.vuse.vanderbilt.edu> on 2002/09/18 01:25:01 UTC

Validating schema file with target namespace?

Hi,

I would like to use Xerces for batch XML validation but I stumbled into a
following problem.
Xerces does not seem to load the schema file from the same directory if I
use the 
targetNamespace stuff in the .xsd file.

With xsi:noNamespaceSchemaLocation in the XML file and no targetNamespace in
the XSD
file it works fine.

Could anyone tell me what am I doing wrong?

Is there a good example somewhere using Xerces with targetNamespace in the
XSD files?

Thanks in advance,
Gergely


The root element in the XML file starts like this:

<personnel 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 	
	xmlns="http://mysite.com/Personal/" 
	xsi:schemaLocation=". personal.xsd">

The top lines of the .xsd files are:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema 
  targetNamespace="http://mysite.com/Personal/" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns="http://mysite.com/Personal/" 
  elementFormDefault="qualified" 
  attributeFormDefault="unqualified">


Xerces version 2.1.0

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Validating schema file with target namespace?

Posted by Siarhei Biarozkin <sb...@zandar.com>.
I have the same problem, where an instance and a schema are located in the
same directory :
<!-- instance doc, should be validated against devices.xsd -->
<dev:Devices xmlns:dev="http://zandar.com/devices"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.zandar.com/devices devices.xsd">

I'd assume though that the problem is with systemId; when I submitted my
question few days ago I thought I'd get a quick reply...
I guess the only option is to get the source and try to find what's really
happening
Cheers
Sergey Beryozkin
----- Original Message -----
From: "Aleksandar Milanovic" <am...@galdosinc.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, September 18, 2002 1:05 AM
Subject: RE: Validating schema file with target namespace?


> I think your schema location should be:
>
> xsi:schemaLocation="http://mysite.com/Personal/ personal.xsd"
>
> Alex
>
> > -----Original Message-----
> > From: Gergely Gati [mailto:gergely@isis-server.vuse.vanderbilt.edu]
> > Sent: Tuesday, September 17, 2002 4:25 PM
> > To: 'xerces-j-user@xml.apache.org'
> > Subject: Validating schema file with target namespace?
> >
> >
> > Hi,
> >
> > I would like to use Xerces for batch XML validation but I stumbled into
a
> > following problem.
> > Xerces does not seem to load the schema file from the same directory if
I
> > use the
> > targetNamespace stuff in the .xsd file.
> >
> > With xsi:noNamespaceSchemaLocation in the XML file and no
> > targetNamespace in
> > the XSD
> > file it works fine.
> >
> > Could anyone tell me what am I doing wrong?
> >
> > Is there a good example somewhere using Xerces with targetNamespace in
the
> > XSD files?
> >
> > Thanks in advance,
> > Gergely
> >
> >
> > The root element in the XML file starts like this:
> >
> > <personnel
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns="http://mysite.com/Personal/"
> > xsi:schemaLocation=". personal.xsd">
> >
> > The top lines of the .xsd files are:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsd:schema
> >   targetNamespace="http://mysite.com/Personal/"
> >   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >   xmlns="http://mysite.com/Personal/"
> >   elementFormDefault="qualified"
> >   attributeFormDefault="unqualified">
> >
> >
> > Xerces version 2.1.0
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: Validating schema file with target namespace?

Posted by Aleksandar Milanovic <am...@galdosinc.com>.
I think your schema location should be:

xsi:schemaLocation="http://mysite.com/Personal/ personal.xsd"

Alex

> -----Original Message-----
> From: Gergely Gati [mailto:gergely@isis-server.vuse.vanderbilt.edu]
> Sent: Tuesday, September 17, 2002 4:25 PM
> To: 'xerces-j-user@xml.apache.org'
> Subject: Validating schema file with target namespace?
>
>
> Hi,
>
> I would like to use Xerces for batch XML validation but I stumbled into a
> following problem.
> Xerces does not seem to load the schema file from the same directory if I
> use the
> targetNamespace stuff in the .xsd file.
>
> With xsi:noNamespaceSchemaLocation in the XML file and no
> targetNamespace in
> the XSD
> file it works fine.
>
> Could anyone tell me what am I doing wrong?
>
> Is there a good example somewhere using Xerces with targetNamespace in the
> XSD files?
>
> Thanks in advance,
> Gergely
>
>
> The root element in the XML file starts like this:
>
> <personnel
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="http://mysite.com/Personal/"
> 	xsi:schemaLocation=". personal.xsd">
>
> The top lines of the .xsd files are:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema
>   targetNamespace="http://mysite.com/Personal/"
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns="http://mysite.com/Personal/"
>   elementFormDefault="qualified"
>   attributeFormDefault="unqualified">
>
>
> Xerces version 2.1.0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org