[xsd-users] I want to ignore Unknown element

Tore Martin Hagen thagen at slb.com
Mon Apr 27 04:26:22 EDT 2009


Hi.

Is there a way I can tell the parser to just ignore all unknown tags as 
if they where not there?

I have tried to add my own xml_schema::error_handler and returning true. 
When logging in my own error handler I see this
id= line=9 column=34 sev=ERROR msg=Unknown element 'softwareImageConfigFile'
id= line=10 column=26 sev=ERROR msg=Element 'softwareImageConfigFile' is 
not valid for content model: '(network,dsnSubnet)'

And then it thows an exception which I assume comes from the 
DOMErrorHandler.

I have tried to add the flag xml_schema::flags::dont_validate and in 
this case the unknown element is ignored, but if I have an other error 
like unknown enum value my application crashes which is not so good.

Regards
Tore Martin Hagen




More information about the xsd-users mailing list