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

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"
---a.xsd(file or buffer)-------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
 <xs:element name="a">
    <xs:element ref="a:b" />
 <xs:element name="b" type="xs:string" />

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


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