[xsd-users] How to add data to xml any type of object

Babinskas, Albert albert.babinskas at imagingsciences.com
Tue Sep 10 09:06:19 EDT 2013


Hi Boris,
I realized that yesterday after I have sent the email. I added --generate-wildcard option and I was able to generate accessor and modifier methods for the XSD. I still have the remaining question of how can I add object to this xs:any type? 'Wildcard' example shows that you create 'envelope' object and then get its DOMDocument. I cannot instantiate my object since it requires to pass it DOMElement. How can I create DOMDocument from the XSD? Another example of 'dbxml' shows that you are using XmlManager, but I am not sure where to get that object.


-Albert 

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Tuesday, September 10, 2013 8:15 AM
To: Babinskas, Albert
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] How to add data to xml any type of object

Hi Albert,

Babinskas, Albert <albert.babinskas at imagingsciences.com> writes:

> <xs:complexType name="brandXml_t">
>     <xs:sequence>
>       <xs:any processContents="skip" namespace="##other"/>
>     </xs:sequence>
>   </xs:complexType>
> 
> It does compile, but I cannot get any_sequence, any_iterator or any to 
> appear.

In your case there will be just any() accessors/modifiers since the cardinality is 1.


> I am not sure what I am doing wrong.

Perhaps you are not compiling your schema with the --generate-wildcard option. See Section 2.12, "Mapping for any and anyAttribute" in the 
C++/Tree Mapping User Manual:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.12

Boris


Please be advised that this email may contain confidential 
information.  If you are not the intended recipient, please notify us 
by email by replying to the sender and delete this message.  The 
sender disclaims that the content of this email constitutes an offer 
to enter into, or the acceptance of, any agreement; provided that the 
foregoing does not invalidate the binding effect of any digital or 
other electronic reproduction of a manual signature that is included 
in any attachment.





More information about the xsd-users mailing list