[xml] Where can I get the declaration of a non global element in xmlSchema (using libxml2-2.6.22) ?



Hi,

With libxml2 version 2.6.21 I could retrieve the declaration of an element (using xmlHashScan(schema->elemDecl, ..., ...).

Unfortunately, it doesn't seem to be possible with the new release (I can get only global element declarations with this method).

The xmlSchemaDump fonction uses this method, (and testSchemas uses xmlSchemaDump) and with the following schema :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<xsd:element name="ELEMENTS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="element" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="element2" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>



- using libxml2-2.6.21 :
testSchemas --debug test.xsd --noout


It gives :

Schemas: no name, no target namespace
Type: #CT1 [complex] content: [element]
SEQUENCE
ELEM 'element' min: 0 max: unbounded
ELEM 'element2' min: 0 max: unbounded
Element (global): ELEMENTS
min 0 max: 0
Element: element
min 0 max: 0
type: string ns http://www.w3.org/2001/XMLSchema
Element: element2
min 0 max: 0
type: string ns http://www.w3.org/2001/XMLSchema

- with libxml2-2.6.22 :
testSchemas --debug test.xsd --noout

It gives

Schemas: no name, no target namespace
Element (global): ELEMENTS
min 0 max: 0

The local elements are not listed.

I tried to define ENABLE_NAMED_LOCALS (in xmlschemas.c) but it gave me the same result.

Is there a mean to retrieve all the element declarations ?

Regards,

Fabrice



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