[xsd-users] Compiling CSTA XSD files

Boris Kolpackov boris at codesynthesis.com
Thu Jun 11 14:06:36 EDT 2009


Hi Batya,

In the future please keep your replies CC'ed to the xsd-users mailing
list. See the Posting Guidelines for more information:

http://www.codesynthesis.com/support/posting-guidelines.xhtml


Batya Hacohen <Batya.Hacohen at tadirantele.com> writes:
 
> I know that once I may decode/encode one CSTA service/event the rest
> will be easier. I am struggling the first.
>  
> My XML input is a string, not in file.
> 
> So if I have make-call string:
> char *makeCall = "<MakeCall
> xmlns=\"http://www.ecma-international.org/standards/ecma-323/csta/ed4\">
> <callingDevice>tel:+2001;ext=2001</callingDevice><calledDirectoryNumber>
> tel:4001;phone-context=dialstring</calledDirectoryNumber<autoOriginate>d
> oNotPrompt</autoOriginate></MakeCall>";
> 
> How can I decode it?

You would first need to make sure that the parsing functions for the
MakeCall element are generated (add --root-element-all or 
--root-element MakeCall).

Then you can use, for example, std::istringstream to parse from a 
string:

#include <sstream>

std::istringstream istr (makeCall);

std::auto_ptr<MakeCall> mc (MakeCall_ (istr));

If you don't know the root element of the XML document you are about
to parse, then see the 'multiroot' example in the examples/cxx/tree/
directory for more information on how to handle this situation.

Boris
 




More information about the xsd-users mailing list