http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2454 *** shadow/2454 Thu Jul 5 03:41:55 2001 --- shadow/2454.tmp.963 Thu Jul 5 03:41:55 2001 *************** *** 0 **** --- 1,87 ---- + +============================================================================+ + | Got the Access violation exception when called getFormattedContentModel() | + +----------------------------------------------------------------------------+ + | Bug #: 2454 Product: Xerces-C | + | Status: NEW Version: 1.5 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: Miscellaneous | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Line in *.xsd file + <xsd:element name="A" type="xsd:string" minOccurs="1" nillable="true"/> + + Line in *.xml file + <A xsi:nil="true"/> + + Code: + ... + SchemaGrammar* grammar = (SchemaGrammar*) parser.getValidator().getGrammar(); + RefHash3KeysIdPoolEnumerator<SchemaElementDecl> elemEnum = + grammar->getElemEnumerator(); + if (elemEnum.hasMoreElements()) + { + while(elemEnum.hasMoreElements()) + { + const SchemaElementDecl& curElem = elemEnum.nextElement(); + cout << "Name: " << StrX(curElem.getFullName()) << "\n"; + + // Exception here + const XMLCh* fmtCntModel = curElem.getFormattedContentModel(); + + debug: + :curElem.XMLElementDecl.fElementName.fRawName = A + + Step into: + + const XMLCh* + XMLElementDecl::getFormattedContentModel() const + { + if (!fFormattedModel) + ((XMLElementDecl*)this)->fFormattedModel = formatContentModel(); // + Step into + + + + XMLCh* + SchemaElementDecl::formatContentModel() const + { + ... + else + { + XMLBuffer bufFmt; + getContentSpec()->formatSpec(bufFmt); // Step into + + + + inline const ContentSpecNode* SchemaElementDecl::getContentSpec() const + { + if (fComplexTypeInfo != 0) { + return fComplexTypeInfo->getContentSpec(); + } + + return 0; // This line is returned. So , on calling formatSpec the + exception will be thrown + } + + workaround: + + XMLCh* + SchemaElementDecl::formatContentModel() const + { + ... + else + { + + XMLBuffer bufFmt; + const ContentSpecNode* cntSpecNode = getContentSpec(); + if( !cntSpecNode ) + return 0; + + cntSpecNode->formatSpec(bufFmt); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
