[xsd-users] unable to load file with --suppress-parsing activated

Adrian Stern adrian.stern at screenfood.com
Mon May 27 10:48:10 EDT 2013


Hi

As i understand i do not need the parsing ability since i intend to load the whole document to ram (cxx-tree/DOM). So i disabled the generation of the parsing methods with --suppress-parsing which rendered my code invalid.

This code worked with parsing abut not without:
======================================================
  auto_ptr<special_smil> s;

  try{
    s = special_smil_("/tmp/content.xml", xml_schema::flags::dont_validate);
  }catch(const xml_schema::exception& e){
    cerr << "could not load xml" << endl;
    return;
  }

  // print ids of playlists in xml
  playlist_seq& ps (s->playlists().playlist());
  for (playlist_itr i (ps.begin ()); i != ps.end (); ++i){
    playlist_t& p (*i);
    cout << "id: " << p.id() << endl;
  }
======================================================

Without parsing I am unable to figure out how to load my content.xml.
I tried the following code, which is basically the same as in one of the examples but I always get this strange error which basically says nothing.
======================================================
auto_ptr<special_smil> s (special_smil(c));
playlist_seq& ps (s->playlists().playlist());    // error here

main.cpp:47: error: request for member 'playlists' in 's', which is of non-class type 'std::auto_ptr<special_smil>(special_smil)'
======================================================

I guess something is going on while loading but without any output. Any ideas?
All I want is to simply load my Xml file and iterate trough it while maintaining it in memory since later on there will be several cycles of iteration to read the whole file.

My xsd file: http://pastebin.com/cYxgXwtT
My xml file: http://pastebin.com/cFN6N8Q8
Dsig file: http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd

xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --proprietary-license --suppress-parsing --root-element special-smil --namespace-map "http://www.w3.org/2000/09/xmldsig#=ds" --show-sloc screenfood-0.2.xsd

xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --proprietary-license --suppress-parsing --root-element Signature --namespace-map "http://www.w3.org/2000/09/xmldsig#=ds" --show-sloc xmldsig-core-schema.xsd

Thanks for any help. I have to get a grip to this tool.

Freundliche Grüsse / Best Regards / Meilleures salutations
Adrian Stern
Diese E-Mail und ihre Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anhänge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



More information about the xsd-users mailing list