"updated" [xsde-users] error "unable to open in read mode"

Boris Kolpackov boris at codesynthesis.com
Mon Aug 22 12:29:11 EDT 2011


Hi Rashi,

Rashi Jha <rashij at cybage.com> writes:

> And in the corresponding driver code I created the structures for the 
> complex types which inherit the parser skeleton files.

I looked into your driver implementation and from the code it is clear
to me that you don't have a good understanding of the C++/Parser
programming model. In particular:

1. You pass a skeleton as a base implementation (base_pimpl_).
2. You haven't connection the parsers.
3. You are trying to call a callback function yourself (title()).
4. You are calling the post() function for an inner parser, not for
   the document root.

I suggest that before you attempt to write any code, you carefully
study the C++/Parser Getting Started Guide and make sure you understand
the C++/Parser programming model.

> In main I tried calling title() function and post_ST(), but none of 
> them could read the contents of <title>

As I said earlier, calling these functions directly from main() doesn't
make any sense whatsoever.


> I am not able to figure out which method I need to overload in order
> to access the contents of <title> element.

The correct term is "override", not "overload". As we discusses earlier,
the ST type has mixed content. The cxx/parser/mixed example in XSD/e
distribution shown how you can parse mixed content data. In your case
you will at least need to override the _any_character() callback.


> Query regarding Android platform:
> 
> I wanted to know that other than building a separate library for android,
> will the driver code that i will write for the classes generated for iOS
> applications would work the  same in android or do I need to write a 
> separate driver code for android applications?

Yes, the same code should work on both platforms provided that you use
C++ features (STL, exceptions, etc) that are available on both iOS and
Android.

Note also, that on Android, XSD/e can only be used as part of an NDK-
based application. This may have changed, but the last time I checked,
one still had to implement UI in Java and, depending on your application,
passing parsed XML data from the native code to Java may not be easy.

Boris



More information about the xsde-users mailing list