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 10:22:57 UTC
svn commit: r513675 - in /xerces/c/trunk: samples/src/XInclude/XInclude.cpp
samples/src/XInclude/XInclude.hpp
src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp
src/xercesc/xinclude/XIncludeLocation.hpp
src/xercesc/xinclude/XIncludeUtils.hpp
Author: amassari
Date: Fri Mar 2 01:22:55 2007
New Revision: 513675
URL: http://svn.apache.org/viewvc?view=rev&rev=513675
Log:
Added SVN properties to .hpp files; fixed license
Modified:
xerces/c/trunk/samples/src/XInclude/XInclude.cpp
xerces/c/trunk/samples/src/XInclude/XInclude.hpp (contents, props changed)
xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp (contents, props changed)
xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp (contents, props changed)
xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp (contents, props changed)
Modified: xerces/c/trunk/samples/src/XInclude/XInclude.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/XInclude/XInclude.cpp?view=diff&rev=513675&r1=513674&r2=513675
==============================================================================
--- xerces/c/trunk/samples/src/XInclude/XInclude.cpp (original)
+++ xerces/c/trunk/samples/src/XInclude/XInclude.cpp Fri Mar 2 01:22:55 2007
@@ -1,9 +1,10 @@
/*
- * 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
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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
*
@@ -15,7 +16,7 @@
*/
/*
- * $$
+ * $Id$
*/
// ---------------------------------------------------------------------------
Modified: xerces/c/trunk/samples/src/XInclude/XInclude.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/XInclude/XInclude.hpp?view=diff&rev=513675&r1=513674&r2=513675
==============================================================================
--- xerces/c/trunk/samples/src/XInclude/XInclude.hpp (original)
+++ xerces/c/trunk/samples/src/XInclude/XInclude.hpp Fri Mar 2 01:22:55 2007
@@ -1,130 +1,131 @@
-/*
- * 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;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+// ---------------------------------------------------------------------------
+// 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;
+}
Propchange: xerces/c/trunk/samples/src/XInclude/XInclude.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/samples/src/XInclude/XInclude.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp?view=diff&rev=513675&r1=513674&r2=513675
==============================================================================
--- xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp (original)
+++ xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp Fri Mar 2 01:22:55 2007
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: $
- */
-
-#if !defined(XINCLUDEDOMDOCUMENTPROCESSOR_HPP)
-#define XINCLUDEDOMDOCUMENTPROCESSOR_HPP
-
-#include <xercesc/util/XercesDefs.hpp>
-#include <xercesc/dom/DOM.hpp>
-#include <xercesc/framework/XMLErrorReporter.hpp>
-
-XERCES_CPP_NAMESPACE_BEGIN
-
-/**
- * Class for representing and manipulating the XMLCh * href's used
- * by an xi:include element.
- *
- * This class is designed primarily for internal use. This class implements
- * the functionality required to calculate relative hrefs and the base URI
- * fixups required for performing XInclude functionality.
- */
-class XINCLUDE_EXPORT XIncludeDOMDocumentProcessor
-{
-public:
- /** Walk the supplied DOMDocument performing all XInclude's as encountered.
- *
- * @param source A DOMDocument to parse, this document is not modified.
- * @param errorHandled An errorHandler to call back in case of problems
- *
- * @return a newly created DOMDocument containing the parsed and actioned
- * xinclude elements.
- */
- DOMDocument *doXIncludeDOMProcess(const DOMDocument * const source, XMLErrorReporter *errorHandler);
-};
-
-XERCES_CPP_NAMESPACE_END
-
-#endif /* XINCLUDEDOMDOCUMENTPROCESSOR_HPP */
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+#if !defined(XINCLUDEDOMDOCUMENTPROCESSOR_HPP)
+#define XINCLUDEDOMDOCUMENTPROCESSOR_HPP
+
+#include <xercesc/util/XercesDefs.hpp>
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/framework/XMLErrorReporter.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+/**
+ * Class for representing and manipulating the XMLCh * href's used
+ * by an xi:include element.
+ *
+ * This class is designed primarily for internal use. This class implements
+ * the functionality required to calculate relative hrefs and the base URI
+ * fixups required for performing XInclude functionality.
+ */
+class XINCLUDE_EXPORT XIncludeDOMDocumentProcessor
+{
+public:
+ /** Walk the supplied DOMDocument performing all XInclude's as encountered.
+ *
+ * @param source A DOMDocument to parse, this document is not modified.
+ * @param errorHandled An errorHandler to call back in case of problems
+ *
+ * @return a newly created DOMDocument containing the parsed and actioned
+ * xinclude elements.
+ */
+ DOMDocument *doXIncludeDOMProcess(const DOMDocument * const source, XMLErrorReporter *errorHandler);
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif /* XINCLUDEDOMDOCUMENTPROCESSOR_HPP */
+
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeDOMDocumentProcessor.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp?view=diff&rev=513675&r1=513674&r2=513675
==============================================================================
--- xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp (original)
+++ xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp Fri Mar 2 01:22:55 2007
@@ -1,89 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: $
- */
-
-#if !defined(XINCLUDELOCATION_HPP)
-#define XINCLUDELOCATION_HPP
-
-#include <xercesc/util/XercesDefs.hpp>
-#include <xercesc/dom/DOM.hpp>
-
-XERCES_CPP_NAMESPACE_BEGIN
-
-
-/**
- * Class for representing and manipulating the XMLCh * href's used
- * by an xi:include element.
- *
- * This class is designed primarily for internal use. This class implements
- * the functionality required to calculate relative hrefs and the base URI
- * fixups required for performing XInclude functionality.
- */
-class XINCLUDE_EXPORT XIncludeLocation
-{
-public:
- /** Create an XIncludeLocation, primed with the supplied href
- *
- * @param href the initial URI value
- *
- * @return nothing
- */
- XIncludeLocation(const XMLCh *href);
-
- /** Destructor
- *
- * @return nothing
- */
- ~XIncludeLocation();
-
- /** Prepend the supplied href to the current location and modify the current XIncludeLocation's
- * internal href field
- *
- * @param toPrepend the path to prepend
- *
- * @return the resultant compound URI
- */
- const XMLCh *prependPath(const XMLCh *toPrepend);
-
- /** Get the current XIncludeLocation's compound URI location
- *
- * @return the current URI
- */
- const XMLCh *getLocation(){
- return fHref;
- };
-
- /** Get a pointer to the end of the protocol section of a URI
- *
- * @param URI a URI to strip the protocol from
- *
- * @return a pointer into the supplied URI immediately after the last character of the protocol section
- * the pointer points to the first character after the protocol.
- */
- static const XMLCh *findEndOfProtocol(const XMLCh *URI);
-
-private:
- const XMLCh *fHref;
-};
-
-XERCES_CPP_NAMESPACE_END
-
-#endif /* XINCLUDELOCATION_HPP */
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+#if !defined(XINCLUDELOCATION_HPP)
+#define XINCLUDELOCATION_HPP
+
+#include <xercesc/util/XercesDefs.hpp>
+#include <xercesc/dom/DOM.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+
+/**
+ * Class for representing and manipulating the XMLCh * href's used
+ * by an xi:include element.
+ *
+ * This class is designed primarily for internal use. This class implements
+ * the functionality required to calculate relative hrefs and the base URI
+ * fixups required for performing XInclude functionality.
+ */
+class XINCLUDE_EXPORT XIncludeLocation
+{
+public:
+ /** Create an XIncludeLocation, primed with the supplied href
+ *
+ * @param href the initial URI value
+ *
+ * @return nothing
+ */
+ XIncludeLocation(const XMLCh *href);
+
+ /** Destructor
+ *
+ * @return nothing
+ */
+ ~XIncludeLocation();
+
+ /** Prepend the supplied href to the current location and modify the current XIncludeLocation's
+ * internal href field
+ *
+ * @param toPrepend the path to prepend
+ *
+ * @return the resultant compound URI
+ */
+ const XMLCh *prependPath(const XMLCh *toPrepend);
+
+ /** Get the current XIncludeLocation's compound URI location
+ *
+ * @return the current URI
+ */
+ const XMLCh *getLocation(){
+ return fHref;
+ };
+
+ /** Get a pointer to the end of the protocol section of a URI
+ *
+ * @param URI a URI to strip the protocol from
+ *
+ * @return a pointer into the supplied URI immediately after the last character of the protocol section
+ * the pointer points to the first character after the protocol.
+ */
+ static const XMLCh *findEndOfProtocol(const XMLCh *URI);
+
+private:
+ const XMLCh *fHref;
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif /* XINCLUDELOCATION_HPP */
+
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeLocation.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp?view=diff&rev=513675&r1=513674&r2=513675
==============================================================================
--- xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp (original)
+++ xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp Fri Mar 2 01:22:55 2007
@@ -1,307 +1,307 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: $
- */
-
-#if !defined(XINCLUDEUTILS_HPP)
-#define XINCLUDEUTILS_HPP
-
-#include <xercesc/util/XercesDefs.hpp>
-#include <xercesc/util/XMLException.hpp>
-#include <xercesc/dom/DOMNode.hpp>
-#include <xercesc/dom/DOMDocument.hpp>
-#include <xercesc/dom/DOMErrorHandler.hpp>
-#include <xercesc/framework/XMLElementDecl.hpp>
-#include <xercesc/xinclude/XIncludeLocation.hpp>
-#include <xercesc/framework/XMLErrorCodes.hpp>
-
-XERCES_CPP_NAMESPACE_BEGIN
-
-typedef struct XIncludeHistoryNode{
- XMLCh *URI;
- struct XIncludeHistoryNode *next;
-}XIncludeHistoryNode;
-
-// ---------------------------------------------------------------------------
-// Simple error handler deriviative to install on parser
-// ---------------------------------------------------------------------------
-class XINCLUDE_EXPORT XIDOMErrorHandler : public DOMErrorHandler
-{
-public:
- // -----------------------------------------------------------------------
- // Constructors and Destructor
- // -----------------------------------------------------------------------
- XIDOMErrorHandler();
- ~XIDOMErrorHandler();
-
-
- // -----------------------------------------------------------------------
- // Getter methods
- // -----------------------------------------------------------------------
- bool getSawErrors() const;
-
-
- // -----------------------------------------------------------------------
- // Implementation of the DOM ErrorHandler interface
- // -----------------------------------------------------------------------
- bool handleError(const DOMError& domError);
- void resetErrors();
-
-
-private :
- // -----------------------------------------------------------------------
- // Unimplemented constructors and operators
- // -----------------------------------------------------------------------
- XIDOMErrorHandler(const XIDOMErrorHandler&);
- void operator=(const XIDOMErrorHandler&);
-
-
- // -----------------------------------------------------------------------
- // 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;
-};
-
-
-/**
- * Class implementing all the utility functions required by an XInclude parser.
- *
- * This class is designed primarily for internal use. This class implements
- * utility methods to be called by an XInclude parser. It is intended to encapsulate
- * the actual processing and recognition of XInclude components.
- */
-class XINCLUDE_EXPORT XIncludeUtils
-{
-private:
-
- /** Constructor
- *
- */
- XIncludeUtils(XMLErrorReporter *errorReporter);
-
- /** Destructor
- *
- */
- ~XIncludeUtils();
-
- /** Parse the supplied XInclude element performing relevant XInclude functionality
- *
- * @param xincludeNode The XInclude node to parse and action
- * @param parsedDocument The DOMDocument to which the results of the XInclude are to be added
- *
- * @return true if the XInclude processing was successful, false if not. Note that an
- * XInclude that fails resulting in a successful fallback action would return true.
- */
- bool doDOMNodeXInclude(DOMNode *xincludeNode, DOMDocument *parsedDocument);
-
- /** Parse an XInclude xml file into a DOMDocument node.
- *
- * @param href the location of the document to include
- * @param relativeHref
- * @param parsedDocument
- *
- * @return a newly created DOMDocument containing the parsed and actioned
- * href, or NULL if the document could not be loaded.
- */
- DOMDocument *doXIncludeXMLFileDOM(const XMLCh *href,
- const XMLCh *relativeHref,
- DOMNode *xincludeNode,
- DOMDocument *parsedDocument);
-
- /** Parse an XInclude text file into a DOMText node.
- *
- * @param href the location of the document to include
- * @param relativeHref
- * @param encoding
- * @param parsedDocument
- *
- * @return a newly created DOMText containing the parsed and actioned
- * href, or NULL if the document could not be loaded.
- */
- DOMText *doXIncludeTEXTFileDOM(const XMLCh *href,
- const XMLCh *relativeHref,
- const XMLCh *encoding,
- DOMDocument *parsedDocument);
-
- /** Detect whether the supplied details are correct for an xi:include element
- *
- * @param name the element name
- * @param namespaceURI the element namespace
- *
- * @return true if details are valid for an xi:include element, false
- * if not.
- */
- bool isXIIncludeElement(const XMLCh *name, const XMLCh *namespaceURI);
-
- /** Detect whether the supplied details are correct for an xi:fallback element
- *
- * @param name the element name
- * @param namespaceURI the element namespace
- *
- * @return true if details are valid for an xi:fallback element, false
- * if not.
- */
- bool isXIFallbackElement(const XMLCh *name, const XMLCh *namespaceURI);
-
- /** Detect whether the supplied DOMNode is an xi:include element
- *
- * @param node The node to check
- *
- * @return true if node is an xi:include element, false
- * if not.
- */
- bool isXIIncludeDOMNode(DOMNode *node);
-
- /** Detect whether the supplied DOMNode is an xi:fallback element
- *
- * @param node The DOMNode to check
- *
- * @return true if node is an xi:fallback element, false
- * if not.
- */
- bool isXIFallbackDOMNode(DOMNode *node);
-
- /** Walk the content of the supplied source node, performing any xinclude actions
- * that are encountered.
- *
- * @param source A DOMNode to parse, this node may be modified by the method
- * @param parsedDocument the DOMDocument to which the parsed results are to be copied.
- *
- * @return true if XInclude behaviour was successfully performed on source, false if not.
- */
- bool parseDOMNodeDoingXInclude(DOMNode *source, DOMDocument *parsedDocument);
-
- /** Parse the supplied URI and escape all characters as specified by
- * the XINclusions specification.
- *
- * @param hrefAttrValue the href to parse and escape.
- * @param needsDeallocating set to true if the return value needs deallocating
- * by the caller after use, false if the value returned is the same as the
- * hrefAttrValue passed in.
- *
- * @return an escaped version of hrefAttrValue or hrefAttrValue itself if
- * hrefAttrValue contains only valid characters.
- */
- /* 4.1.1 */
- const XMLCh *getEscapedHRefAttrValue(const XMLCh *hrefAttrValue, bool &needsDeallocating);
-
- /** Set the accept and accept-lang parameters on HTTP requests generated while
- * XIncluding.
- *
- * @param acceptAttrValue
- * @param acceptLangAttrValue
- *
- * @return true if the values were successfully added to the HTTP request, false
- * if not.
- */
- /* 4.1.2 */
- bool setContentNegotiation(const XMLCh *acceptAttrValue, const XMLCh *acceptLangAttrValue);
-
- /** Check the characters passed in are all valid characters for XInclusion
- * as specified at http://www.w3.org/TR/xinclude/#text-included-items
- *
- * @param includeChars the characters to parse for validity
- *
- * @return true if the includeChars parameter contains only valid characters
- * for inclusion, false if there are invalid characters in includeChars.
- */
- bool checkTextIsValidForInclude(XMLCh *includeChars);
-
- /** Add the supplied parameter to the InclusionHistoryStack
- *
- * @param URItoAdd the URI to add to the InclusionHistoryStack/
- *
- * @return true if the URI was added, false if a problem prevented
- * the URI being added.
- */
- bool addDocumentURIToCurrentInclusionHistoryStack(const XMLCh *URItoAdd);
-
- /** Check the XInclude InclusionHistoryStack to see if the supplied URI
- * has already been included. This is used to ensure that circular inclusion
- * chains are detected and that the inclusion mechanism does not get stuck in
- * a loop.
- *
- * @param toFind the URI to look up.
- *
- * @return true if the toFind parameter is found in the InclusionHistortStack,
- * false if the parameter is not in the stack or the stack is empty.
- */
- bool isInCurrentInclusionHistoryStack(const XMLCh *toFind);
-
- /** Pop (i.e. remove and return) the top value from the InclusionHistoryStack
- *
- * @param toPop the value that is expected to be at the top of the stack, or
- * NULL if no checking is required.
- *
- * @return the element at the top of the stack
- */
- XIncludeHistoryNode * popFromCurrentInclusionHistoryStack(const XMLCh *toPop);
-
- /** Free the internal inclusion history list.
- *
- * @return nothing
- */
- void freeInclusionHistory();
-
- /** Construct and pass on an error description
- *
- * @param errorNode The DOMNode that was being parsed when the error occurred
- * @param errorType The severity of the error
- * @param errorMsg An optional message to include in the error report
- * @param href The URI of the document being parsed.
- *
- * @return true if the errorHandler requests continuation of parsing despite error
- * false if the errorHandler requests parsing end on encountering error, or it
- * there is no error handler.
- */
- bool reportError(const DOMNode* const errorNode
- , XMLErrs::Codes errorType
- , const XMLCh* const errorMsg
- , const XMLCh* const href);
-
-public:
- /* temporarily public to facilitate helper func getBaseAttrValue */
- static const XMLCh fgXIBaseAttrName[];
-private:
- XIncludeHistoryNode *fIncludeHistoryHead;
- long fErrorCount;
- XMLErrorReporter *fErrorReporter;
- static const XMLCh fgXIIncludeQName[];
- static const XMLCh fgXIFallbackQName[];
- static const XMLCh fgXIIncludeHREFAttrName[];
- static const XMLCh fgXIIncludeParseAttrName[];
- static const XMLCh fgXIIncludeParseAttrXMLValue[];
- static const XMLCh fgXIIncludeParseAttrTextValue[];
- static const XMLCh fgXIIncludeXPointerAttrName[];
- static const XMLCh fgXIIncludeEncodingAttrName[];
- static const XMLCh fgXIIncludeAcceptAttrName[];
- static const XMLCh fgXIIncludeAcceptLanguageAttrName[];
- static const XMLCh fgXIIIncludeNamespaceURI[];
-
- friend class XIncludeDOMDocumentProcessor;
-};
-
-XERCES_CPP_NAMESPACE_END
-
-#endif
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+#if !defined(XINCLUDEUTILS_HPP)
+#define XINCLUDEUTILS_HPP
+
+#include <xercesc/util/XercesDefs.hpp>
+#include <xercesc/util/XMLException.hpp>
+#include <xercesc/dom/DOMNode.hpp>
+#include <xercesc/dom/DOMDocument.hpp>
+#include <xercesc/dom/DOMErrorHandler.hpp>
+#include <xercesc/framework/XMLElementDecl.hpp>
+#include <xercesc/xinclude/XIncludeLocation.hpp>
+#include <xercesc/framework/XMLErrorCodes.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+typedef struct XIncludeHistoryNode{
+ XMLCh *URI;
+ struct XIncludeHistoryNode *next;
+}XIncludeHistoryNode;
+
+// ---------------------------------------------------------------------------
+// Simple error handler deriviative to install on parser
+// ---------------------------------------------------------------------------
+class XINCLUDE_EXPORT XIDOMErrorHandler : public DOMErrorHandler
+{
+public:
+ // -----------------------------------------------------------------------
+ // Constructors and Destructor
+ // -----------------------------------------------------------------------
+ XIDOMErrorHandler();
+ ~XIDOMErrorHandler();
+
+
+ // -----------------------------------------------------------------------
+ // Getter methods
+ // -----------------------------------------------------------------------
+ bool getSawErrors() const;
+
+
+ // -----------------------------------------------------------------------
+ // Implementation of the DOM ErrorHandler interface
+ // -----------------------------------------------------------------------
+ bool handleError(const DOMError& domError);
+ void resetErrors();
+
+
+private :
+ // -----------------------------------------------------------------------
+ // Unimplemented constructors and operators
+ // -----------------------------------------------------------------------
+ XIDOMErrorHandler(const XIDOMErrorHandler&);
+ void operator=(const XIDOMErrorHandler&);
+
+
+ // -----------------------------------------------------------------------
+ // 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;
+};
+
+
+/**
+ * Class implementing all the utility functions required by an XInclude parser.
+ *
+ * This class is designed primarily for internal use. This class implements
+ * utility methods to be called by an XInclude parser. It is intended to encapsulate
+ * the actual processing and recognition of XInclude components.
+ */
+class XINCLUDE_EXPORT XIncludeUtils
+{
+private:
+
+ /** Constructor
+ *
+ */
+ XIncludeUtils(XMLErrorReporter *errorReporter);
+
+ /** Destructor
+ *
+ */
+ ~XIncludeUtils();
+
+ /** Parse the supplied XInclude element performing relevant XInclude functionality
+ *
+ * @param xincludeNode The XInclude node to parse and action
+ * @param parsedDocument The DOMDocument to which the results of the XInclude are to be added
+ *
+ * @return true if the XInclude processing was successful, false if not. Note that an
+ * XInclude that fails resulting in a successful fallback action would return true.
+ */
+ bool doDOMNodeXInclude(DOMNode *xincludeNode, DOMDocument *parsedDocument);
+
+ /** Parse an XInclude xml file into a DOMDocument node.
+ *
+ * @param href the location of the document to include
+ * @param relativeHref
+ * @param parsedDocument
+ *
+ * @return a newly created DOMDocument containing the parsed and actioned
+ * href, or NULL if the document could not be loaded.
+ */
+ DOMDocument *doXIncludeXMLFileDOM(const XMLCh *href,
+ const XMLCh *relativeHref,
+ DOMNode *xincludeNode,
+ DOMDocument *parsedDocument);
+
+ /** Parse an XInclude text file into a DOMText node.
+ *
+ * @param href the location of the document to include
+ * @param relativeHref
+ * @param encoding
+ * @param parsedDocument
+ *
+ * @return a newly created DOMText containing the parsed and actioned
+ * href, or NULL if the document could not be loaded.
+ */
+ DOMText *doXIncludeTEXTFileDOM(const XMLCh *href,
+ const XMLCh *relativeHref,
+ const XMLCh *encoding,
+ DOMDocument *parsedDocument);
+
+ /** Detect whether the supplied details are correct for an xi:include element
+ *
+ * @param name the element name
+ * @param namespaceURI the element namespace
+ *
+ * @return true if details are valid for an xi:include element, false
+ * if not.
+ */
+ bool isXIIncludeElement(const XMLCh *name, const XMLCh *namespaceURI);
+
+ /** Detect whether the supplied details are correct for an xi:fallback element
+ *
+ * @param name the element name
+ * @param namespaceURI the element namespace
+ *
+ * @return true if details are valid for an xi:fallback element, false
+ * if not.
+ */
+ bool isXIFallbackElement(const XMLCh *name, const XMLCh *namespaceURI);
+
+ /** Detect whether the supplied DOMNode is an xi:include element
+ *
+ * @param node The node to check
+ *
+ * @return true if node is an xi:include element, false
+ * if not.
+ */
+ bool isXIIncludeDOMNode(DOMNode *node);
+
+ /** Detect whether the supplied DOMNode is an xi:fallback element
+ *
+ * @param node The DOMNode to check
+ *
+ * @return true if node is an xi:fallback element, false
+ * if not.
+ */
+ bool isXIFallbackDOMNode(DOMNode *node);
+
+ /** Walk the content of the supplied source node, performing any xinclude actions
+ * that are encountered.
+ *
+ * @param source A DOMNode to parse, this node may be modified by the method
+ * @param parsedDocument the DOMDocument to which the parsed results are to be copied.
+ *
+ * @return true if XInclude behaviour was successfully performed on source, false if not.
+ */
+ bool parseDOMNodeDoingXInclude(DOMNode *source, DOMDocument *parsedDocument);
+
+ /** Parse the supplied URI and escape all characters as specified by
+ * the XINclusions specification.
+ *
+ * @param hrefAttrValue the href to parse and escape.
+ * @param needsDeallocating set to true if the return value needs deallocating
+ * by the caller after use, false if the value returned is the same as the
+ * hrefAttrValue passed in.
+ *
+ * @return an escaped version of hrefAttrValue or hrefAttrValue itself if
+ * hrefAttrValue contains only valid characters.
+ */
+ /* 4.1.1 */
+ const XMLCh *getEscapedHRefAttrValue(const XMLCh *hrefAttrValue, bool &needsDeallocating);
+
+ /** Set the accept and accept-lang parameters on HTTP requests generated while
+ * XIncluding.
+ *
+ * @param acceptAttrValue
+ * @param acceptLangAttrValue
+ *
+ * @return true if the values were successfully added to the HTTP request, false
+ * if not.
+ */
+ /* 4.1.2 */
+ bool setContentNegotiation(const XMLCh *acceptAttrValue, const XMLCh *acceptLangAttrValue);
+
+ /** Check the characters passed in are all valid characters for XInclusion
+ * as specified at http://www.w3.org/TR/xinclude/#text-included-items
+ *
+ * @param includeChars the characters to parse for validity
+ *
+ * @return true if the includeChars parameter contains only valid characters
+ * for inclusion, false if there are invalid characters in includeChars.
+ */
+ bool checkTextIsValidForInclude(XMLCh *includeChars);
+
+ /** Add the supplied parameter to the InclusionHistoryStack
+ *
+ * @param URItoAdd the URI to add to the InclusionHistoryStack/
+ *
+ * @return true if the URI was added, false if a problem prevented
+ * the URI being added.
+ */
+ bool addDocumentURIToCurrentInclusionHistoryStack(const XMLCh *URItoAdd);
+
+ /** Check the XInclude InclusionHistoryStack to see if the supplied URI
+ * has already been included. This is used to ensure that circular inclusion
+ * chains are detected and that the inclusion mechanism does not get stuck in
+ * a loop.
+ *
+ * @param toFind the URI to look up.
+ *
+ * @return true if the toFind parameter is found in the InclusionHistortStack,
+ * false if the parameter is not in the stack or the stack is empty.
+ */
+ bool isInCurrentInclusionHistoryStack(const XMLCh *toFind);
+
+ /** Pop (i.e. remove and return) the top value from the InclusionHistoryStack
+ *
+ * @param toPop the value that is expected to be at the top of the stack, or
+ * NULL if no checking is required.
+ *
+ * @return the element at the top of the stack
+ */
+ XIncludeHistoryNode * popFromCurrentInclusionHistoryStack(const XMLCh *toPop);
+
+ /** Free the internal inclusion history list.
+ *
+ * @return nothing
+ */
+ void freeInclusionHistory();
+
+ /** Construct and pass on an error description
+ *
+ * @param errorNode The DOMNode that was being parsed when the error occurred
+ * @param errorType The severity of the error
+ * @param errorMsg An optional message to include in the error report
+ * @param href The URI of the document being parsed.
+ *
+ * @return true if the errorHandler requests continuation of parsing despite error
+ * false if the errorHandler requests parsing end on encountering error, or it
+ * there is no error handler.
+ */
+ bool reportError(const DOMNode* const errorNode
+ , XMLErrs::Codes errorType
+ , const XMLCh* const errorMsg
+ , const XMLCh* const href);
+
+public:
+ /* temporarily public to facilitate helper func getBaseAttrValue */
+ static const XMLCh fgXIBaseAttrName[];
+private:
+ XIncludeHistoryNode *fIncludeHistoryHead;
+ long fErrorCount;
+ XMLErrorReporter *fErrorReporter;
+ static const XMLCh fgXIIncludeQName[];
+ static const XMLCh fgXIFallbackQName[];
+ static const XMLCh fgXIIncludeHREFAttrName[];
+ static const XMLCh fgXIIncludeParseAttrName[];
+ static const XMLCh fgXIIncludeParseAttrXMLValue[];
+ static const XMLCh fgXIIncludeParseAttrTextValue[];
+ static const XMLCh fgXIIncludeXPointerAttrName[];
+ static const XMLCh fgXIIncludeEncodingAttrName[];
+ static const XMLCh fgXIIncludeAcceptAttrName[];
+ static const XMLCh fgXIIncludeAcceptLanguageAttrName[];
+ static const XMLCh fgXIIIncludeNamespaceURI[];
+
+ friend class XIncludeDOMDocumentProcessor;
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/xinclude/XIncludeUtils.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org