[xsd-users] Pointers to references

Wesley Peters Wesley.Peters at tachyon.com
Fri Feb 28 13:20:43 EST 2014


Boris, I'd just like to thank you again for your detailed answers to questions from the XSD userbase.  Your products are innovative and helpful and your customer service is fantastic.

On 2/28/14 7:05 AM, "Boris Kolpackov" <boris at codesynthesis.com> wrote:

Hi Mathew,

Mathew Benson <mathew.benson at gmail.com> writes:

> <SomeElement name="Object1"/>
> <AnotherElement someElementRef="Object1"/>.

If your schema uses xs:ID type for 'name' and xs:IDREF for
'someElementRef', then, yes, XSD will resolve such references
for you. See:

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


> Is it generating skeletal code that I can/should modify, or should I
> treat it as autocode that can be regenerated and should not be modified
> directly?

The generated code should not be modified but there is a mechanism
for customizing the generated classes. For more information on type
customization see the C++/Tree Mapping Customization Guide:

http://wiki.codesynthesis.com/Tree/Customization_guide

As well as the examples in the examples/cxx/tree/custom/ directory.

So if ID/IDREF does not apply (i.e., your schema uses key/keyref),
then the next best thing is to customize the generated classes to
add the pointers and to initialize them in the parsing constructors.

Boris



-------------------------------------------------------------
Mail1 junk filter.
Click here http://mail1.tachyon.net:5272/FrontController?operation=mbeu&f=00001_-128_20140228_628592.eml&chkBayesian=1&pr=1&mt=1&ma=s to mark email as junk.
-------------------------------------------------------------


________________________________

Confidentiality Notice: The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and is confidential and/or privileged. If you and we have a confidentiality agreement or other non-disclosure obligations between us, this Notice shall be deemed to mark and identify the content of this email and any attachments as confidential and proprietary. If any reader of this communication is not the intended recipient, unauthorized use, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.

IRS Circular 230 Disclosure: To ensure compliance with requirements imposed by the IRS, please be advised that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used or relied upon, and cannot be used or relied upon, for the purpose of (i) avoiding penalties under the Internal Revenue Code, or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.

E-mail is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.



More information about the xsd-users mailing list