xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea009 <and...@group1software.co.uk>
Subject Re: Reading non referenced complexTypes from a Schema
Date Tue, 07 Jul 2009 12:03:20 GMT

David Bertoni wrote:
> Andrea009 wrote:
>> I have searched through the forums but so far unable to locate anything.
>> How can I enumerate complexType declarations in a schema when they do not
>> have an element referencing them ?
>> e.g. (snippet)
>> 	<xs:complexType name="foo_extension">
>> 	   <xs:complexContent>
>> 	       <xs:extension base="foo">
>> 	          <xs:attributeGroup ref="foo_properties"/>
>> 	        </xs:extension>
>> 	   </xs:complexContent>
>> 	</xs:complexType>
>> If I include <xs:element name="foo_extension"/> then using the following
>> code is fine:
>> RefHash3KeysIdPoolEnumerator<SchemaElementDecl> schemaElemEnum =
>> grammar->getElemEnumerator();
>> and I can loop around getting all the information I require. 
>> However an element declaration is not mandatory for the extension to be
>> referenced using an xsi:type in the data. I need to read in the schema
>> and
>> get all non-referenced complexTypes before I start looking at data. Is
>> there
>> a way? I cannot see anything immediately obvious.
> Have you tried using the XSModel APIs?  Those are a better fit for 
> general schema information than hacking with the internal interfaces. 
> They also attempt to mirror the PSVI as described by the schema 
> recommendation.
> The PSVIWriter sample uses these APIs, so you could take a look at it 
> for more information.
> Dave

Thanks! Our current model hasnt been anywhere near the XSModel. Ive taken
over a old project and its been an uphill struggle to get to grips with all
the various interfaces. Ive had a quick peep at the XSModel and it looks as
if it will open up many of our current restrictions. It does seem to be
exactly what is required although now I have a lot of code to rewrite and
figure out.


View this message in context: http://www.nabble.com/Reading-non-referenced-complexTypes-from-a-Schema-tp24358291p24372078.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.

View raw message