You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by bo...@apache.org on 2009/11/05 16:26:54 UTC
svn commit: r833057 - in /xerces/c/trunk: samples/src/DOMCount/
samples/src/DOMPrint/ samples/src/MemParse/ samples/src/PParse/
samples/src/PSVIWriter/ samples/src/SAX2Count/ samples/src/SAX2Print/
samples/src/SAXCount/ samples/src/SAXPrint/ samples/sr...
Author: borisk
Date: Thu Nov 5 15:25:10 2009
New Revision: 833057
URL: http://svn.apache.org/viewvc?rev=833057&view=rev
Log:
Enable multiple import handling in examples and test.
Modified:
xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp
xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
xerces/c/trunk/samples/src/MemParse/MemParse.cpp
xerces/c/trunk/samples/src/PParse/PParse.cpp
xerces/c/trunk/samples/src/PSVIWriter/PSVIWriter.cpp
xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp
xerces/c/trunk/samples/src/SAX2Print/SAX2Print.cpp
xerces/c/trunk/samples/src/SAXCount/SAXCount.cpp
xerces/c/trunk/samples/src/SAXPrint/SAXPrint.cpp
xerces/c/trunk/samples/src/SCMPrint/SCMPrint.cpp
xerces/c/trunk/samples/src/StdInParse/StdInParse.cpp
xerces/c/trunk/samples/src/XInclude/XInclude.cpp
xerces/c/trunk/tests/src/InitTermTest/InitTermTest.cpp
xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp
xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp
xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp
xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp
xerces/c/trunk/tests/src/XSerializerTest/XSerializerTest.cpp
Modified: xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp (original)
+++ xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -90,9 +90,9 @@
char *name = XMLString::transcode(n->getNodeName());
XERCES_STD_QUALIFIER cout <<"----------------------------------------------------------"<<XERCES_STD_QUALIFIER endl;
XERCES_STD_QUALIFIER cout <<"Encountered Element : "<< name << XERCES_STD_QUALIFIER endl;
-
+
XMLString::release(&name);
-
+
if(n->hasAttributes()) {
// get all the attributes of the node
DOMNamedNodeMap *pAttributes = n->getAttributes();
@@ -103,10 +103,10 @@
DOMAttr *pAttributeNode = (DOMAttr*) pAttributes->item(i);
// get attribute name
char *name = XMLString::transcode(pAttributeNode->getName());
-
+
XERCES_STD_QUALIFIER cout << "\t" << name << "=";
XMLString::release(&name);
-
+
// get attribute type
name = XMLString::transcode(pAttributeNode->getValue());
XERCES_STD_QUALIFIER cout << name << XERCES_STD_QUALIFIER endl;
@@ -217,7 +217,7 @@
{
// Get out the end of line
strcpy(localeStr, &(argV[argInd][8]));
- }
+ }
else
{
XERCES_STD_QUALIFIER cerr << "Unknown option '" << argV[argInd]
@@ -268,6 +268,7 @@
config->setParameter(XMLUni::fgDOMNamespaces, doNamespaces);
config->setParameter(XMLUni::fgXercesSchema, doSchema);
+ config->setParameter(XMLUni::fgXercesHandleMultipleImports, true);
config->setParameter(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
if (valScheme == AbstractDOMParser::Val_Auto)
Modified: xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp (original)
+++ xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp Thu Nov 5 15:25:10 2009
@@ -381,6 +381,7 @@
parser->setValidationScheme(gValScheme);
parser->setDoNamespaces(gDoNamespaces);
parser->setDoSchema(gDoSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(gSchemaFullChecking);
parser->setCreateEntityReferenceNodes(gDoCreate);
Modified: xerces/c/trunk/samples/src/MemParse/MemParse.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/MemParse/MemParse.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/MemParse/MemParse.cpp (original)
+++ xerces/c/trunk/samples/src/MemParse/MemParse.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -198,6 +198,7 @@
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(schemaFullChecking);
//
@@ -285,4 +286,3 @@
else
return 0;
}
-
Modified: xerces/c/trunk/samples/src/PParse/PParse.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/PParse/PParse.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/PParse/PParse.cpp (original)
+++ xerces/c/trunk/samples/src/PParse/PParse.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -208,6 +208,7 @@
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(schemaFullChecking);
//
@@ -291,4 +292,3 @@
else
return 0;
}
-
Modified: xerces/c/trunk/samples/src/PSVIWriter/PSVIWriter.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/PSVIWriter/PSVIWriter.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/PSVIWriter/PSVIWriter.cpp (original)
+++ xerces/c/trunk/samples/src/PSVIWriter/PSVIWriter.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -75,20 +75,20 @@
return 1;
}
- static const char* encodingName = "UTF8";
- static XMLFormatter::UnRepFlags unRepFlags = XMLFormatter::UnRep_CharRef;
- const char* xmlFile = 0;
+ static const char* encodingName = "UTF8";
+ static XMLFormatter::UnRepFlags unRepFlags = XMLFormatter::UnRep_CharRef;
+ const char* xmlFile = 0;
bool doList = false; //REVISIT
bool schemaFullChecking = false;
bool errorOccurred = false;
const char* psviOut = 0;
- const char* errorOut = 0;
+ const char* errorOut = 0;
XMLFormatTarget* psviTarget = 0;
XMLFormatTarget* errorTarget = 0;
XMLFormatter* psviFormatter = 0;
XMLFormatter* errorFormatter = 0;
- char fileName[80] ="";
-
+ char fileName[80] ="";
+
int argInd;
for (argInd = 1; argInd < argC; argInd++)
@@ -166,7 +166,7 @@
// Initialize the XML4C2 system
try
- {
+ {
XMLPlatformUtils::Initialize();
} catch (const XMLException& toCatch) {
XERCES_STD_QUALIFIER cerr << "Error during initialization! Message:\n"
@@ -180,11 +180,12 @@
SAX2XMLReaderImpl* parser = new SAX2XMLReaderImpl();
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgXercesSchema, true);
+ parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, false);
- parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
- parser->setFeature(XMLUni::fgXercesDynamic, true);
-
+ parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
+ parser->setFeature(XMLUni::fgXercesDynamic, true);
+
//
// Based on commandline arguments, create XMLFormatters for PSVI output and errors
//
@@ -196,7 +197,7 @@
}
psviFormatter = new XMLFormatter(encodingName, psviTarget, XMLFormatter::NoEscapes, unRepFlags);
}
-
+
if (errorOut==0) {
errorTarget = new StdOutFormatTarget();
} else {
@@ -257,7 +258,7 @@
XMLString::trim((char*)xmlFile);
XERCES_STD_QUALIFIER cerr << "==Parsing== \"" << xmlFile << "\"" << XERCES_STD_QUALIFIER endl;
}
-
+
if (psviOut==0) {
if (psviTarget==0 && psviFormatter==0) {
psviTarget = new StdOutFormatTarget();
@@ -344,4 +345,3 @@
return 0;
}
-
Modified: xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp (original)
+++ xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -161,7 +161,7 @@
{
// Get out the end of line
strncpy(localeStr, &(argV[argInd][8]), sizeof localeStr);
- }
+ }
else
{
XERCES_STD_QUALIFIER cerr << "Unknown option '" << argV[argInd]
@@ -211,6 +211,7 @@
SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, doNamespaces);
parser->setFeature(XMLUni::fgXercesSchema, doSchema);
+ parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
parser->setFeature(XMLUni::fgXercesIdentityConstraintChecking, identityConstraintChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);
@@ -343,4 +344,3 @@
return 0;
}
-
Modified: xerces/c/trunk/samples/src/SAX2Print/SAX2Print.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAX2Print/SAX2Print.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SAX2Print/SAX2Print.cpp (original)
+++ xerces/c/trunk/samples/src/SAX2Print/SAX2Print.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -261,6 +261,7 @@
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, doNamespaces);
parser->setFeature(XMLUni::fgXercesSchema, doSchema);
+ parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);
@@ -283,7 +284,7 @@
catch (const OutOfMemoryException&)
{
XERCES_STD_QUALIFIER cerr << "OutOfMemoryException" << XERCES_STD_QUALIFIER endl;
- errorCode = 5;
+ errorCode = 5;
}
catch (const XMLException& toCatch)
{
@@ -313,4 +314,3 @@
else
return 0;
}
-
Modified: xerces/c/trunk/samples/src/SAXCount/SAXCount.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAXCount/SAXCount.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SAXCount/SAXCount.cpp (original)
+++ xerces/c/trunk/samples/src/SAXCount/SAXCount.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -141,7 +141,7 @@
{
// Get out the end of line
strcpy(localeStr, &(argV[argInd][8]));
- }
+ }
else
{
XERCES_STD_QUALIFIER cerr << "Unknown option '" << argV[argInd]
@@ -193,6 +193,7 @@
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(schemaFullChecking);
//
@@ -313,4 +314,3 @@
return 0;
}
-
Modified: xerces/c/trunk/samples/src/SAXPrint/SAXPrint.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAXPrint/SAXPrint.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SAXPrint/SAXPrint.cpp (original)
+++ xerces/c/trunk/samples/src/SAXPrint/SAXPrint.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -217,6 +217,7 @@
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(schemaFullChecking);
//
@@ -263,4 +264,3 @@
else
return 0;
}
-
Modified: xerces/c/trunk/samples/src/SCMPrint/SCMPrint.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SCMPrint/SCMPrint.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SCMPrint/SCMPrint.cpp (original)
+++ xerces/c/trunk/samples/src/SCMPrint/SCMPrint.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -183,7 +183,7 @@
"This program parses XML Schema file(s), to show how one can\n"
"access the Schema Content Model information.\n\n"
"Options:\n"
- " -f Enable full schema constraint checking processing. Defaults to off.\n"
+ " -f Enable full schema constraint checking processing. Defaults to off.\n"
" -l Indicate the input file is a List File that has a list of XSD files.\n"
" Default to off (Input file is a XSD file).\n"
" -? Show this help.\n\n"
@@ -209,7 +209,7 @@
{
XMLPlatformUtils::Initialize();
}
-
+
catch (const XMLException& toCatch)
{
XERCES_STD_QUALIFIER cerr << "Error during initialization! Message:\n"
@@ -264,23 +264,24 @@
usage();
return 1;
}
-
+
XMLGrammarPool *grammarPool;
SAX2XMLReader* parser;
try
- {
+ {
grammarPool = new XMLGrammarPoolImpl(XMLPlatformUtils::fgMemoryManager);
parser = XMLReaderFactory::createXMLReader(XMLPlatformUtils::fgMemoryManager, grammarPool);
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
parser->setFeature(XMLUni::fgXercesSchema, true);
+ parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, false);
parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
parser->setFeature(XMLUni::fgXercesDynamic, true);
parser->setProperty(XMLUni::fgXercesScannerName, (void *)XMLUni::fgSGXMLScanner);
- SCMPrintHandler handler;
+ SCMPrintHandler handler;
parser->setErrorHandler(&handler);
bool more = true;
@@ -297,7 +298,7 @@
}
while (more)
- {
+ {
char fURI[1000];
//initialize the array to zeros
memset(fURI,0,sizeof(fURI));
@@ -337,10 +338,10 @@
bool updatedXSModel;
XSModel *xsModel = grammarPool->getXSModel(updatedXSModel);
if (xsModel)
- {
+ {
StringList *namespaces = xsModel->getNamespaces();
for (unsigned i = 0; i < namespaces->size(); i++) {
-
+
XERCES_STD_QUALIFIER cout << "Processing Namespace: ";
const XMLCh *nameSpace = namespaces->elementAt(i);
if (nameSpace && *nameSpace)
@@ -351,7 +352,7 @@
nameSpace));
processTypeDefinitions(xsModel->getComponentsByNamespace(XSConstants::TYPE_DEFINITION,
nameSpace));
- }
+ }
}
else
{
@@ -362,7 +363,7 @@
{
XERCES_STD_QUALIFIER cout << "Did not parse a schema document cleanly so not printing Schema for Schema XSModel information";
}
-
+
XERCES_STD_QUALIFIER cout << XERCES_STD_QUALIFIER endl;
}
catch (const OutOfMemoryException&)
@@ -380,13 +381,13 @@
catch (...)
{
XERCES_STD_QUALIFIER cerr << "\nUnexpected exception during parsing: '" << xsdFile << "'\n" << XERCES_STD_QUALIFIER endl;
- errorCode = 5;
+ errorCode = 5;
}
-
+
delete parser;
delete grammarPool;
XMLPlatformUtils::Terminate();
-
+
return errorCode;
}
@@ -406,11 +407,11 @@
if (!xsElements || xsElements->getLength() == 0) {
XERCES_STD_QUALIFIER cout << "no elements\n\n" << XERCES_STD_QUALIFIER endl;
return;
- }
+ }
for (XMLSize_t i=0; i < xsElements->getLength(); i++) {
XSElementDeclaration *xsElement = (XSElementDeclaration *)xsElements->item(i);
printBasic(xsElement, "Element");
-
+
// Content Model
XSTypeDefinition *xsTypeDef = xsElement->getTypeDefinition();
XERCES_STD_QUALIFIER cout << "Content Model" << "\n";
@@ -422,7 +423,7 @@
}
XERCES_STD_QUALIFIER cout << "\tName:\t"
<< StrX(xsTypeDef->getName()) << "\n";
-
+
XERCES_STD_QUALIFIER cout << "\n--------------------------------------------" << XERCES_STD_QUALIFIER endl;
}
}
@@ -431,12 +432,12 @@
{
XSTypeDefinition *xsBaseTypeDef = xsSimpleTypeDef->getBaseType();
XERCES_STD_QUALIFIER cout << "Base:\t\t\t";
- XERCES_STD_QUALIFIER cout << StrX(xsBaseTypeDef->getName()) << XERCES_STD_QUALIFIER endl;
-
+ XERCES_STD_QUALIFIER cout << StrX(xsBaseTypeDef->getName()) << XERCES_STD_QUALIFIER endl;
+
int facets = xsSimpleTypeDef->getDefinedFacets();
if (facets) {
XERCES_STD_QUALIFIER cout << "Facets:\n";
-
+
if (facets & XSSimpleTypeDefinition::FACET_LENGTH)
XERCES_STD_QUALIFIER cout << "\tLength:\t\t" << StrX(xsSimpleTypeDef->getLexicalFacetValue(XSSimpleTypeDefinition::FACET_LENGTH)) << XERCES_STD_QUALIFIER endl;
if (facets & XSSimpleTypeDefinition::FACET_MINLENGTH)
@@ -447,7 +448,7 @@
StringList *lexicalPatterns = xsSimpleTypeDef->getLexicalPattern();
if (lexicalPatterns && lexicalPatterns->size()) {
XERCES_STD_QUALIFIER cout << "\tPattern:\t\t";
- for (unsigned i = 0; i < lexicalPatterns->size(); i++) {
+ for (unsigned i = 0; i < lexicalPatterns->size(); i++) {
XERCES_STD_QUALIFIER cout << StrX(lexicalPatterns->elementAt(i));
}
XERCES_STD_QUALIFIER cout << XERCES_STD_QUALIFIER endl;
@@ -458,7 +459,7 @@
if (facets & XSSimpleTypeDefinition::FACET_MAXINCLUSIVE)
XERCES_STD_QUALIFIER cout << "\tMaxInclusive:\t" << StrX(xsSimpleTypeDef->getLexicalFacetValue(XSSimpleTypeDefinition::FACET_MAXINCLUSIVE)) << XERCES_STD_QUALIFIER endl;
if (facets & XSSimpleTypeDefinition::FACET_MAXEXCLUSIVE)
- XERCES_STD_QUALIFIER cout << "\tMaxExclusive:\t" << StrX(xsSimpleTypeDef->getLexicalFacetValue(XSSimpleTypeDefinition::FACET_MAXEXCLUSIVE)) << XERCES_STD_QUALIFIER endl;
+ XERCES_STD_QUALIFIER cout << "\tMaxExclusive:\t" << StrX(xsSimpleTypeDef->getLexicalFacetValue(XSSimpleTypeDefinition::FACET_MAXEXCLUSIVE)) << XERCES_STD_QUALIFIER endl;
if (facets & XSSimpleTypeDefinition::FACET_MINEXCLUSIVE)
XERCES_STD_QUALIFIER cout << "\tMinExclusive:\t" << StrX(xsSimpleTypeDef->getLexicalFacetValue(XSSimpleTypeDefinition::FACET_MINEXCLUSIVE)) << XERCES_STD_QUALIFIER endl;
if (facets & XSSimpleTypeDefinition::FACET_MININCLUSIVE)
@@ -492,13 +493,13 @@
case XSModelGroup::COMPOSITOR_ALL :
XERCES_STD_QUALIFIER cout << "*";
break;
- }
+ }
}
void processParticle(XSParticle *xsParticle)
{
if (!xsParticle) {
- XERCES_STD_QUALIFIER cout << "xsParticle is NULL";
+ XERCES_STD_QUALIFIER cout << "xsParticle is NULL";
return;
}
XSParticle::TERM_TYPE termType = xsParticle->getTermType();
@@ -507,7 +508,7 @@
XERCES_STD_QUALIFIER cout << StrX(xsElement->getName());
} else if (termType == XSParticle::TERM_MODELGROUP) {
XERCES_STD_QUALIFIER cout << "(";
-
+
XSModelGroup *xsModelGroup = xsParticle->getModelGroupTerm();
XSModelGroup::COMPOSITOR_TYPE compositorType = xsModelGroup->getCompositor();
XSParticleList *xsParticleList = xsModelGroup->getParticles();
@@ -516,7 +517,7 @@
printCompositorTypeConnector(compositorType);
}
processParticle(xsParticleList->elementAt(xsParticleList->size()-1));
-
+
XERCES_STD_QUALIFIER cout << ")";
} else if (termType == XSParticle::TERM_WILDCARD) {
XERCES_STD_QUALIFIER cout << "* (wildcard)";
@@ -530,7 +531,7 @@
XERCES_STD_QUALIFIER cout << "Base:\t\t\t";
XERCES_STD_QUALIFIER cout << StrX(xsBaseTypeDef->getName()) << "\n";
}
-
+
XERCES_STD_QUALIFIER cout << "Content Model:\t";
XSComplexTypeDefinition::CONTENT_TYPE contentType = xsComplexTypeDef->getContentType();
if (contentType == XSComplexTypeDefinition::CONTENTTYPE_ELEMENT ||
@@ -543,12 +544,12 @@
void processTypeDefinitions(XSNamedMap<XSObject> *xsTypeDefs)
{
if (!xsTypeDefs) return;
-
+
for (XMLSize_t i=0; i < xsTypeDefs->getLength(); i++) {
XSTypeDefinition *xsTypeDef = (XSTypeDefinition *)xsTypeDefs->item(i);
-
+
printBasic(xsTypeDef, "Type Definition");
-
+
// Content Model
XERCES_STD_QUALIFIER cout << "Category:\t";
if (xsTypeDef->getTypeCategory() == XSTypeDefinition::SIMPLE_TYPE) {
@@ -558,7 +559,7 @@
XERCES_STD_QUALIFIER cout << "\tComplex\n";
processComplexTypeDefinition((XSComplexTypeDefinition *)xsTypeDef);
}
-
+
XERCES_STD_QUALIFIER cout << "\n--------------------------------------------" << XERCES_STD_QUALIFIER endl;
- }
+ }
}
Modified: xerces/c/trunk/samples/src/StdInParse/StdInParse.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/StdInParse/StdInParse.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/StdInParse/StdInParse.cpp (original)
+++ xerces/c/trunk/samples/src/StdInParse/StdInParse.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -156,6 +156,7 @@
parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(schemaFullChecking);
@@ -224,4 +225,3 @@
else
return 0;
}
-
Modified: xerces/c/trunk/samples/src/XInclude/XInclude.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/XInclude/XInclude.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/XInclude/XInclude.cpp (original)
+++ xerces/c/trunk/samples/src/XInclude/XInclude.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,13 +28,13 @@
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/XMLString.hpp>
-
+
#include "XInclude.hpp"
// ---------------------------------------------------------------------------
// This is a simple program which tests the different XInclude mechanisms prototyped
-// for my dissertation. Based largely on the DOMCount example provided with the
-// Xerces C++ project.
+// for my dissertation. Based largely on the DOMCount example provided with the
+// Xerces C++ project.
// Simon Rowland 2006
// ---------------------------------------------------------------------------
static void usage()
@@ -96,12 +96,13 @@
config->setParameter(XMLUni::fgDOMNamespaces, true);
config->setParameter(XMLUni::fgXercesSchema, true);
+ config->setParameter(XMLUni::fgXercesHandleMultipleImports, true);
config->setParameter(XMLUni::fgXercesSchemaFullChecking, true);
- if(config->canSetParameter(XMLUni::fgXercesDoXInclude, true)){
- config->setParameter(XMLUni::fgXercesDoXInclude, true);
- }
-
+ if(config->canSetParameter(XMLUni::fgXercesDoXInclude, true)){
+ config->setParameter(XMLUni::fgXercesDoXInclude, true);
+ }
+
// enable datatype normalization - default is off
//config->setParameter(XMLUni::fgDOMDatatypeNormalization, true);
@@ -191,7 +192,7 @@
}
XIncludeErrorHandler::XIncludeErrorHandler() :
- fSawErrors(false)
+ fSawErrors(false)
{
}
@@ -231,4 +232,3 @@
{
fSawErrors = false;
}
-
Modified: xerces/c/trunk/tests/src/InitTermTest/InitTermTest.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/InitTermTest/InitTermTest.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/InitTermTest/InitTermTest.cpp (original)
+++ xerces/c/trunk/tests/src/InitTermTest/InitTermTest.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -183,6 +183,7 @@
XercesDOMParser* parser = new XercesDOMParser;
parser->setDoNamespaces(gDoNamespaces);
parser->setDoSchema(gDoSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(gSchemaFullChecking);
TESTINITPOST;
}
@@ -196,6 +197,7 @@
SAXParser* parser = new SAXParser;
parser->setDoNamespaces(gDoNamespaces);
parser->setDoSchema(gDoSchema);
+ parser->setHandleMultipleImports (true);
parser->setValidationSchemaFullChecking(gSchemaFullChecking);
TESTINITPOST;
}
@@ -214,11 +216,15 @@
XMLCh* doSchemaFeature = XMLString::transcode("http://apache.org/xml/features/validation/schema");
parser->setFeature(doSchemaFeature, gDoSchema);
+ XMLCh* handleMultipleImportsFeature = XMLString::transcode("http://apache.org/xml/features/validation/schema/handle-multiple-imports");
+ parser->setFeature(handleMultipleImportsFeature, true);
+
XMLCh* fullSchemaCheckFeature = XMLString::transcode("http://apache.org/xml/features/validation/schema-full-checking");
parser->setFeature(fullSchemaCheckFeature, gSchemaFullChecking);
XMLString::release(&doNamespaceFeature);
XMLString::release(&doSchemaFeature);
+ XMLString::release(&handleMultipleImportsFeature);
XMLString::release(&fullSchemaCheckFeature);
TESTINITPOST;
Modified: xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp (original)
+++ xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp Thu Nov 5 15:25:10 2009
@@ -287,6 +287,10 @@
sax2parser->setFeature(XMLUni::fgXercesSchema, doSchema);
saxParser->setDoSchema(doSchema);
+ domBuilder->getDomConfig()->setParameter(XMLUni::fgXercesHandleMultipleImports, true);
+ sax2parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
+ saxParser->setHandleMultipleImports (true);
+
domBuilder->getDomConfig()->setParameter(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
sax2parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
saxParser->setValidationSchemaFullChecking(schemaFullChecking);
@@ -436,4 +440,3 @@
delete staticMemMonitor;
return 0;
}
-
Modified: xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp (original)
+++ xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -216,21 +216,21 @@
//------------------------------------------------------------------------------
const int MAXINFILES = 25;
struct RunInfo
-{
- bool doGrammarCaching;
+{
+ bool doGrammarCaching;
bool quiet;
bool verbose;
- bool stopNow;
- bool dom;
- bool sax;
+ bool stopNow;
+ bool dom;
+ bool sax;
bool reuseParser;
bool inMemory;
bool dumpOnErr;
bool doSchema;
bool schemaFullChecking;
bool doNamespaces;
- bool doInitialParse;
- bool doNamespacePrefixes; // SAX2
+ bool doInitialParse;
+ bool doNamespacePrefixes; // SAX2
SAXParser::ValSchemes valScheme;
int numThreads;
int totalTime;
@@ -325,7 +325,7 @@
SAXHandler* fSAXHandler;
SAX2Handler* fSAX2Handler;
ErrorHandler* fDOMErrorHandler;
-
+
// This is the API used by the rest of the test program
ThreadParser();
~ThreadParser();
@@ -346,17 +346,17 @@
void domPrint(); // including any children. Default (no param)
// version dumps the entire document.
void addToCheckSum(const XMLCh *chars, XMLSize_t len=(XMLSize_t)-1);
-
+
// These are the SAX call-back functions that this class implements. Can be used
// for SAX and SAX2.
void characters(const XMLCh* const chars, const XMLSize_t length) {
addToCheckSum(chars, length);
}
-
+
void ignorableWhitespace(const XMLCh* const chars, const XMLSize_t length) {
addToCheckSum(chars, length);
}
-
+
void resetDocument() {
}
@@ -420,13 +420,13 @@
// to create parsers.
//
ThreadParser::ThreadParser()
-{
+{
fSAXParser = 0;
fSAX2Parser = 0;
fXercesDOMParser = 0;
fSAXHandler = 0;
fSAX2Handler = 0;
- fDOMErrorHandler = 0;
+ fDOMErrorHandler = 0;
fDoc = 0;
fCheckSum = 0;
@@ -437,7 +437,7 @@
fXercesDOMParser = new XercesDOMParser(0, XMLPlatformUtils::fgMemoryManager, gp);
fXercesDOMParser->cacheGrammarFromParse(true);
fXercesDOMParser->useCachedGrammarInParse(true);
- }
+ }
else {
fXercesDOMParser = new XercesDOMParser;
}
@@ -451,8 +451,9 @@
default: //SAXParser::Val_Always:
fXercesDOMParser->setValidationScheme(XercesDOMParser::Val_Always);
break;
- }
+ }
fXercesDOMParser->setDoSchema(gRunInfo.doSchema);
+ fXercesDOMParser->setHandleMultipleImports (true);
fXercesDOMParser->setValidationSchemaFullChecking(gRunInfo.schemaFullChecking);
fXercesDOMParser->setDoNamespaces(gRunInfo.doNamespaces);
fDOMErrorHandler = (ErrorHandler*) new HandlerBase();
@@ -466,12 +467,13 @@
fSAXParser = new SAXParser(0, XMLPlatformUtils::fgMemoryManager, gp);
fSAXParser->cacheGrammarFromParse(true);
fSAXParser->useCachedGrammarInParse(true);
- }
+ }
else {
fSAXParser = new SAXParser();
}
fSAXParser->setValidationScheme(gRunInfo.valScheme);
fSAXParser->setDoSchema(gRunInfo.doSchema);
+ fSAXParser->setHandleMultipleImports (true);
fSAXParser->setValidationSchemaFullChecking(gRunInfo.schemaFullChecking);
fSAXParser->setDoNamespaces(gRunInfo.doNamespaces);
fSAXHandler = new ThreadParser::SAXHandler();
@@ -480,10 +482,10 @@
fSAXParser->setErrorHandler(fSAXHandler);
}
- else {
+ else {
// Set up to use a SAX2 parser.
/** Grammar caching thread testing */
- if (gp) {
+ if (gp) {
fSAX2Parser = XMLReaderFactory::createXMLReader(gpMemMgr, gp);
fSAX2Parser->setFeature(XMLUni::fgXercesCacheGrammarFromParse,true);
fSAX2Parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse,true);
@@ -494,6 +496,7 @@
fSAX2Parser->setFeature(XMLUni::fgSAX2CoreNameSpaces,(gRunInfo.doNamespaces));
fSAX2Parser->setFeature(XMLUni::fgXercesSchema,(gRunInfo.doSchema));
+ fSAX2Parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
fSAX2Parser->setFeature(XMLUni::fgXercesSchemaFullChecking,(gRunInfo.schemaFullChecking));
switch (gRunInfo.valScheme) {
@@ -508,9 +511,9 @@
fSAX2Parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
fSAX2Parser->setFeature(XMLUni::fgXercesDynamic, false);
break;
- }
-
- fSAX2Parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes,(gRunInfo.doNamespacePrefixes));
+ }
+
+ fSAX2Parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes,(gRunInfo.doNamespacePrefixes));
fSAX2Handler = new ThreadParser::SAX2Handler();
fSAX2Handler->SAX2Instance = this;
fSAX2Parser->setContentHandler(fSAX2Handler);
@@ -520,11 +523,11 @@
ThreadParser::~ThreadParser()
{
- delete fSAXParser;
+ delete fSAXParser;
delete fSAX2Parser;
delete fXercesDOMParser;
delete fSAXHandler;
- delete fSAX2Handler;
+ delete fSAX2Handler;
delete fDOMErrorHandler;
}
@@ -578,7 +581,7 @@
}
catch (const OutOfMemoryException&)
{
- fprintf(stderr, " during parsing: %s\n OutOfMemoryException.\n", fInfo->fileName);
+ fprintf(stderr, " during parsing: %s\n OutOfMemoryException.\n", fInfo->fileName);
errors = true;
}
catch (const XMLException& e)
@@ -812,12 +815,12 @@
void parseCommandLine(int argc, char **argv)
{
- gRunInfo.doGrammarCaching = false;
+ gRunInfo.doGrammarCaching = false;
gRunInfo.quiet = false; // Set up defaults for run.
gRunInfo.verbose = false;
- gRunInfo.stopNow = false;
+ gRunInfo.stopNow = false;
gRunInfo.dom = false;
- gRunInfo.sax = true;
+ gRunInfo.sax = true;
gRunInfo.reuseParser = false;
gRunInfo.inMemory = false;
gRunInfo.dumpOnErr = false;
@@ -825,8 +828,8 @@
gRunInfo.schemaFullChecking = false;
gRunInfo.doNamespaces = false;
gRunInfo.doInitialParse = false;
- gRunInfo.doNamespacePrefixes = false;
-
+ gRunInfo.doNamespacePrefixes = false;
+
gRunInfo.valScheme = SAXParser::Val_Auto;
gRunInfo.numThreads = 2;
gRunInfo.totalTime = 0;
@@ -850,7 +853,7 @@
else if (!strcmp(parm, "always"))
gRunInfo.valScheme = SAXParser::Val_Always;
else {
- fprintf(stderr, "Unrecognized -v option \"%s\"\n", parm);
+ fprintf(stderr, "Unrecognized -v option \"%s\"\n", parm);
throw 1;
}
}
@@ -864,25 +867,25 @@
else if (strcmp(argv[argnum], "-f") == 0)
gRunInfo.schemaFullChecking = true;
else if (strcmp(argv[argnum], "-n") == 0)
- gRunInfo.doNamespaces = true;
+ gRunInfo.doNamespaces = true;
else if (strcmp(argv[argnum], "-p") == 0)
- gRunInfo.doNamespacePrefixes = true;
+ gRunInfo.doNamespacePrefixes = true;
else if (!strncmp(argv[argnum], "-parser=", 8)) {
- const char* const parm = &argv[argnum][8];
+ const char* const parm = &argv[argnum][8];
if (!strcmp(parm, "dom")) {
gRunInfo.dom = true;
gRunInfo.sax = false;
}
else if (!strcmp(parm, "sax")) {
gRunInfo.dom = false;
- gRunInfo.sax = true;
+ gRunInfo.sax = true;
}
else if (!strcmp(parm, "sax2")) {
gRunInfo.dom = false;
gRunInfo.sax = false;
- }
+ }
else {
- fprintf(stderr, "Unrecognized -parser option \"%s\"\n", parm);
+ fprintf(stderr, "Unrecognized -parser option \"%s\"\n", parm);
throw 1;
}
}
@@ -917,9 +920,9 @@
fprintf(stderr, "Invalid -time option (time value < 1)\n");
throw 1;
}
- }
+ }
else if (strcmp(argv[argnum], "-gc") == 0)
- gRunInfo.doGrammarCaching = true;
+ gRunInfo.doGrammarCaching = true;
else if (strcmp(argv[argnum], "-parses") == 0) {
++argnum;
if (argnum >= argc) {
@@ -962,7 +965,7 @@
}
catch (int)
{
- fprintf(stderr, "usage: ThreadTest [-v] [-threads nnn] [-time nnn] [-quiet] [-verbose] xmlfile...\n"
+ fprintf(stderr, "usage: ThreadTest [-v] [-threads nnn] [-time nnn] [-quiet] [-verbose] xmlfile...\n"
" -v=xxx Validation scheme [always | never | auto]. Default is AUTO.\n"
" -n Enable namespace processing. Defaults to off.\n"
" -s Enable schema processing. Defaults to off.\n"
@@ -1092,7 +1095,7 @@
printf("Thread #%d: parse %d starting file %s\n", thInfo->fThreadNum, thInfo->fParses, fInfo->fileName);
int checkSum = 0;
-
+
checkSum = thParser->parse(docNum);
// For the case where we skip the preparse we will have nothing to
@@ -1113,10 +1116,10 @@
double totalParsesCompleted = 0;
for (int threadNum=0; threadNum < gRunInfo.numThreads; threadNum++) {
- totalParsesCompleted += gThreadInfo[threadNum].fParses;
+ totalParsesCompleted += gThreadInfo[threadNum].fParses;
}
fprintf(stderr, "Total number of parses completed is %f.\n", totalParsesCompleted);
-
+
// Revisit - let the loop continue to run?
int secondTryCheckSum = thParser->reCheck();
fprintf(stderr, " Retry checksum is %x\n", secondTryCheckSum);
@@ -1139,7 +1142,7 @@
thInfo->fInProgress = false;
}
else {
- ThreadFuncs::Sleep(1000);
+ ThreadFuncs::Sleep(1000);
}
}
delete thParser;
@@ -1182,12 +1185,12 @@
// Initialize memory manger and grammar pool
// set doInitialParse to true so that the first parse will cache the
// grammar and it'll be used in subsequent parses
-
+
if (gRunInfo.doSchema == true && gRunInfo.doNamespaces == true && gRunInfo.doGrammarCaching == true) {
gpMemMgr = new MemoryManagerImpl();
gp = new XMLGrammarPoolImpl(gpMemMgr);
gRunInfo.doInitialParse = true;
- }
+ }
//
// If we will be parsing from memory, read each of the input files
@@ -1263,20 +1266,20 @@
gThreadInfo[threadNum].fThreadNum = threadNum;
ThreadFuncs::startThread(threadMain, &gThreadInfo[threadNum]);
}
-
+
if (gRunInfo.numParses)
{
bool notDone;
while (true)
{
- ThreadFuncs::Sleep(1000);
+ ThreadFuncs::Sleep(1000);
notDone = false;
-
+
for (threadNum = 0; threadNum < gRunInfo.numThreads; threadNum++) {
- if (gThreadInfo[threadNum].fParses < gRunInfo.numParses)
+ if (gThreadInfo[threadNum].fParses < gRunInfo.numParses)
notDone = true;
}
- if (notDone == false) {
+ if (notDone == false) {
break;
}
}
@@ -1294,7 +1297,7 @@
while (gRunInfo.totalTime == 0 || gRunInfo.totalTime > elapsedSeconds) {
ThreadFuncs::Sleep(1000);
if (gRunInfo.quiet == false && gRunInfo.verbose == false) {
- char c = '+';
+ char c = '+';
for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++) {
if (gThreadInfo[threadNum].fHeartBeat == false) {
c = '.';
@@ -1347,11 +1350,11 @@
printf("\n%8.2f parses per minute.\n", parsesPerMinute);
}
}
-
+
// delete grammar pool and memory manager
if (gp) {
- delete gp;
- delete gpMemMgr;
+ delete gp;
+ delete gpMemMgr;
}
XMLPlatformUtils::Terminate();
@@ -1364,5 +1367,3 @@
return 0;
}
-
-
Modified: xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@
#include <xercesc/framework/MemBufInputSource.hpp>
static XMLCh sz_XMLTestSuiteRoot[]={ chLatin_T, chLatin_E, chLatin_S, chLatin_T, chLatin_S, chLatin_U, chLatin_I, chLatin_T, chLatin_E, chNull };
-const XMLCh dummy[]={ chLatin_f, chLatin_i, chLatin_l, chLatin_e, chColon, chForwardSlash, chForwardSlash,
+const XMLCh dummy[]={ chLatin_f, chLatin_i, chLatin_l, chLatin_e, chColon, chForwardSlash, chForwardSlash,
chLatin_d, chLatin_u, chLatin_m, chLatin_m, chLatin_y, chForwardSlash, chNull };
@@ -49,7 +49,7 @@
// ---------------------------------------------------------------------------
void usage()
{
- XERCES_STD_QUALIFIER cout <<
+ XERCES_STD_QUALIFIER cout <<
"\n"
"Usage:\n"
" XSTSHarness <testSet>\n"
@@ -136,17 +136,17 @@
/////////////////////////////////////////////////////////////////////
void BaseErrorHandler::error(const SAXParseException& exc)
-{
- fSawErrors=true;
- fErrorText.append(exc.getMessage());
- fErrorText.append(chLF);
+{
+ fSawErrors=true;
+ fErrorText.append(exc.getMessage());
+ fErrorText.append(chLF);
}
void BaseErrorHandler::fatalError(const SAXParseException& exc)
-{
- fSawErrors=true;
- fErrorText.append(exc.getMessage());
- fErrorText.append(chLF);
+{
+ fSawErrors=true;
+ fErrorText.append(exc.getMessage());
+ fErrorText.append(chLF);
}
/////////////////////////////////////////////////////////////////////
@@ -260,7 +260,7 @@
usage();
return 2;
}
- // TODO: add option to generate the XML summarizing the result
+ // TODO: add option to generate the XML summarizing the result
else if (!strncmp(argV[argInd], "-v=", 3)
|| !strncmp(argV[argInd], "-V=", 3))
{
@@ -295,7 +295,7 @@
}
//
- // Create a SAX parser object.
+ // Create a SAX parser object.
//
SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
@@ -325,7 +325,7 @@
}
else
{
- // XMLSchema Test Suite
+ // XMLSchema Test Suite
handler=new XSTSHarnessHandlers(uri);
}
XMLString::release(&uniFile);
@@ -394,4 +394,3 @@
return 0;
}
-
Modified: xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,6 +40,7 @@
fParser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, true);
fParser->setFeature(XMLUni::fgSAX2CoreValidation, true);
fParser->setFeature(XMLUni::fgXercesSchema, true);
+ fParser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
fParser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
fParser->setFeature(XMLUni::fgXercesDynamic, false);
fParser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
@@ -53,25 +54,25 @@
delete fParser;
}
-static XMLCh urlW3C[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
+static XMLCh urlW3C[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
- chLatin_X, chLatin_M, chLatin_L, chForwardSlash,
+ chLatin_X, chLatin_M, chLatin_L, chForwardSlash,
chLatin_S, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chNull };
static XMLCh szTestSuite[]={ chLatin_T, chLatin_e, chLatin_s, chLatin_t, chLatin_S, chLatin_u, chLatin_i, chLatin_t, chLatin_e, chNull };
static XMLCh szTestGroup[]={ chLatin_t, chLatin_e, chLatin_s, chLatin_t, chLatin_G, chLatin_r, chLatin_o, chLatin_u, chLatin_p, chNull };
static XMLCh szSchemaTest[]={ chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_T, chLatin_e, chLatin_s, chLatin_t, chNull };
static XMLCh szInstanceTest[]={ chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_c, chLatin_e, chLatin_T, chLatin_e, chLatin_s, chLatin_t, chNull };
-static XMLCh szDocumentationReference[]={ chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
+static XMLCh szDocumentationReference[]={ chLatin_d, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
chLatin_R, chLatin_e, chLatin_f, chLatin_e, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_e, chNull };
static XMLCh szSchemaDocument[]={ chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_D, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull };
static XMLCh szInstanceDocument[]={ chLatin_i, chLatin_n, chLatin_s, chLatin_t, chLatin_a, chLatin_n, chLatin_c, chLatin_e, chLatin_D, chLatin_o, chLatin_c, chLatin_u, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chNull };
static XMLCh szExpected[]={ chLatin_e, chLatin_x, chLatin_p, chLatin_e, chLatin_c, chLatin_t, chLatin_e, chLatin_d, chNull };
static XMLCh szValidity[]={ chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chLatin_i, chLatin_t, chLatin_y, chNull };
-static XMLCh szXLINK[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
+static XMLCh szXLINK[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
- chDigit_1, chDigit_9, chDigit_9, chDigit_9, chForwardSlash,
+ chDigit_1, chDigit_9, chDigit_9, chDigit_9, chForwardSlash,
chLatin_x, chLatin_l, chLatin_i, chLatin_n, chLatin_k, chNull };
static XMLCh szHREF[]={ chLatin_h, chLatin_r, chLatin_e, chLatin_f, chNull };
static XMLCh szNAME[]={ chLatin_n, chLatin_a, chLatin_m, chLatin_e, chNull };
@@ -79,11 +80,11 @@
static XMLCh szINVALID[]={ chLatin_i, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, chNull };
-static XMLCh szTestSuite2[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
+static XMLCh szTestSuite2[]={ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
- chLatin_X, chLatin_M, chLatin_L, chForwardSlash,
+ chLatin_X, chLatin_M, chLatin_L, chForwardSlash,
chDigit_2, chDigit_0, chDigit_0, chDigit_4, chForwardSlash,
- chLatin_x, chLatin_m, chLatin_l, chDash, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash,
+ chLatin_x, chLatin_m, chLatin_l, chDash, chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash,
chLatin_t, chLatin_e, chLatin_s, chLatin_t, chDash, chLatin_s, chLatin_u, chLatin_i, chLatin_t, chLatin_e, chForwardSlash, chNull };
static XMLCh szTestSetRef[]={ chLatin_t, chLatin_e, chLatin_s, chLatin_t, chLatin_S, chLatin_e, chLatin_t, chLatin_R, chLatin_e, chLatin_f, chNull };
@@ -138,7 +139,7 @@
XMLString::equals(groupName,"particlesZ036_b1") ||
XMLString::equals(groupName,"particlesZ036_b2") ||
XMLString::equals(groupName,"particlesZ036_c") ||
- XMLString::equals(groupName,"wildG032")
+ XMLString::equals(groupName,"wildG032")
)
fCurrentTest.fSkipped=true;
else
Modified: xerces/c/trunk/tests/src/XSerializerTest/XSerializerTest.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSerializerTest/XSerializerTest.cpp?rev=833057&r1=833056&r2=833057&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSerializerTest/XSerializerTest.cpp (original)
+++ xerces/c/trunk/tests/src/XSerializerTest/XSerializerTest.cpp Thu Nov 5 15:25:10 2009
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,33 +64,33 @@
*
* Whenever a file is served, it does the following:
*
-* . parses the file
+* . parses the file
* . caches the grammar without issuing any error message with regards to the parsing
* . serializes(store) the grammar cached to a BinOutputStream
* . deserialize(load) the grammar from the BinInputStream
-* . parses the instance document a second time
+* . parses the instance document a second time
* . validates the instance against the deserialized grammar if validation is on.
*
***/
#include <stdio.h>
-static
+static
void parseCase(const char* const xmlFile);
-static
+static
bool parseOne(BinOutputStream* outStream
, const char* const xmlFile);
-static
+static
void parseTwo(BinInputStream* inStream
, const char* const xmlFile);
-static
+static
void parseFile(SAX2XMLReader* const parser
, const char* const xmlFile);
-static
+static
SAX2XMLReader* getParser(XMLGrammarPool* const theGramPool
, bool setHandler);
@@ -202,7 +202,7 @@
{
// Get out the end of line
strcpy(localeStr, &(argV[argInd][8]));
- }
+ }
else
{
XERCES_STD_QUALIFIER cerr << "Unknown option '" << argV[argInd]
@@ -306,7 +306,7 @@
// Serialization/Deserialization
// ---------------------------------------------------------------------------
static const int BufSize = 1024;
-
+
static void parseCase(const char* const xmlFile)
{
//
@@ -333,7 +333,7 @@
}
-static
+static
bool parseOne(BinOutputStream* outStream
, const char* const xmlFile)
{
@@ -385,7 +385,7 @@
return retVal;
}
-static
+static
void parseTwo(BinInputStream* inStream
, const char* const xmlFile)
{
@@ -439,6 +439,7 @@
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, doNamespaces);
parser->setFeature(XMLUni::fgXercesSchema, doSchema);
+ parser->setFeature(XMLUni::fgXercesHandleMultipleImports, true);
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, schemaFullChecking);
parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);
@@ -516,4 +517,3 @@
errorOccurred = true;
}
-
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org