[xsd-users] ifc xml

giuseppe ferrari giuseppe500 at yahoo.it
Thu Jan 27 11:28:34 EST 2011



you are great!!!!

work.
thanks.
the last question :
I have to do with many ifcxml, maybe you can dynamically add through xerces 
engine  using namespace xmlns: = ifc 
"http://www.iai-tech.org/ifcXML/IFC2x3/FINAL" when there aren't?
Otherwise, how do I deserialize all documents correctly?
thanks.




________________________________
Da: Boris Kolpackov <boris at codesynthesis.com>
A: giuseppe ferrari  <giuseppe500 at yahoo.it>
Cc: xsd-users at codesynthesis.com
Inviato: Gio 27 gennaio 2011, 10:22:43
Oggetto: Re: [xsd-users] ifc xml

Hi Giuseppe,

giuseppe ferrari <giuseppe500 at yahoo.it> writes:

> The reason for this error is the use of the nillable attributes in
> the  schema. XSD does not yet support this feature so when it sees
> an element like this in the XML document:
> 
> <IfcOrganization xsi:nil="true" ref="i1556"/>
> 
> It expects to find the required content of this element (like child
> element 'Name').
> 
> Can you try the above options and see if you get the same error?
> In the meantime, I will think of any  workarounds for this problem
> (I can't think of anything good right now).

Ok, I have come up with a workaround. As I mentioned above, XSD does
not support nillable elements. This is actually one of those misguided
XML Schema features that don't map cleanly to OO models and that hardly
anyone uses (in XML Schema nil elements can still have attributes). The
idea behind my workaround is to customize the types that are used in
nillable elements and handle the nil semantics there. Since there are
a lot of such types in your schema, we use a template wrapper (see the
nillable-type.hxx file for details).

All the necessary options files as well as nillable-type.hxx are
available in this archive:

http://www.codesynthesis.com/~boris/tmp/ifc.zip

The README file inside provides the XSD command lines that I used to
compile the  schemas. With this approach I was able to parse the file
without any errors and cast to the ifc:uos element.

Boris


      


More information about the xsd-users mailing list