[xsde-users] unexpected element encountered

Boris Kolpackov boris at codesynthesis.com
Thu Jun 21 05:26:26 EDT 2012


Hi Luc,

Luc Verbist <lucv at etzou.net> writes:

> $ ./driver DASH-Ex-G5.xml 
> 3. DASH-Ex-G5.xml:9:56: unexpected element encountered

In your driver.cxx you have this code:

    xml_schema::document_pimpl doc_p (MPD_p.root_parser (),
                                      MPD_p.root_name ());

This is how you would do it for an XML vocabulary that doesn't use
namespaces. However, your schema uses namespaces, so besides the
root element name you also need to pass its namespace:

    xml_schema::document_pimpl doc_p (MPD_p.root_parser (),
                                      MPD_p.root_namespace (),
                                      MPD_p.root_name ());

With this change your test seems to be working fine.

Boris



More information about the xsde-users mailing list