[xsd-users] support needed
Boris Kolpackov
boris at codesynthesis.com
Thu Jun 28 09:18:52 EDT 2007
Hi Andreas,
A. Keutterling, GEOSYSTEMS <a.keutterling at geosystems.de> writes:
> Currently I try out your XML-binding mechanism. I am really surprised
> how simple it appears to read a xml file. On the other hand it seems to
> me I have forgotten something in my workflow. Can you show me what's
> missing. Here is my code fragment:
>
> void DialogController::Test_ReadProject()
> {
> std::ifstream ifs
> ("D:/IDK/designs/INTERFEROMETRY/XML/Beispiel_validiert.xml");
> auto_ptr<ORIDATA_ID> ptr = ORIDATA_ID (ifs);
>
> };
I think you did not provide a correct type in the auto_ptr declaration.
I suggest that you do the following:
1. Compile your schema with the --morph-anonymous option (unless you
are using one of the betas for 3.0.0).
2. Include the generated header file into your dialogController.cpp
3. Change your code to read like this:
auto_ptr<ORIDATA_ID> ptr = ORIDATA_ID_ (ifs);
Here ORIDATA_ID is the type for the root element in your schema and
ORIDATA_ID_ is the corresponding parsing function (its name is escaped
with the trailing '_' to avoid the conflict with the type name).
hth,
-boris
More information about the xsd-users
mailing list