You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Martin Wilson <ma...@infinity.co.nz> on 2002/03/08 02:06:29 UTC
Schema Validation problem ...
Hi all,
I have a problem validating a document that uses 'TargetNamespace' in the
schema and 'schemaLocation' in the document.
i get "Line: 3, Column: 154, Error: Type not found in :addressline" from the
parser when trying to validate this document.
The other version work fine when put through the DOM_Parser - it uses
'noNamespaceSchemaLocation'.
This is probably a lack of understanding on my part bu what makes these two
documents different and why ????
Many thanks in advance.
<<DONTWORK.addr.xml>> <<DONTWORK.addr.xsd>> <<addr.xml>> <<addr.xsd>>
Martin Wilson
Transport Systems Division
The information contained in this email is privileged and confidential and
intended for the addressee only. If you are not the intended recipient, you
are asked to respect that confidentiality and not disclose, copy or make use
of its contents. If received in error you are asked to destroy this email
and contact the sender immediately. Your assistance is appreciated.
Trouble with Linux Distribution.
Posted by Jorge Pozo Ramirez <j....@externo.mju.es>.
Hi there.
I've just installed Red Hat Linux 7.2 from scratch on a development
machine. I'm compiling some executables that worked properly before on SCO
Openserver and HPUX 11 and 10.20 enviroments. When I execute my code,
randomly it hangs up, or coredumps when trying to free memory, (as GDB stack
print shows always the fault on malloc.free, called from the destructor of
DOMNodes).
I ran the same code with the same XML docs on the three previous
machines without any trouble. And even more complex examples.
I've tried to use the stable 1.6 Xerces-C release, (compiled on RedHat
6), the latest nightly 1.7, (compiled on RH 7.2 also), and I've built my own
1.6 library from the source code, both on threaded and non-threaded
versions. All libraries gave me the same result.
Is there any patch that I must install on the basic Red Hat 7.2 release
for running Xerces???. It seems to be some kind of libc bug. Any idea?.
Jorge.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Schema Validation problem ...
Posted by Khaled Noaman <kn...@ca.ibm.com>.
Hi Martin,
In DONTWORK.addr.xsd, the schema components are defined in the
targetNamespace of the schema. So, if you refer to any global components
of that schema, you need to qualify them (i.e. use a prefix that will resolve to
the schema target namespace). Here is a link to the QName resolution
constraint as defined in the schema spec:
http://www.w3.org/TR/xmlschema-1/#src-resolve.
You need to change your schema to declare a prefix that maps to the
schema's targetNamespace, and use that prefix when refering to global
declarations.
e.g.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:co="http://www.my.co.nz" targetNamespace="http://www.my.co.nz">
<!-- Definition of simple type elements -->
<xs:simpleType name="addressline">
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="address">
<xs:sequence>
<xs:element name="line1" type="co:addressline" minOccurs="1"
maxOccurs="1"/>
<xs:element name="line2" type="co:addressline" minOccurs="0"
maxOccurs="1"/>
<xs:element name="line3" type="co:addressline" minOccurs="0"
maxOccurs="1"/>
</xs:sequence>
...
...
</xs:schema>
Regards,
Khaled
Martin Wilson wrote:
> Hi all,
>
> I have a problem validating a document that uses 'TargetNamespace' in the
> schema and 'schemaLocation' in the document.
> i get "Line: 3, Column: 154, Error: Type not found in :addressline" from the
> parser when trying to validate this document.
>
> The other version work fine when put through the DOM_Parser - it uses
> 'noNamespaceSchemaLocation'.
>
> This is probably a lack of understanding on my part bu what makes these two
> documents different and why ????
>
> Many thanks in advance.
>
> <<DONTWORK.addr.xml>> <<DONTWORK.addr.xsd>> <<addr.xml>> <<addr.xsd>>
>
> Martin Wilson
> Transport Systems Division
>
> The information contained in this email is privileged and confidential and
> intended for the addressee only. If you are not the intended recipient, you
> are asked to respect that confidentiality and not disclose, copy or make use
> of its contents. If received in error you are asked to destroy this email
> and contact the sender immediately. Your assistance is appreciated.
>
> ------------------------------------------------------------------------
> Name: DONTWORK.addr.xml
> DONTWORK.addr.xml Type: XML Document (text/xml)
> Encoding: base64
>
> DONTWORK.addr.xsdName: DONTWORK.addr.xsd
> Type: unspecified type (application/octet-stream)
>
> addr.xmlName: addr.xml
> Type: XML Document (text/xml)
>
> addr.xsdName: addr.xsd
> Type: unspecified type (application/octet-stream)
>
> ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org