Hi all,

I want to parse some MPEG-7 metadata. I load the metadata file into a C string 
(char *) and use the following code to parse it. However, it causes an error 
which crashes the application. I cannot even know what error it is. Can you 
help me please. 

Thank you very much in advance.

Code: 

XMLPlatformUtils::Initialize();
XERCES_CPP_NAMESPACE::XMLGrammarPoolImpl mpGrammarPool = new 
XMLGrammarPoolImpl(XMLPlatformUtils::fgMemoryManager);
XERCES_CPP_NAMESPACE::XercesDOMParser parser= new XercesDOMParser(0, 
XMLPlatformUtils::fgMemoryManager, mpGrammarPool); 

XercesDOMParser::ValSchemes valScheme = XercesDOMParser::Val_Always;
mpParser->setValidationScheme(valScheme);
mpParser->setDoNamespaces(true);
mpParser->setDoSchema(true);
mpParser->setValidationSchemaFullChecking(true);
mpParser->setIncludeIgnorableWhitespace(false);

MemBufInputSource* memBufIS = new MemBufInputSource(
                                                                      (const 
XMLByte*)pXMLString, // pXMLString is the data to be parsed
                                                                      
strlen(pXMLString),
                                                                      
"FromString", 
                                                                      false);
 mpParser->parse(*memBufIS); // crash here


The content of the metadata file:



<Mpeg7 xmlns="urn:mpeg:mpeg7:schema:2001" 

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 

       xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" 

       xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 Mpeg7-2001.xsd">

    <DescriptionMetadata>

        <Version>1.0</Version>

        <PrivateIdentifier>descriptionUnitExample</PrivateIdentifier>

    </DescriptionMetadata>

    <DescriptionUnit xsi:type="ScalableColorType" numOfCoeff="16" 
numOfBitplanesDiscarded="0">

        <Coeff> 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 </Coeff>

    </DescriptionUnit>

</Mpeg7>



The MPEG-7 Schemas are downloaded from: http://m7itb.nist.gov/M7Validation.html

Best regards

_________________________________________________________________
Get Hotmail on your mobile, text MSN to 63463!
http://mobile.uk.msn.com/pc/mail.aspx

Reply via email to