[xsd-users] XML Object to String/Text

Boris Kolpackov boris at codesynthesis.com
Thu Feb 22 13:22:31 EST 2007


Hi Paddy,

Paddy Vishnubhatt <Paddy.Vishnubhatt at 3leafnetworks.com> writes:

> Feature request/suggestion: Can this all be packaged into one API? I
> don't know how the Java framework managed to pull this off but it is
> likely that they may have hidden all the above (the create() and
> serialize() functions and the use of ostringstream, etc) 'under the
> covers' and offered a 'blanket' API and called it xmlText(). If you
> can do the same in some near (or not so distant) future, it'll help
> many who're doing distributed/x-platform (XDR-like) where stringifying
> XML to strings and passing data is an easy means to exchange data.

Thanks for the suggestion. The tricky part here is to figure out what the
element name should be. In your code you used request.objectName() but
that is application-specific.

On the other hand, you can get pretty much all of that code (except
the stringstream part) auto-generated by declaring a global element
corresponding to your type. This is also right thing to do from the
XML Schema perspective since your document becomes valid per the
schema. We will think some more on this.


thanks,
-boris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070222/a6a6af30/attachment.pgp


More information about the xsd-users mailing list