You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2007/03/02 09:55:53 UTC
svn commit: r513661 [1/4] - in /xerces/c/trunk: samples/src/XInclude/
src/xercesc/NLS/EN_US/ src/xercesc/dom/impl/ src/xercesc/framework/
src/xercesc/parsers/ src/xercesc/util/
src/xercesc/util/MsgLoaders/ICU/resources/
src/xercesc/util/MsgLoaders/InMe...
Author: amassari
Date: Fri Mar 2 00:55:51 2007
New Revision: 513661
URL: http://svn.apache.org/viewvc?view=rev&rev=513661
Log:
Initial commit of XInclude support (by Simon Rowland)
Added:
xerces/c/trunk/samples/src/XInclude/
xerces/c/trunk/samples/src/XInclude/XInclude.cpp (with props)
xerces/c/trunk/samples/src/XInclude/XInclude.hpp
xerces/c/trunk/src/xercesc/xinclude/
xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp (with props)
xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp
xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.cpp (with props)
xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp
xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.cpp (with props)
xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp
Modified:
xerces/c/trunk/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml
xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp
xerces/c/trunk/src/xercesc/framework/XMLErrorCodes.hpp
xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp
xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt
xerces/c/trunk/src/xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp
xerces/c/trunk/src/xercesc/util/MsgLoaders/MsgCatalog/XercesMessages_en_US.Msg
xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Version.rc
xerces/c/trunk/src/xercesc/util/XMLUni.cpp
xerces/c/trunk/src/xercesc/util/XMLUni.hpp
xerces/c/trunk/src/xercesc/util/XercesDefs.hpp
Added: xerces/c/trunk/samples/src/XInclude/XInclude.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/XInclude/XInclude.cpp?view=auto&rev=513661
==============================================================================
--- xerces/c/trunk/samples/src/XInclude/XInclude.cpp (added)
+++ xerces/c/trunk/samples/src/XInclude/XInclude.cpp Fri Mar 2 00:55:51 2007
@@ -0,0 +1,230 @@
+/*
+ * Copyright 1999-2002,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $$
+ */
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+#include <xercesc/util/PlatformUtils.hpp>
+#include <xercesc/parsers/AbstractDOMParser.hpp>
+#include <xercesc/framework/LocalFileFormatTarget.hpp>
+#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.
+// Simon Rowland 2006
+// ---------------------------------------------------------------------------
+static void usage()
+{
+ XERCES_STD_QUALIFIER cout << "\nUsage:\n"
+ " XInclude [-h] InputFile OutputFile\n"
+ " -h : Prints this help message and exits.\n"
+ << XERCES_STD_QUALIFIER endl;
+}
+
+// ---------------------------------------------------------------------------
+//
+// main
+//
+// ---------------------------------------------------------------------------
+int main(int argC, char* argV[])
+{
+ char *testFileName;
+ char *outputFileName;
+
+ for (int argInd = 1; argInd < argC; argInd++)
+ {
+ if (!strcmp(argV[argInd], "-?") || !strcmp(argV[argInd], "-h"))
+ {
+ /* print help and exit */
+ usage();
+ return 2;
+ }
+ }
+
+ if (argC < 3){
+ usage();
+ return 2;
+ }
+
+ testFileName = argV[argC-2];
+ outputFileName = argV[argC-1];
+
+ // Initialize the XML4C system
+ try
+ {
+ XMLPlatformUtils::Initialize();
+ }
+
+ catch (const XMLException& toCatch)
+ {
+ XERCES_STD_QUALIFIER cerr << "Error during initialization! :\n"
+ << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
+ return 1;
+ }
+
+ //============================================================================
+ // Instantiate the DOM parser to use for the source documents
+ //============================================================================
+ static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
+ DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(gLS);
+ DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0);
+ DOMConfiguration *config = parser->getDomConfig();
+
+ config->setParameter(XMLUni::fgDOMNamespaces, true);
+ config->setParameter(XMLUni::fgXercesSchema, true);
+ config->setParameter(XMLUni::fgXercesSchemaFullChecking, true);
+
+ if(config->canSetParameter(XMLUni::fgXercesDoXInclude, true)){
+ config->setParameter(XMLUni::fgXercesDoXInclude, true);
+ }
+
+ // enable datatype normalization - default is off
+ //config->setParameter(XMLUni::fgDOMDatatypeNormalization, true);
+
+ // And create our error handler and install it
+ XIncludeErrorHandler errorHandler;
+ config->setParameter(XMLUni::fgDOMErrorHandler, &errorHandler);
+
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = 0;
+
+ try
+ {
+ // load up the test source document
+ XERCES_STD_QUALIFIER cerr << "Parse " << testFileName << " in progress ...";
+ parser->resetDocumentPool();
+ doc = parser->parseURI(testFileName);
+ XERCES_STD_QUALIFIER cerr << " finished." << XERCES_STD_QUALIFIER endl;
+ }
+ catch (const XMLException& toCatch)
+ {
+ XERCES_STD_QUALIFIER cerr << "\nError during parsing: '" << testFileName << "'\n"
+ << "Exception message is: \n"
+ << StrX(toCatch.getMessage()) << "\n" << XERCES_STD_QUALIFIER endl;
+ }
+ catch (const DOMException& toCatch)
+ {
+ const unsigned int maxChars = 2047;
+ XMLCh errText[maxChars + 1];
+
+ XERCES_STD_QUALIFIER cerr << "\nDOM Error during parsing: '" << testFileName << "'\n"
+ << "DOMException code is: " << toCatch.code << XERCES_STD_QUALIFIER endl;
+
+ if (DOMImplementation::loadDOMExceptionMsg(toCatch.code, errText, maxChars))
+ XERCES_STD_QUALIFIER cerr << "Message is: " << StrX(errText) << XERCES_STD_QUALIFIER endl;
+
+ }
+ catch (...)
+ {
+ XERCES_STD_QUALIFIER cerr << "\nUnexpected exception during parsing: '" << testFileName << "'\n";
+ }
+
+ if (doc) {
+ DOMLSSerializer *writer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ DOMLSOutput *theOutputDesc = ((DOMImplementationLS*)impl)->createLSOutput();
+
+ try {
+ // write out the results
+ XERCES_STD_QUALIFIER cerr << "Writing result to: " << outputFileName << XERCES_STD_QUALIFIER endl;
+
+ XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(outputFileName);
+ theOutputDesc->setByteStream(myFormTarget);
+ writer->write(doc, theOutputDesc);
+ delete myFormTarget;
+ }
+ catch (const XMLException& toCatch)
+ {
+ XERCES_STD_QUALIFIER cerr << "\nXMLException during writing: '" << testFileName << "'\n"
+ << "Exception message is: \n"
+ << StrX(toCatch.getMessage()) << "\n" << XERCES_STD_QUALIFIER endl;
+ }
+ catch (const DOMException& toCatch)
+ {
+ const unsigned int maxChars = 2047;
+ XMLCh errText[maxChars + 1];
+
+ XERCES_STD_QUALIFIER cerr << "\nDOM Error during writing: '" << testFileName << "'\n"
+ << "DOMException code is: " << toCatch.code << XERCES_STD_QUALIFIER endl;
+
+ if (DOMImplementation::loadDOMExceptionMsg(toCatch.code, errText, maxChars))
+ XERCES_STD_QUALIFIER cerr << "Message is: " << StrX(errText) << XERCES_STD_QUALIFIER endl;
+ }
+ catch (...)
+ {
+ XERCES_STD_QUALIFIER cerr << "\nUnexpected exception during writing: '" << testFileName << "'\n";
+ }
+ writer->release();
+ theOutputDesc->release();
+ }
+
+ //
+ // Delete the parser itself. Must be done prior to calling Terminate, below.
+ //
+ parser->release();
+ // And call the termination method
+ XMLPlatformUtils::Terminate();
+
+ return 0;
+}
+
+XIncludeErrorHandler::XIncludeErrorHandler() :
+ fSawErrors(false)
+{
+}
+
+XIncludeErrorHandler::~XIncludeErrorHandler()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+// XIncludeHandlers: Overrides of the DOM ErrorHandler interface
+// ---------------------------------------------------------------------------
+bool XIncludeErrorHandler::handleError(const DOMError& domError)
+{
+ bool continueParsing = true;
+ fSawErrors = true;
+ if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
+ XERCES_STD_QUALIFIER cerr << "\nWarning at file ";
+ else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
+ XERCES_STD_QUALIFIER cerr << "\nError at file ";
+ else {
+ XERCES_STD_QUALIFIER cerr << "\nFatal Error at file ";
+ continueParsing = false;
+ }
+
+ XERCES_STD_QUALIFIER cerr << StrX(domError.getLocation()->getURI())
+ << ", line " << domError.getLocation()->getLineNumber()
+ << ", char " << domError.getLocation()->getColumnNumber()
+ << "\n Message: " << StrX(domError.getMessage()) << XERCES_STD_QUALIFIER endl;
+
+ return continueParsing;
+}
+
+void XIncludeErrorHandler::resetErrors()
+{
+ fSawErrors = false;
+}
+
Propchange: xerces/c/trunk/samples/src/XInclude/XInclude.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/samples/src/XInclude/XInclude.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xerces/c/trunk/samples/src/XInclude/XInclude.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/XInclude/XInclude.hpp?view=auto&rev=513661
==============================================================================
--- xerces/c/trunk/samples/src/XInclude/XInclude.hpp (added)
+++ xerces/c/trunk/samples/src/XInclude/XInclude.hpp Fri Mar 2 00:55:51 2007
@@ -0,0 +1,130 @@
+/*
+ * Copyright 1999-2000,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $$
+ */
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+#include <xercesc/dom/DOMErrorHandler.hpp>
+#include <xercesc/util/XMLString.hpp>
+
+#if defined(XERCES_NEW_IOSTREAMS)
+#include <iostream>
+#else
+#include <iostream.h>
+#endif
+
+XERCES_CPP_NAMESPACE_USE
+
+// ---------------------------------------------------------------------------
+// Simple error handler deriviative to install on parser
+// ---------------------------------------------------------------------------
+class XIncludeErrorHandler : public DOMErrorHandler
+{
+public:
+ // -----------------------------------------------------------------------
+ // Constructors and Destructor
+ // -----------------------------------------------------------------------
+ XIncludeErrorHandler();
+ ~XIncludeErrorHandler();
+
+
+ // -----------------------------------------------------------------------
+ // Getter methods
+ // -----------------------------------------------------------------------
+ bool getSawErrors() const;
+
+
+ // -----------------------------------------------------------------------
+ // Implementation of the DOM ErrorHandler interface
+ // -----------------------------------------------------------------------
+ bool handleError(const DOMError& domError);
+ void resetErrors();
+
+
+private :
+ // -----------------------------------------------------------------------
+ // Unimplemented constructors and operators
+ // -----------------------------------------------------------------------
+ XIncludeErrorHandler(const XIncludeErrorHandler&);
+ void operator=(const XIncludeErrorHandler&);
+
+
+ // -----------------------------------------------------------------------
+ // Private data members
+ //
+ // fSawErrors
+ // This is set if we get any errors, and is queryable via a getter
+ // method. Its used by the main code to suppress output if there are
+ // errors.
+ // -----------------------------------------------------------------------
+ bool fSawErrors;
+};
+
+
+// ---------------------------------------------------------------------------
+// This is a simple class that lets us do easy (though not terribly efficient)
+// trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+ // -----------------------------------------------------------------------
+ // Constructors and Destructor
+ // -----------------------------------------------------------------------
+ StrX(const XMLCh* const toTranscode)
+ {
+ // Call the private transcoding method
+ fLocalForm = XMLString::transcode(toTranscode);
+ }
+
+ ~StrX()
+ {
+ XMLString::release(&fLocalForm);
+ }
+
+
+ // -----------------------------------------------------------------------
+ // Getter methods
+ // -----------------------------------------------------------------------
+ const char* localForm() const
+ {
+ return fLocalForm;
+ }
+
+private :
+ // -----------------------------------------------------------------------
+ // Private data members
+ //
+ // fLocalForm
+ // This is the local code page form of the string.
+ // -----------------------------------------------------------------------
+ char* fLocalForm;
+};
+
+inline XERCES_STD_QUALIFIER ostream& operator<<(XERCES_STD_QUALIFIER ostream& target, const StrX& toDump)
+{
+ target << toDump.localForm();
+ return target;
+}
+
+inline bool XIncludeErrorHandler::getSawErrors() const
+{
+ return fSawErrors;
+}
Modified: xerces/c/trunk/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml (original)
+++ xerces/c/trunk/src/xercesc/NLS/EN_US/XMLErrList_EN_US.Xml Fri Mar 2 00:55:51 2007
@@ -14,6 +14,10 @@
<Message Id="UndeclaredElemInCM" Text="Element '{0}' was referenced in a content model but never declared"/>
<Message Id="UndeclaredElemInAttList" Text="Element '{0}' was referenced in an attlist but never declared"/>
<Message Id="XMLException_Warning" Text="An exception occurred! Type:{0}, Message:{1}"/>
+ <Message Id="XIncludeResourceErrorWarning" Text="Error occurred including document '{0}'"/>
+ <Message Id="XIncludeCannotOpenFile" Text="Cannot open text file target '{0}'"/>
+ <Message Id="XIncludeInternalTextIncError" Text="Internal error including text file '{0}'"/>
+ <Message Id="XIncludeIncludeFailedResourceError" Text="Unable to include resource '{0}'"/>
</Warning>
<Error>
<Message Id="FeatureUnsupported" Text="'{0}' is not allowed for the content of a simpleType. Only list, union and restriction are allowed."/>
@@ -318,6 +322,14 @@
<Message Id="InvalidAttrName" Text="Attribute qname beginning with '{0}' invalid"/>
<Message Id="InvalidEntityRefName" Text="Entity qname for reference beginning '{0}' invalid"/>
<Message Id="DuplicateDocTypeDecl" Text="Already seen doctype"/>
+ <Message Id="XIncludeOrphanFallback" Text="Found a fallback element not a direct child of include element"/>
+ <Message Id="XIncludeNoHref" Text="include element found without href attribute"/>
+ <Message Id="XIncludeXPointerNotSupported" Text="Found an include element with xpointer specification. XPointer not yet supported"/>
+ <Message Id="XIncludeInvalidParseVal" Text="Invalid parse attribute value '{0}' found on include element - only text or xml is valid"/>
+ <Message Id="XIncludeMultipleFallbackElems" Text="Multiple fallback elements found in include element in document '{0}'"/>
+ <Message Id="XIncludeIncludeFailedNoFallback" Text="Include failed, no fallback found in document '{0}'"/>
+ <Message Id="XIncludeCircularInclusionLoop" Text="Circular inclusion document '{0}' includes previously included document"/>
+ <Message Id="XIncludeCircularInclusionDocIncludesSelf" Text="Circular inclusion document '{0}' includes itself"/>
</FatalError>
</MsgDomain>
<MsgDomain Domain="http://apache.org/xml/messages/XMLValidity">
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp Fri Mar 2 00:55:51 2007
@@ -1464,6 +1464,12 @@
// check for '+DOMMemoryManager'
if(feature && *feature=='+' && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMMemoryManager))
return true;
+ if(feature && *feature)
+ {
+ if((*feature==chPlus && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMDocumentImpl)) ||
+ XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentImpl))
+ return true;
+ }
return fNode.isSupported (feature, version);
}
@@ -1471,6 +1477,8 @@
{
if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMMemoryManager))
return (DOMMemoryManager*)this;
+ if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMDocumentImpl))
+ return (DOMDocumentImpl*)this;
return fNode.getFeature(feature,version);
}
Modified: xerces/c/trunk/src/xercesc/framework/XMLErrorCodes.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLErrorCodes.hpp?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLErrorCodes.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLErrorCodes.hpp Fri Mar 2 00:55:51 2007
@@ -22,311 +22,323 @@
, UndeclaredElemInCM = 5
, UndeclaredElemInAttList = 6
, XMLException_Warning = 7
- , W_HighBounds = 8
- , E_LowBounds = 9
- , FeatureUnsupported = 10
- , TopLevelNoNameComplexType = 11
- , TopLevelNoNameAttribute = 12
- , NoNameRefAttribute = 13
- , GlobalNoNameElement = 14
- , NoNameRefElement = 15
- , NoNameRefGroup = 16
- , NoNameRefAttGroup = 17
- , AnonComplexTypeWithName = 18
- , AnonSimpleTypeWithName = 19
- , InvalidElementContent = 20
- , UntypedElement = 21
- , SimpleTypeContentError = 22
- , ExpectedSimpleTypeInList = 23
- , ListUnionRestrictionError = 24
- , SimpleTypeDerivationByListError = 25
- , ExpectedSimpleTypeInRestriction = 26
- , DuplicateFacet = 27
- , ExpectedSimpleTypeInUnion = 28
- , EmptySimpleTypeContent = 29
- , InvalidSimpleContent = 30
- , UnspecifiedBase = 31
- , InvalidComplexContent = 32
- , SchemaElementContentError = 33
- , ContentError = 34
- , UnknownSimpleType = 35
- , UnknownComplexType = 36
- , UnresolvedPrefix = 37
- , RefElementNotFound = 38
- , TypeNotFound = 39
- , TopLevelAttributeNotFound = 40
- , InvalidChildInComplexType = 41
- , BaseTypeNotFound = 42
- , NoAttributeInSchema = 43
- , DatatypeValidatorCreationError = 44
- , InvalidChildFollowingSimpleContent = 45
- , InvalidChildFollowingConplexContent = 46
- , InvalidComplexTypeBlockValue = 47
- , InvalidComplexTypeFinalValue = 48
- , AttributeDefaultFixedValue = 49
- , NotOptionalDefaultAttValue = 50
- , LocalAttributeWithNameRef = 51
- , GlobalAttributeWithNameRef = 52
- , DuplicateAttribute = 53
- , AttributeWithTypeAndSimpleType = 54
- , AttributeSimpleTypeNotFound = 55
- , ElementWithFixedAndDefault = 56
- , DeclarationWithNameRef = 57
- , BadAttWithRef = 58
- , InvalidDeclarationName = 59
- , GlobalElementWithRef = 60
- , ElementWithTypeAndAnonType = 61
- , NotSimpleOrMixedElement = 62
- , DisallowedSimpleTypeExtension = 63
- , InvalidSimpleContentBase = 64
- , InvalidComplexTypeBase = 65
- , InvalidChildInSimpleContent = 66
- , InvalidChildInComplexContent = 67
- , AnnotationError = 68
- , DisallowedBaseDerivation = 69
- , SubstitutionRepeated = 70
- , UnionRepeated = 71
- , ExtensionRepeated = 72
- , ListRepeated = 73
- , RestrictionRepeated = 74
- , InvalidBlockValue = 75
- , InvalidFinalValue = 76
- , InvalidSubstitutionGroupElement = 77
- , SubstitutionGroupTypeMismatch = 78
- , DuplicateElementDeclaration = 79
- , InvalidElementBlockValue = 80
- , InvalidElementFinalValue = 81
- , InvalidAttValue = 82
- , AttributeRefContentError = 83
- , DuplicateRefAttribute = 84
- , ForbiddenDerivationByRestriction = 85
- , ForbiddenDerivationByExtension = 86
- , BaseNotComplexType = 87
- , ImportNamespaceDifference = 88
- , ImportRootError = 89
- , DeclarationNoSchemaLocation = 90
- , IncludeNamespaceDifference = 91
- , OnlyAnnotationExpected = 92
- , InvalidAttributeContent = 93
- , AttributeRequired = 94
- , AttributeDisallowed = 95
- , InvalidMin2MaxOccurs = 96
- , AnyAttributeContentError = 97
- , NoNameGlobalElement = 98
- , NoCircularDefinition = 99
- , DuplicateGlobalType = 100
- , DuplicateGlobalDeclaration = 101
- , WS_CollapseExpected = 102
- , Import_1_1 = 103
- , Import_1_2 = 104
- , ElemIDValueConstraint = 105
- , NoNotationType = 106
- , EmptiableMixedContent = 107
- , EmptyComplexRestrictionDerivation = 108
- , MixedOrElementOnly = 109
- , InvalidContentRestriction = 110
- , ForbiddenDerivation = 111
- , AtomicItemType = 112
- , MemberTypeNoUnion = 113
- , GroupContentError = 114
- , AttGroupContentError = 115
- , MinMaxOnGroupChild = 116
- , DeclarationNotFound = 117
- , AllContentLimited = 118
- , BadMinMaxAllCT = 119
- , BadMinMaxAllElem = 120
- , NoCircularAttGroup = 121
- , DuplicateAttInDerivation = 122
- , NotExpressibleWildCardIntersection = 123
- , BadAttDerivation_1 = 124
- , BadAttDerivation_2 = 125
- , BadAttDerivation_3 = 126
- , BadAttDerivation_4 = 127
- , BadAttDerivation_5 = 128
- , BadAttDerivation_6 = 129
- , BadAttDerivation_7 = 130
- , BadAttDerivation_8 = 131
- , BadAttDerivation_9 = 132
- , AllContentError = 133
- , RedefineNamespaceDifference = 134
- , Redefine_InvalidSimpleType = 135
- , Redefine_InvalidSimpleTypeBase = 136
- , Redefine_InvalidComplexType = 137
- , Redefine_InvalidComplexTypeBase = 138
- , Redefine_InvalidGroupMinMax = 139
- , Redefine_DeclarationNotFound = 140
- , Redefine_GroupRefCount = 141
- , Redefine_AttGroupRefCount = 142
- , Redefine_InvalidChild = 143
- , Notation_InvalidDecl = 144
- , Notation_DeclNotFound = 145
- , IC_DuplicateDecl = 146
- , IC_BadContent = 147
- , IC_KeyRefReferNotFound = 148
- , IC_KeyRefCardinality = 149
- , IC_XPathExprMissing = 150
- , AttUseCorrect = 151
- , AttDeclPropCorrect3 = 152
- , AttDeclPropCorrect5 = 153
- , AttGrpPropCorrect3 = 154
- , InvalidTargetNSValue = 155
- , DisplayErrorMessage = 156
- , XMLException_Error = 157
- , InvalidRedefine = 158
- , InvalidNSReference = 159
- , NotAllContent = 160
- , InvalidAnnotationContent = 161
- , InvalidFacetName = 162
- , InvalidXMLSchemaRoot = 163
- , CircularSubsGroup = 164
- , SubsGroupMemberAbstract = 165
- , ELTSchemaNS = 166
- , InvalidAttTNS = 167
- , NSDeclInvalid = 168
- , DOMLevel1Node = 169
- , E_HighBounds = 170
- , F_LowBounds = 171
- , EntityExpansionLimitExceeded = 172
- , ExpectedCommentOrCDATA = 173
- , ExpectedAttrName = 174
- , ExpectedNotationName = 175
- , NoRepInMixed = 176
- , BadDefAttrDecl = 177
- , ExpectedDefAttrDecl = 178
- , AttListSyntaxError = 179
- , ExpectedEqSign = 180
- , DupAttrName = 181
- , BadIdForXMLLangAttr = 182
- , ExpectedElementName = 183
- , MustStartWithXMLDecl = 184
- , CommentsMustStartWith = 185
- , InvalidDocumentStructure = 186
- , ExpectedDeclString = 187
- , BadXMLVersion = 188
- , UnsupportedXMLVersion = 189
- , UnterminatedXMLDecl = 190
- , BadXMLEncoding = 191
- , BadStandalone = 192
- , UnterminatedComment = 193
- , PINameExpected = 194
- , UnterminatedPI = 195
- , InvalidCharacter = 196
- , UnexpectedTextBeforeRoot = 197
- , UnterminatedStartTag = 198
- , ExpectedAttrValue = 199
- , UnterminatedEndTag = 200
- , ExpectedAttributeType = 201
- , ExpectedEndOfTagX = 202
- , ExpectedMarkup = 203
- , NotValidAfterContent = 204
- , ExpectedComment = 205
- , ExpectedCommentOrPI = 206
- , ExpectedWhitespace = 207
- , NoRootElemInDOCTYPE = 208
- , ExpectedQuotedString = 209
- , ExpectedPublicId = 210
- , InvalidPublicIdChar = 211
- , UnterminatedDOCTYPE = 212
- , InvalidCharacterInIntSubset = 213
- , ExpectedCDATA = 214
- , InvalidInitialNameChar = 215
- , InvalidNameChar = 216
- , UnexpectedWhitespace = 217
- , InvalidCharacterInAttrValue = 218
- , ExpectedMarkupDecl = 219
- , TextDeclNotLegalHere = 220
- , ConditionalSectInIntSubset = 221
- , ExpectedPEName = 222
- , UnterminatedEntityDecl = 223
- , InvalidCharacterRef = 224
- , UnterminatedCharRef = 225
- , ExpectedEntityRefName = 226
- , EntityNotFound = 227
- , NoUnparsedEntityRefs = 228
- , UnterminatedEntityRef = 229
- , RecursiveEntity = 230
- , PartialMarkupInEntity = 231
- , UnterminatedElementDecl = 232
- , ExpectedContentSpecExpr = 233
- , ExpectedAsterisk = 234
- , UnterminatedContentModel = 235
- , ExpectedSystemId = 236
- , ExpectedSystemOrPublicId = 237
- , UnterminatedNotationDecl = 238
- , ExpectedSeqChoiceLeaf = 239
- , ExpectedChoiceOrCloseParen = 240
- , ExpectedSeqOrCloseParen = 241
- , ExpectedEnumValue = 242
- , ExpectedEnumSepOrParen = 243
- , UnterminatedEntityLiteral = 244
- , MoreEndThanStartTags = 245
- , ExpectedOpenParen = 246
- , AttrAlreadyUsedInSTag = 247
- , BracketInAttrValue = 248
- , Expected2ndSurrogateChar = 249
- , ExpectedEndOfConditional = 250
- , ExpectedIncOrIgn = 251
- , ExpectedINCLUDEBracket = 252
- , ExpectedTextDecl = 253
- , ExpectedXMLDecl = 254
- , UnexpectedEOE = 255
- , PEPropogated = 256
- , ExtraCloseSquare = 257
- , PERefInMarkupInIntSubset = 258
- , EntityPropogated = 259
- , ExpectedNumericalCharRef = 260
- , ExpectedOpenSquareBracket = 261
- , BadSequenceInCharData = 262
- , IllegalSequenceInComment = 263
- , UnterminatedCDATASection = 264
- , ExpectedNDATA = 265
- , NDATANotValidForPE = 266
- , HexRadixMustBeLowerCase = 267
- , DeclStringRep = 268
- , DeclStringsInWrongOrder = 269
- , NoExtRefsInAttValue = 270
- , XMLDeclMustBeLowerCase = 271
- , ExpectedEntityValue = 272
- , BadDigitForRadix = 273
- , EndedWithTagsOnStack = 274
- , AmbiguousContentModel = 275
- , NestedCDATA = 276
- , UnknownPrefix = 277
- , PartialTagMarkupError = 278
- , EmptyMainEntity = 279
- , CDATAOutsideOfContent = 280
- , OnlyCharRefsAllowedHere = 281
- , Unexpected2ndSurrogateChar = 282
- , NoPIStartsWithXML = 283
- , XMLDeclMustBeFirst = 284
- , XMLVersionRequired = 285
- , StandaloneNotLegal = 286
- , EncodingRequired = 287
- , TooManyColonsInName = 288
- , InvalidColonPos = 289
- , ColonNotLegalWithNS = 290
- , SysException = 291
- , XMLException_Fatal = 292
- , UnexpectedEOF = 293
- , UnexpectedError = 294
- , BadSchemaLocation = 295
- , NoGrammarResolver = 296
- , SchemaScanFatalError = 297
- , IllegalRefInStandalone = 298
- , PEBetweenDecl = 299
- , NoEmptyStrNamespace = 300
- , NoUseOfxmlnsAsPrefix = 301
- , NoUseOfxmlnsURI = 302
- , PrefixXMLNotMatchXMLURI = 303
- , XMLURINotMatchXMLPrefix = 304
- , NoXMLNSAsElementPrefix = 305
- , CT_SimpleTypeChildRequired = 306
- , InvalidRootElemInDOCTYPE = 307
- , InvalidElementName = 308
- , InvalidAttrName = 309
- , InvalidEntityRefName = 310
- , DuplicateDocTypeDecl = 311
- , F_HighBounds = 312
+ , XIncludeResourceErrorWarning = 8
+ , XIncludeCannotOpenFile = 9
+ , XIncludeInternalTextIncError = 10
+ , XIncludeIncludeFailedResourceError = 11
+ , W_HighBounds = 12
+ , E_LowBounds = 13
+ , FeatureUnsupported = 14
+ , TopLevelNoNameComplexType = 15
+ , TopLevelNoNameAttribute = 16
+ , NoNameRefAttribute = 17
+ , GlobalNoNameElement = 18
+ , NoNameRefElement = 19
+ , NoNameRefGroup = 20
+ , NoNameRefAttGroup = 21
+ , AnonComplexTypeWithName = 22
+ , AnonSimpleTypeWithName = 23
+ , InvalidElementContent = 24
+ , UntypedElement = 25
+ , SimpleTypeContentError = 26
+ , ExpectedSimpleTypeInList = 27
+ , ListUnionRestrictionError = 28
+ , SimpleTypeDerivationByListError = 29
+ , ExpectedSimpleTypeInRestriction = 30
+ , DuplicateFacet = 31
+ , ExpectedSimpleTypeInUnion = 32
+ , EmptySimpleTypeContent = 33
+ , InvalidSimpleContent = 34
+ , UnspecifiedBase = 35
+ , InvalidComplexContent = 36
+ , SchemaElementContentError = 37
+ , ContentError = 38
+ , UnknownSimpleType = 39
+ , UnknownComplexType = 40
+ , UnresolvedPrefix = 41
+ , RefElementNotFound = 42
+ , TypeNotFound = 43
+ , TopLevelAttributeNotFound = 44
+ , InvalidChildInComplexType = 45
+ , BaseTypeNotFound = 46
+ , NoAttributeInSchema = 47
+ , DatatypeValidatorCreationError = 48
+ , InvalidChildFollowingSimpleContent = 49
+ , InvalidChildFollowingConplexContent = 50
+ , InvalidComplexTypeBlockValue = 51
+ , InvalidComplexTypeFinalValue = 52
+ , AttributeDefaultFixedValue = 53
+ , NotOptionalDefaultAttValue = 54
+ , LocalAttributeWithNameRef = 55
+ , GlobalAttributeWithNameRef = 56
+ , DuplicateAttribute = 57
+ , AttributeWithTypeAndSimpleType = 58
+ , AttributeSimpleTypeNotFound = 59
+ , ElementWithFixedAndDefault = 60
+ , DeclarationWithNameRef = 61
+ , BadAttWithRef = 62
+ , InvalidDeclarationName = 63
+ , GlobalElementWithRef = 64
+ , ElementWithTypeAndAnonType = 65
+ , NotSimpleOrMixedElement = 66
+ , DisallowedSimpleTypeExtension = 67
+ , InvalidSimpleContentBase = 68
+ , InvalidComplexTypeBase = 69
+ , InvalidChildInSimpleContent = 70
+ , InvalidChildInComplexContent = 71
+ , AnnotationError = 72
+ , DisallowedBaseDerivation = 73
+ , SubstitutionRepeated = 74
+ , UnionRepeated = 75
+ , ExtensionRepeated = 76
+ , ListRepeated = 77
+ , RestrictionRepeated = 78
+ , InvalidBlockValue = 79
+ , InvalidFinalValue = 80
+ , InvalidSubstitutionGroupElement = 81
+ , SubstitutionGroupTypeMismatch = 82
+ , DuplicateElementDeclaration = 83
+ , InvalidElementBlockValue = 84
+ , InvalidElementFinalValue = 85
+ , InvalidAttValue = 86
+ , AttributeRefContentError = 87
+ , DuplicateRefAttribute = 88
+ , ForbiddenDerivationByRestriction = 89
+ , ForbiddenDerivationByExtension = 90
+ , BaseNotComplexType = 91
+ , ImportNamespaceDifference = 92
+ , ImportRootError = 93
+ , DeclarationNoSchemaLocation = 94
+ , IncludeNamespaceDifference = 95
+ , OnlyAnnotationExpected = 96
+ , InvalidAttributeContent = 97
+ , AttributeRequired = 98
+ , AttributeDisallowed = 99
+ , InvalidMin2MaxOccurs = 100
+ , AnyAttributeContentError = 101
+ , NoNameGlobalElement = 102
+ , NoCircularDefinition = 103
+ , DuplicateGlobalType = 104
+ , DuplicateGlobalDeclaration = 105
+ , WS_CollapseExpected = 106
+ , Import_1_1 = 107
+ , Import_1_2 = 108
+ , ElemIDValueConstraint = 109
+ , NoNotationType = 110
+ , EmptiableMixedContent = 111
+ , EmptyComplexRestrictionDerivation = 112
+ , MixedOrElementOnly = 113
+ , InvalidContentRestriction = 114
+ , ForbiddenDerivation = 115
+ , AtomicItemType = 116
+ , MemberTypeNoUnion = 117
+ , GroupContentError = 118
+ , AttGroupContentError = 119
+ , MinMaxOnGroupChild = 120
+ , DeclarationNotFound = 121
+ , AllContentLimited = 122
+ , BadMinMaxAllCT = 123
+ , BadMinMaxAllElem = 124
+ , NoCircularAttGroup = 125
+ , DuplicateAttInDerivation = 126
+ , NotExpressibleWildCardIntersection = 127
+ , BadAttDerivation_1 = 128
+ , BadAttDerivation_2 = 129
+ , BadAttDerivation_3 = 130
+ , BadAttDerivation_4 = 131
+ , BadAttDerivation_5 = 132
+ , BadAttDerivation_6 = 133
+ , BadAttDerivation_7 = 134
+ , BadAttDerivation_8 = 135
+ , BadAttDerivation_9 = 136
+ , AllContentError = 137
+ , RedefineNamespaceDifference = 138
+ , Redefine_InvalidSimpleType = 139
+ , Redefine_InvalidSimpleTypeBase = 140
+ , Redefine_InvalidComplexType = 141
+ , Redefine_InvalidComplexTypeBase = 142
+ , Redefine_InvalidGroupMinMax = 143
+ , Redefine_DeclarationNotFound = 144
+ , Redefine_GroupRefCount = 145
+ , Redefine_AttGroupRefCount = 146
+ , Redefine_InvalidChild = 147
+ , Notation_InvalidDecl = 148
+ , Notation_DeclNotFound = 149
+ , IC_DuplicateDecl = 150
+ , IC_BadContent = 151
+ , IC_KeyRefReferNotFound = 152
+ , IC_KeyRefCardinality = 153
+ , IC_XPathExprMissing = 154
+ , AttUseCorrect = 155
+ , AttDeclPropCorrect3 = 156
+ , AttDeclPropCorrect5 = 157
+ , AttGrpPropCorrect3 = 158
+ , InvalidTargetNSValue = 159
+ , DisplayErrorMessage = 160
+ , XMLException_Error = 161
+ , InvalidRedefine = 162
+ , InvalidNSReference = 163
+ , NotAllContent = 164
+ , InvalidAnnotationContent = 165
+ , InvalidFacetName = 166
+ , InvalidXMLSchemaRoot = 167
+ , CircularSubsGroup = 168
+ , SubsGroupMemberAbstract = 169
+ , ELTSchemaNS = 170
+ , InvalidAttTNS = 171
+ , NSDeclInvalid = 172
+ , DOMLevel1Node = 173
+ , E_HighBounds = 174
+ , F_LowBounds = 175
+ , EntityExpansionLimitExceeded = 176
+ , ExpectedCommentOrCDATA = 177
+ , ExpectedAttrName = 178
+ , ExpectedNotationName = 179
+ , NoRepInMixed = 180
+ , BadDefAttrDecl = 181
+ , ExpectedDefAttrDecl = 182
+ , AttListSyntaxError = 183
+ , ExpectedEqSign = 184
+ , DupAttrName = 185
+ , BadIdForXMLLangAttr = 186
+ , ExpectedElementName = 187
+ , MustStartWithXMLDecl = 188
+ , CommentsMustStartWith = 189
+ , InvalidDocumentStructure = 190
+ , ExpectedDeclString = 191
+ , BadXMLVersion = 192
+ , UnsupportedXMLVersion = 193
+ , UnterminatedXMLDecl = 194
+ , BadXMLEncoding = 195
+ , BadStandalone = 196
+ , UnterminatedComment = 197
+ , PINameExpected = 198
+ , UnterminatedPI = 199
+ , InvalidCharacter = 200
+ , UnexpectedTextBeforeRoot = 201
+ , UnterminatedStartTag = 202
+ , ExpectedAttrValue = 203
+ , UnterminatedEndTag = 204
+ , ExpectedAttributeType = 205
+ , ExpectedEndOfTagX = 206
+ , ExpectedMarkup = 207
+ , NotValidAfterContent = 208
+ , ExpectedComment = 209
+ , ExpectedCommentOrPI = 210
+ , ExpectedWhitespace = 211
+ , NoRootElemInDOCTYPE = 212
+ , ExpectedQuotedString = 213
+ , ExpectedPublicId = 214
+ , InvalidPublicIdChar = 215
+ , UnterminatedDOCTYPE = 216
+ , InvalidCharacterInIntSubset = 217
+ , ExpectedCDATA = 218
+ , InvalidInitialNameChar = 219
+ , InvalidNameChar = 220
+ , UnexpectedWhitespace = 221
+ , InvalidCharacterInAttrValue = 222
+ , ExpectedMarkupDecl = 223
+ , TextDeclNotLegalHere = 224
+ , ConditionalSectInIntSubset = 225
+ , ExpectedPEName = 226
+ , UnterminatedEntityDecl = 227
+ , InvalidCharacterRef = 228
+ , UnterminatedCharRef = 229
+ , ExpectedEntityRefName = 230
+ , EntityNotFound = 231
+ , NoUnparsedEntityRefs = 232
+ , UnterminatedEntityRef = 233
+ , RecursiveEntity = 234
+ , PartialMarkupInEntity = 235
+ , UnterminatedElementDecl = 236
+ , ExpectedContentSpecExpr = 237
+ , ExpectedAsterisk = 238
+ , UnterminatedContentModel = 239
+ , ExpectedSystemId = 240
+ , ExpectedSystemOrPublicId = 241
+ , UnterminatedNotationDecl = 242
+ , ExpectedSeqChoiceLeaf = 243
+ , ExpectedChoiceOrCloseParen = 244
+ , ExpectedSeqOrCloseParen = 245
+ , ExpectedEnumValue = 246
+ , ExpectedEnumSepOrParen = 247
+ , UnterminatedEntityLiteral = 248
+ , MoreEndThanStartTags = 249
+ , ExpectedOpenParen = 250
+ , AttrAlreadyUsedInSTag = 251
+ , BracketInAttrValue = 252
+ , Expected2ndSurrogateChar = 253
+ , ExpectedEndOfConditional = 254
+ , ExpectedIncOrIgn = 255
+ , ExpectedINCLUDEBracket = 256
+ , ExpectedTextDecl = 257
+ , ExpectedXMLDecl = 258
+ , UnexpectedEOE = 259
+ , PEPropogated = 260
+ , ExtraCloseSquare = 261
+ , PERefInMarkupInIntSubset = 262
+ , EntityPropogated = 263
+ , ExpectedNumericalCharRef = 264
+ , ExpectedOpenSquareBracket = 265
+ , BadSequenceInCharData = 266
+ , IllegalSequenceInComment = 267
+ , UnterminatedCDATASection = 268
+ , ExpectedNDATA = 269
+ , NDATANotValidForPE = 270
+ , HexRadixMustBeLowerCase = 271
+ , DeclStringRep = 272
+ , DeclStringsInWrongOrder = 273
+ , NoExtRefsInAttValue = 274
+ , XMLDeclMustBeLowerCase = 275
+ , ExpectedEntityValue = 276
+ , BadDigitForRadix = 277
+ , EndedWithTagsOnStack = 278
+ , AmbiguousContentModel = 279
+ , NestedCDATA = 280
+ , UnknownPrefix = 281
+ , PartialTagMarkupError = 282
+ , EmptyMainEntity = 283
+ , CDATAOutsideOfContent = 284
+ , OnlyCharRefsAllowedHere = 285
+ , Unexpected2ndSurrogateChar = 286
+ , NoPIStartsWithXML = 287
+ , XMLDeclMustBeFirst = 288
+ , XMLVersionRequired = 289
+ , StandaloneNotLegal = 290
+ , EncodingRequired = 291
+ , TooManyColonsInName = 292
+ , InvalidColonPos = 293
+ , ColonNotLegalWithNS = 294
+ , SysException = 295
+ , XMLException_Fatal = 296
+ , UnexpectedEOF = 297
+ , UnexpectedError = 298
+ , BadSchemaLocation = 299
+ , NoGrammarResolver = 300
+ , SchemaScanFatalError = 301
+ , IllegalRefInStandalone = 302
+ , PEBetweenDecl = 303
+ , NoEmptyStrNamespace = 304
+ , NoUseOfxmlnsAsPrefix = 305
+ , NoUseOfxmlnsURI = 306
+ , PrefixXMLNotMatchXMLURI = 307
+ , XMLURINotMatchXMLPrefix = 308
+ , NoXMLNSAsElementPrefix = 309
+ , CT_SimpleTypeChildRequired = 310
+ , InvalidRootElemInDOCTYPE = 311
+ , InvalidElementName = 312
+ , InvalidAttrName = 313
+ , InvalidEntityRefName = 314
+ , DuplicateDocTypeDecl = 315
+ , XIncludeOrphanFallback = 316
+ , XIncludeNoHref = 317
+ , XIncludeXPointerNotSupported = 318
+ , XIncludeInvalidParseVal = 319
+ , XIncludeMultipleFallbackElems = 320
+ , XIncludeIncludeFailedNoFallback = 321
+ , XIncludeCircularInclusionLoop = 322
+ , XIncludeCircularInclusionDocIncludesSelf = 323
+ , F_HighBounds = 324
};
static bool isFatal(const XMLErrs::Codes toCheck)
Modified: xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp Fri Mar 2 00:55:51 2007
@@ -50,6 +50,7 @@
#include <xercesc/util/XMLEntityResolver.hpp>
#include <xercesc/util/RuntimeException.hpp>
#include <xercesc/util/XMLDOMMsg.hpp>
+#include <xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp>
XERCES_CPP_NAMESPACE_BEGIN
@@ -83,6 +84,7 @@
, fCharsetOverridesXMLEncoding(true)
, fUserAdoptsDocument(false)
, fSupportedParameters(0)
+, fDoXInclude(false)
{
// dom spec has different default from scanner's default, so set explicitly
getScanner()->setNormalizeData(false);
@@ -135,6 +137,7 @@
fSupportedParameters->add(XMLUni::fgXercesIgnoreAnnotations);
fSupportedParameters->add(XMLUni::fgXercesDisableDefaultEntityResolution);
fSupportedParameters->add(XMLUni::fgXercesSkipDTDValidation);
+ fSupportedParameters->add(XMLUni::fgXercesDoXInclude);
}
@@ -402,6 +405,10 @@
{
getScanner()->setSkipDTDValidation(state);
}
+ else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesDoXInclude) == 0)
+ {
+ fDoXInclude = state;
+ }
else
throw DOMException(DOMException::NOT_FOUND_ERR, 0, getMemoryManager());
}
@@ -593,6 +600,10 @@
{
return getSecurityManager();
}
+ else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesDoXInclude) == 0)
+ {
+ return (void *)fDoXInclude;
+ }
else
throw DOMException(DOMException::NOT_FOUND_ERR, 0, getMemoryManager());
}
@@ -642,7 +653,8 @@
XMLString::compareIStringASCII(name, XMLUni::fgXercesIgnoreCachedDTD) == 0 ||
XMLString::compareIStringASCII(name, XMLUni::fgXercesIgnoreAnnotations) == 0 ||
XMLString::compareIStringASCII(name, XMLUni::fgXercesDisableDefaultEntityResolution) == 0 ||
- XMLString::compareIStringASCII(name, XMLUni::fgXercesSkipDTDValidation) == 0)
+ XMLString::compareIStringASCII(name, XMLUni::fgXercesSkipDTDValidation) == 0 ||
+ XMLString::compareIStringASCII(name, XMLUni::fgXercesDoXInclude) == 0)
return true;
else if(XMLString::compareIStringASCII(name, XMLUni::fgDOMDisallowDoctype) == 0 ||
XMLString::compareIStringASCII(name, XMLUni::fgDOMIgnoreUnknownCharacterDenormalization) == 0 ||
@@ -697,6 +709,21 @@
Wrapper4DOMLSInput isWrapper((DOMLSInput*)source, fEntityResolver, false, getMemoryManager());
AbstractDOMParser::parse(isWrapper);
+
+ if (fDoXInclude){
+ XIncludeDOMDocumentProcessor xidp;
+ DOMDocument *doc = getDocument();
+ if(doc) {
+ // store the result of the XInclude processing in fDocument, then delete the original one
+ DOMDocument* xincluded=xidp.doXIncludeDOMProcess(doc, (XMLErrorReporter *) this);
+ if(xincluded)
+ fDocument = (DOMDocumentImpl*) (xincluded->getFeature(XMLUni::fgXercescInterfaceDOMDocumentImpl, 0));
+ else
+ fDocument = NULL;
+ delete doc;
+ }
+ }
+
if (fUserAdoptsDocument)
return adoptDocument();
else
@@ -713,6 +740,21 @@
fFilter=0;
AbstractDOMParser::parse(systemId);
+
+ if (fDoXInclude){
+ XIncludeDOMDocumentProcessor xidp;
+ DOMDocument *doc = getDocument();
+ if(doc) {
+ // store the result of the XInclude processing in fDocument, then delete the original one
+ DOMDocument* xincluded=xidp.doXIncludeDOMProcess(doc, (XMLErrorReporter *) this);
+ if(xincluded)
+ fDocument = (DOMDocumentImpl*) (xincluded->getFeature(XMLUni::fgXercescInterfaceDOMDocumentImpl, 0));
+ else
+ fDocument = NULL;
+ delete doc;
+ }
+ }
+
if (fUserAdoptsDocument)
return adoptDocument();
else
@@ -729,6 +771,21 @@
fFilter=0;
AbstractDOMParser::parse(systemId);
+
+ if (fDoXInclude){
+ XIncludeDOMDocumentProcessor xidp;
+ DOMDocument *doc = getDocument();
+ if(doc) {
+ // store the result of the XInclude processing in fDocument, then delete the original one
+ DOMDocument* xincluded=xidp.doXIncludeDOMProcess(doc, (XMLErrorReporter *) this);
+ if(xincluded)
+ fDocument = (DOMDocumentImpl*) (xincluded->getFeature(XMLUni::fgXercescInterfaceDOMDocumentImpl, 0));
+ else
+ fDocument = NULL;
+ delete doc;
+ }
+ }
+
if (fUserAdoptsDocument)
return adoptDocument();
else
@@ -1080,4 +1137,5 @@
}
XERCES_CPP_NAMESPACE_END
+
Modified: xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp Fri Mar 2 00:55:51 2007
@@ -607,6 +607,10 @@
// fSupportedParameters
// A list of the parameters that can be set, including the ones
// specific of Xerces
+ //
+ // fDoXinclude
+ // A bool used to request that XInlcude processing occur on the
+ // Document the parser parses.
//-----------------------------------------------------------------------
DOMLSResourceResolver* fEntityResolver;
XMLEntityResolver* fXMLEntityResolver;
@@ -615,6 +619,7 @@
bool fCharsetOverridesXMLEncoding;
bool fUserAdoptsDocument;
DOMStringListImpl* fSupportedParameters;
+ bool fDoXInclude;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
Modified: xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt (original)
+++ xerces/c/trunk/src/xercesc/util/MsgLoaders/ICU/resources/en_US.txt Fri Mar 2 00:55:51 2007
@@ -9,6 +9,10 @@
"Element '{0}' was referenced in a content model but never declared " ,
"Element '{0}' was referenced in an attlist but never declared " ,
"An exception occurred! Type:{0}, Message:{1} " ,
+ "Error occurred including document '{0}' " ,
+ "Cannot open text file target '{0}' " ,
+ "Internal error including text file '{0}' " ,
+ "Unable to include resource '{0}' " ,
"W_ End " ,
"E_ Start " ,
"'{0}' is not allowed for the content of a simpleType. Only list, union and restriction are allowed. " ,
@@ -313,6 +317,14 @@
"Attribute qname beginning with '{0}' invalid " ,
"Entity qname for reference beginning '{0}' invalid " ,
"Already seen doctype " ,
+ "Found a fallback element not a direct child of include element " ,
+ "include element found without href attribute " ,
+ "Found an include element with xpointer specification. XPointer not yet supported " ,
+ "Invalid parse attribute value '{0}' found on include element - only text or xml is valid " ,
+ "Multiple fallback elements found in include element in document '{0}' " ,
+ "Include failed, no fallback found in document '{0}' " ,
+ "Circular inclusion document '{0}' includes previously included document " ,
+ "Circular inclusion document '{0}' includes itself " ,
"F_ End " ,
}
Modified: xerces/c/trunk/src/xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp?view=diff&rev=513661&r1=513660&r2=513661
==============================================================================
--- xerces/c/trunk/src/xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp Fri Mar 2 00:55:51 2007
@@ -23,6 +23,12 @@
0x0061,0x0074,0x0074,0x006C,0x0069,0x0073,0x0074,0x0020,0x0062,0x0075,0x0074,0x0020,0x006E,0x0065,0x0076,0x0065,0x0072,0x0020,0x0064,0x0065,0x0063,0x006C,0x0061,0x0072,0x0065,0x0064,0x00 }
, { 0x0041,0x006E,0x0020,0x0065,0x0078,0x0063,0x0065,0x0070,0x0074,0x0069,0x006F,0x006E,0x0020,0x006F,0x0063,0x0063,0x0075,0x0072,0x0072,0x0065,0x0064,0x0021,0x0020,0x0054,0x0079,0x0070,0x0065,0x003A,0x007B,0x0030,0x007D,0x002C,0x0020,0x004D,0x0065,
0x0073,0x0073,0x0061,0x0067,0x0065,0x003A,0x007B,0x0031,0x007D,0x00 }
+ , { 0x0045,0x0072,0x0072,0x006F,0x0072,0x0020,0x006F,0x0063,0x0063,0x0075,0x0072,0x0072,0x0065,0x0064,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0069,0x006E,0x0067,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,0x0074,0x0020,0x0027,
+ 0x007B,0x0030,0x007D,0x0027,0x00 }
+ , { 0x0043,0x0061,0x006E,0x006E,0x006F,0x0074,0x0020,0x006F,0x0070,0x0065,0x006E,0x0020,0x0074,0x0065,0x0078,0x0074,0x0020,0x0066,0x0069,0x006C,0x0065,0x0020,0x0074,0x0061,0x0072,0x0067,0x0065,0x0074,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x00 }
+ , { 0x0049,0x006E,0x0074,0x0065,0x0072,0x006E,0x0061,0x006C,0x0020,0x0065,0x0072,0x0072,0x006F,0x0072,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0069,0x006E,0x0067,0x0020,0x0074,0x0065,0x0078,0x0074,0x0020,0x0066,0x0069,0x006C,0x0065,0x0020,
+ 0x0027,0x007B,0x0030,0x007D,0x0027,0x00 }
+ , { 0x0055,0x006E,0x0061,0x0062,0x006C,0x0065,0x0020,0x0074,0x006F,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0072,0x0065,0x0073,0x006F,0x0075,0x0072,0x0063,0x0065,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x00 }
, { 0x0057,0x005F,0x0045,0x006E,0x0064,0x00 }
, { 0x0045,0x005F,0x0053,0x0074,0x0061,0x0072,0x0074,0x00 }
, { 0x0027,0x007B,0x0030,0x007D,0x0027,0x0020,0x0069,0x0073,0x0020,0x006E,0x006F,0x0074,0x0020,0x0061,0x006C,0x006C,0x006F,0x0077,0x0065,0x0064,0x0020,0x0066,0x006F,0x0072,0x0020,0x0074,0x0068,0x0065,0x0020,0x0063,0x006F,0x006E,0x0074,0x0065,0x006E,
@@ -683,10 +689,29 @@
, { 0x0045,0x006E,0x0074,0x0069,0x0074,0x0079,0x0020,0x0071,0x006E,0x0061,0x006D,0x0065,0x0020,0x0066,0x006F,0x0072,0x0020,0x0072,0x0065,0x0066,0x0065,0x0072,0x0065,0x006E,0x0063,0x0065,0x0020,0x0062,0x0065,0x0067,0x0069,0x006E,0x006E,0x0069,0x006E,
0x0067,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x0020,0x0069,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x00 }
, { 0x0041,0x006C,0x0072,0x0065,0x0061,0x0064,0x0079,0x0020,0x0073,0x0065,0x0065,0x006E,0x0020,0x0064,0x006F,0x0063,0x0074,0x0079,0x0070,0x0065,0x00 }
+ , { 0x0046,0x006F,0x0075,0x006E,0x0064,0x0020,0x0061,0x0020,0x0066,0x0061,0x006C,0x006C,0x0062,0x0061,0x0063,0x006B,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0020,0x006E,0x006F,0x0074,0x0020,0x0061,0x0020,0x0064,0x0069,0x0072,0x0065,
+ 0x0063,0x0074,0x0020,0x0063,0x0068,0x0069,0x006C,0x0064,0x0020,0x006F,0x0066,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x00 }
+ , { 0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0020,0x0066,0x006F,0x0075,0x006E,0x0064,0x0020,0x0077,0x0069,0x0074,0x0068,0x006F,0x0075,0x0074,0x0020,0x0068,0x0072,0x0065,0x0066,0x0020,
+ 0x0061,0x0074,0x0074,0x0072,0x0069,0x0062,0x0075,0x0074,0x0065,0x00 }
+ , { 0x0046,0x006F,0x0075,0x006E,0x0064,0x0020,0x0061,0x006E,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0020,0x0077,0x0069,0x0074,0x0068,0x0020,0x0078,0x0070,0x006F,0x0069,0x006E,
+ 0x0074,0x0065,0x0072,0x0020,0x0073,0x0070,0x0065,0x0063,0x0069,0x0066,0x0069,0x0063,0x0061,0x0074,0x0069,0x006F,0x006E,0x002E,0x0020,0x0058,0x0050,0x006F,0x0069,0x006E,0x0074,0x0065,0x0072,0x0020,0x006E,0x006F,0x0074,0x0020,0x0079,0x0065,0x0074,
+ 0x0020,0x0073,0x0075,0x0070,0x0070,0x006F,0x0072,0x0074,0x0065,0x0064,0x00 }
+ , { 0x0049,0x006E,0x0076,0x0061,0x006C,0x0069,0x0064,0x0020,0x0070,0x0061,0x0072,0x0073,0x0065,0x0020,0x0061,0x0074,0x0074,0x0072,0x0069,0x0062,0x0075,0x0074,0x0065,0x0020,0x0076,0x0061,0x006C,0x0075,0x0065,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,
+ 0x0020,0x0066,0x006F,0x0075,0x006E,0x0064,0x0020,0x006F,0x006E,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0020,0x002D,0x0020,0x006F,0x006E,0x006C,0x0079,0x0020,0x0074,0x0065,
+ 0x0078,0x0074,0x0020,0x006F,0x0072,0x0020,0x0078,0x006D,0x006C,0x0020,0x0069,0x0073,0x0020,0x0076,0x0061,0x006C,0x0069,0x0064,0x00 }
+ , { 0x004D,0x0075,0x006C,0x0074,0x0069,0x0070,0x006C,0x0065,0x0020,0x0066,0x0061,0x006C,0x006C,0x0062,0x0061,0x0063,0x006B,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0073,0x0020,0x0066,0x006F,0x0075,0x006E,0x0064,0x0020,0x0069,0x006E,
+ 0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0065,0x006C,0x0065,0x006D,0x0065,0x006E,0x0074,0x0020,0x0069,0x006E,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,0x0074,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x00 }
+ , { 0x0049,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0020,0x0066,0x0061,0x0069,0x006C,0x0065,0x0064,0x002C,0x0020,0x006E,0x006F,0x0020,0x0066,0x0061,0x006C,0x006C,0x0062,0x0061,0x0063,0x006B,0x0020,0x0066,0x006F,0x0075,0x006E,0x0064,0x0020,0x0069,
+ 0x006E,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,0x0074,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x00 }
+ , { 0x0043,0x0069,0x0072,0x0063,0x0075,0x006C,0x0061,0x0072,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0073,0x0069,0x006F,0x006E,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,0x0074,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x0020,0x0069,
+ 0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0073,0x0020,0x0070,0x0072,0x0065,0x0076,0x0069,0x006F,0x0075,0x0073,0x006C,0x0079,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0064,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,
+ 0x0074,0x00 }
+ , { 0x0043,0x0069,0x0072,0x0063,0x0075,0x006C,0x0061,0x0072,0x0020,0x0069,0x006E,0x0063,0x006C,0x0075,0x0073,0x0069,0x006F,0x006E,0x0020,0x0064,0x006F,0x0063,0x0075,0x006D,0x0065,0x006E,0x0074,0x0020,0x0027,0x007B,0x0030,0x007D,0x0027,0x0020,0x0069,
+ 0x006E,0x0063,0x006C,0x0075,0x0064,0x0065,0x0073,0x0020,0x0069,0x0074,0x0073,0x0065,0x006C,0x0066,0x00 }
, { 0x0046,0x005F,0x0045,0x006E,0x0064,0x00 }
};
-const unsigned int gXMLErrArraySize = 313;
+const unsigned int gXMLErrArraySize = 325;
const XMLCh gXMLValidityArray[][128] =
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org