xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Kolpackov <bo...@codesynthesis.com>
Subject Re: Retrieve list of valid children based on element name.
Date Wed, 24 Jan 2007 07:55:51 GMT
Hi Timothy,

Timothy Strimple <tstrimple@collectivedata.com> writes:

> I'm trying to setup a system that will allow me to dynamically build xml
> documents based on a schema. I've successfully implemented PSVI thinking
> that would be all I needed to build the list I wanted, however it only
> seems to build a list of children that are actually in the xml, not what
> is defined within the schema. For example, in the case of an optional
> attribute, it doesn't show up unless the xml document contains it, even
> though it's allowed via the stylesheet. I basically just need a list of
> valid elements and attributes for a particular element. Is there a way
> to build this list using xerces?

I am somewhat confused by your description, but if you managed to get
a, say, PSVIElement for an element in your instance, then you can get
to XSTypeDefinition which describes the type that was used to validate
this element. From XSTypeDefinition you should be able to get the
complete content model of a type, including elements and attributes.


hth,
-boris


-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding


Mime
View raw message