[xml] xmlSchemaParse() generates error after using xmlSchemaNewMemParserCtxt()



Hi
First, I'm sorry for my poor English..

I use the libxml2 2.6.2, 2.6.3, 2.6.4 on redhat7.3.
I'm trying to validate an W3C XML Schema and get the error message:
----------------------------------------------------
in_memory_buffer:1: element element: Schemas parser error :
Element has no name nor ref
----------------------------------------------------
This error was generated when I used xmlSchemaParse(ctxt) after using
xmlSchemaNewMemParserCtxt(buf,len), and this occurred only in
libxml2.6.3 and libxml2.6.4.
When I used libxml2.6.2,that didn't occur and validation ended successfully.

I also tried validating docs with xmlSchemaParse(ctxt) after using
xmlSchemaNewParserCtxt(uri), and such errors waren't generated in
every(that is,2.6.2, 2.6.3, 2.6.4) version of libxml.
command "xmllint --schema a.xsd a.xml" output the same result too.

I used following files:
---a.xml(file only)----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.test.com/ a.xsd"
xmlns="http://www.test.com/";>
 <b>aaaaa</b>
</a>
---a.xsd(file or buffer)-------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://www.test.com/";
xmlns:a="http://www.test.com/";>
 <xs:element name="a">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="a:b" />
   </xs:sequence>
  </xs:complexType>
 </xs:element>
 <xs:element name="b" type="xs:string" />
</xs:schema>
--------------------------------------------------------

Does anyone have any hints ?
Has anybody got same problem ?

Thanks
Taihei





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]