You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/07/27 00:04:09 UTC

svn commit: r1366210 [1/3] - in /webservices/axiom/branches/AXIOM-201: ./ modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/ modules/axiom-api/src/main/java/org/apache/axiom/om/ modules/axiom-api/src/main/java/org/apache/axiom/om/dom/ modules/a...

Author: veithen
Date: Thu Jul 26 22:04:05 2012
New Revision: 1366210

URL: http://svn.apache.org/viewvc?rev=1366210&view=rev
Log:
Merged latest changes from trunk.

Added:
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/DTDReader.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/DTDReader.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMEntityReference.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMEntityReference.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAX2StreamReaderWrapper.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAX2StreamReaderWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/IElement.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderFactoryImpl.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderFactoryImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderImpl.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/jaxp/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/jaxp/
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderFactoryImplTest.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-compat/src/test/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderFactoryImplTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/builder/TestParseURI.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/builder/TestParseURI.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateEntityReference.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateEntityReference.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/TestWithParser1.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/TestWithParser1.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/TestWithParser2.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/documenttype/TestWithParser2.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildCyclic.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildCyclic.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildFirst.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildFirst.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildFirstWithDocumentFragment.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildFirstWithDocumentFragment.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildLast.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildLast.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildLastWithDocumentFragment.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildLastWithDocumentFragment.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildMiddle.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildMiddle.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildMiddleWithDocumentFragment.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildMiddleWithDocumentFragment.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildNotFound.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildNotFound.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildNullNewChild.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildNullNewChild.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildSingle.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChildSingle.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/builder/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/builder/
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/builder/test.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/builder/test.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/
      - copied from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test.dtd
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test.dtd
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test1.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test1.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test2.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/documenttype/test2.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/SAXSerializer.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/SAXSerializer.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestClone.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestRemoveChildren.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/document/TestRemoveChildren.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestRemoveChildren.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestRemoveChildren.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneNonDestructive.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneNonDestructive.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneUnknownName.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneUnknownName.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestRemoveChildrenUnexpanded.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestRemoveChildrenUnexpanded.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestReplaceChildIncomplete.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestReplaceChildIncomplete.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestDTD.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestDTD.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/CloneTestCase.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/CloneTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestClone.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestClone.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneWithSourcedElement1.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneWithSourcedElement1.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneWithSourcedElement2.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneWithSourcedElement2.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestClone.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestClone.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestCloneIncomplete.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/message/TestCloneIncomplete.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/resources/badsoap/soap11/entity-reference.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/badsoap/soap11/entity-reference.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/resources/badsoap/soap11/processing-instruction.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/badsoap/soap11/processing-instruction.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/resources/badsoap/soap12/entity-reference.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/badsoap/soap12/entity-reference.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/resources/badsoap/soap12/processing-instruction.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/badsoap/soap12/processing-instruction.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/XMLAssertEx.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/XMLAssertEx.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entity-reference-external-subset.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entity-reference-external-subset.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entity-reference-internal-subset.xml
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entity-reference-internal-subset.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entref.dtd
      - copied unchanged from r1366208, webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/resources/org/apache/axiom/testutils/conformance/entref.dtd
Removed:
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestReplaceChild.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderFactoryImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DocumentBuilderImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/jaxp/
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneOMElementNonDestructive.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestCloneOMElementUnknownName.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/CloneOMElementTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneOMElement.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneOMElementWithSourcedElement1.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestCloneOMElementWithSourcedElement2.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/Conformance.java
Modified:
    webservices/axiom/branches/AXIOM-201/   (props changed)
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocType.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMMetaFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/jaxp/OMSource.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/OMXMLReader.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/CopyUtils.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/XMLStreamWriterUtils.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox3StreamReaderWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox4StreamReaderWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/om/DOMCompatibilityTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/jaxp/StreamSourceToOMResultTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializerTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestSuiteBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/TestGetNamespaceContext.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementImplUtil.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMXMLParserWrapper.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-compat/pom.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/pom.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCloneNode.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestInsertBeforeWithDocumentFragment.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/jaxp/DOOMDocumentBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMAttributeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-integration/src/test/java/org/apache/axiom/om/impl/builder/SAXOMBuilderSAXParserTest.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetSAXSource.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetTextWithCDATA.java
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml
    webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java

Propchange: webservices/axiom/branches/AXIOM-201/
------------------------------------------------------------------------------
  Merged /webservices/axiom/branches/AXIOM-437:r1364041-1364239
  Merged /webservices/commons/trunk/modules/axiom:r1361504-1366208
  Merged /webservices/axiom/branches/AXIOM-435:r1361507-1366198

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java Thu Jul 26 22:04:05 2012
@@ -26,6 +26,8 @@ import javax.xml.transform.Transformer;
 import javax.xml.transform.sax.SAXSource;
 
 import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ext.DeclHandler;
 import org.xml.sax.ext.LexicalHandler;
 
 import java.io.OutputStream;
@@ -127,6 +129,21 @@ public interface OMContainer extends OMS
     OMNode getFirstOMChild();
 
     /**
+     * Remove all children from this container. This method has the same effect as the following
+     * code:
+     * 
+     * <pre>
+     * for (Iterator it = container.getChildren(); it.hasNext(); ) {
+     *     it.next();
+     *     it.remove();
+     * }</pre>
+     * 
+     * However, the implementation may do this in an optimized way. In particular, if the node is
+     * incomplete, it may choose not to instantiate child node that would become unreachable anyway.
+     */
+    void removeChildren();
+    
+    /**
      * Serialize the node with caching enabled.
      * <p>
      * This method will always serialize the infoset as plain XML. In particular, any {@link OMText}
@@ -372,8 +389,7 @@ public interface OMContainer extends OMS
      * used with the {@link Transformer} API.
      * <p>
      * The returned object supports all events defined by {@link ContentHandler} and
-     * {@link LexicalHandler}, with the exception of DTD related events. {@link OMDocType} nodes
-     * will be silently skipped.
+     * {@link LexicalHandler}. {@link DTDHandler} and {@link DeclHandler} are not supported.
      * <p>
      * If the node is an element and has a parent which is not a document, care is taken to properly
      * generate {@link ContentHandler#startPrefixMapping(String, String)} and

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocType.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocType.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocType.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDocType.java Thu Jul 26 22:04:05 2012
@@ -22,16 +22,31 @@ package org.apache.axiom.om;
 /** Interface OMDocType */
 public interface OMDocType extends OMNode {
     /**
-     * Returns the value of this DocType.
-     *
-     * @return Returns String.
+     * Get the root name, i.e. the name immediately following the <tt>DOCTYPE</tt> keyword.
+     * 
+     * @return the root name; must not be <code>null</code>
      */
-    String getValue();
+    String getRootName();
 
     /**
-     * Sets the content of this DocType to the specified string.
-     *
-     * @param text
+     * Get the public ID of the external subset.
+     * 
+     * @return the public ID, or <code>null</code> if there is no external subset or no public ID
+     *         has been specified for the external subset
      */
-    void setValue(String text);
+    String getPublicId();
+
+    /**
+     * Get the system ID of the external subset.
+     * 
+     * @return the system ID, or <code>null</code> if there is no external subset
+     */
+    String getSystemId();
+    
+    /**
+     * Get the internal subset.
+     * 
+     * @return the internal subset, or <code>null</code> if there is none
+     */
+    String getInternalSubset();
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java Thu Jul 26 22:04:05 2012
@@ -571,20 +571,6 @@ public interface OMElement extends OMNod
      * @return the cloned element
      */
     OMElement cloneOMElement();
-
-    /**
-     * Clones this element and its descendants. Note that this method will traverse the descendants
-     * and create clones immediately. It will also preserve the original nodes. This means that
-     * after the execution of this method, both the returned clone and the original element will be
-     * completely built.
-     * 
-     * @param options
-     *            the options to use when cloning this element and its descendants; for object
-     *            models with domain specific extensions (such as SOAP), this may be a subclass of
-     *            {@link OMCloneOptions}
-     * @return the cloned element
-     */
-    OMElement cloneOMElement(OMCloneOptions options);
     
     void setLineNumber(int lineNumber);
 

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java Thu Jul 26 22:04:05 2012
@@ -248,8 +248,9 @@ public interface OMFactory {
     /**
      * @param parent
      * @param text
-     * @param type   - this should be either of XMLStreamConstants.CHARACTERS,
-     *               XMLStreamConstants.CDATA, XMLStreamConstants.SPACE, XMLStreamConstants.ENTITY_REFERENCE
+     * @param type
+     *            the node type: {@link OMNode#TEXT_NODE}, {@link OMNode#CDATA_SECTION_NODE} or
+     *            {@link OMNode#SPACE_NODE}
      * @return Returns OMText.
      */
     OMText createOMText(OMContainer parent, String text, int type);
@@ -271,8 +272,9 @@ public interface OMFactory {
 
     /**
      * @param s
-     * @param type - OMText node can handle SPACE, CHARACTERS, CDATA and ENTITY REFERENCES. For
-     *             Constants, use either XMLStreamConstants or constants found in OMNode.
+     * @param type
+     *            the node type: {@link OMNode#TEXT_NODE}, {@link OMNode#CDATA_SECTION_NODE} or
+     *            {@link OMNode#SPACE_NODE}
      * @return Returns OMText.
      */
     OMText createOMText(String s, int type);
@@ -317,13 +319,25 @@ public interface OMFactory {
                                          String value);
 
     /**
-     * Creates DocType/DTD.
+     * Creates DTD (<tt>DOCTYPE</tt> declaration) node.
      *
      * @param parent
-     * @param content
-     * @return Returns doctype.
+     *            the parent to which the newly created text node will be added; this may be
+     *            <code>null</code>
+     * @param rootName
+     *            the root name, i.e. the name immediately following the <tt>DOCTYPE</tt> keyword
+     * @param publicId
+     *            the public ID of the external subset, or <code>null</code> if there is no external
+     *            subset or no public ID has been specified for the external subset
+     * @param systemId
+     *            the system ID of the external subset, or <code>null</code> if there is no external
+     *            subset
+     * @param internalSubset
+     *            the internal subset, or <code>null</code> if there is none
+     * @return the newly created {@link OMDocType} node
      */
-    OMDocType createOMDocType(OMContainer parent, String content);
+    OMDocType createOMDocType(OMContainer parent, String rootName, String publicId, String systemId,
+            String internalSubset);
 
     /**
      * Creates a PI.

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java Thu Jul 26 22:04:05 2012
@@ -27,4 +27,19 @@ public interface OMInformationItem {
      * Get the {@link OMFactory} that created this information item.
      */
     OMFactory getOMFactory();
+
+    /**
+     * Clone this information item. If the information item is a container, then its descendants
+     * will be cloned recursively. Note that in this case, this method will traverse the descendants
+     * and create clones immediately. It will also preserve the original nodes. This means that
+     * after the execution of this method, both the returned clone and the original container will
+     * be completely built.
+     * 
+     * @param options
+     *            the options to use when cloning this element and its descendants; for object
+     *            models with domain specific extensions (such as SOAP), this may be a subclass of
+     *            {@link OMCloneOptions}
+     * @return the cloned element
+     */
+    OMInformationItem clone(OMCloneOptions options);
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMMetaFactory.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMMetaFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMMetaFactory.java Thu Jul 26 22:04:05 2012
@@ -21,12 +21,16 @@ package org.apache.axiom.om;
 
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
 
 import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPModelBuilder;
 import org.apache.axiom.util.stax.xop.MimePartProvider;
+import org.w3c.dom.EntityReference;
 import org.xml.sax.InputSource;
+import org.xml.sax.ext.LexicalHandler;
 
 /**
  * Object model meta factory. This interface encapsulates a particular Axiom implementation and
@@ -112,6 +116,60 @@ public interface OMMetaFactory {
     OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source);
     
     /**
+     * Create an object model builder for plain XML that gets its input from a {@link DOMSource}.
+     * 
+     * @param omFactory
+     *            The object model factory to use. This factory must be obtained from the same
+     *            {@link OMMetaFactory} instance as the one used to invoke this method. In general
+     *            the factory will be retrieved from {@link #getOMFactory()}), but in some cases it
+     *            may be necessary to pass a {@link SOAPFactory} instance, although this method will
+     *            never produce a SOAP infoset.
+     * @param expandEntityReferences
+     *            Determines how {@link EntityReference} nodes are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each {@link EntityReference}. The child nodes of
+     *            {@link EntityReference} nodes are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and the children of {@link EntityReference} nodes are converted and
+     *            inserted into the Axiom tree.
+     *            </ul>
+     * @param source
+     *            the source of the XML document
+     * @return the builder
+     */
+    OMXMLParserWrapper createOMBuilder(OMFactory omFactory, DOMSource source, boolean expandEntityReferences);
+    
+    /**
+     * Create an object model builder for plain XML that gets its input from a {@link SAXSource}.
+     * 
+     * @param omFactory
+     *            The object model factory to use. This factory must be obtained from the same
+     *            {@link OMMetaFactory} instance as the one used to invoke this method. In general
+     *            the factory will be retrieved from {@link #getOMFactory()}), but in some cases it
+     *            may be necessary to pass a {@link SOAPFactory} instance, although this method will
+     *            never produce a SOAP infoset.
+     * @param expandEntityReferences
+     *            Determines how entity references (i.e. {@link LexicalHandler#startEntity(String)}
+     *            and {@link LexicalHandler#endEntity(String)} events) are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each pair of {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events. Other events reported between
+     *            these two events are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events are ignored. However, events
+     *            between {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} are processed normally.
+     *            </ul>
+     * @param source
+     *            the source of the XML document
+     * @return the builder
+     */
+    OMXMLParserWrapper createOMBuilder(OMFactory omFactory, SAXSource source, boolean expandEntityReferences);
+    
+    /**
      * Create an XOP aware object model builder.
      * 
      * @param configuration

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java Thu Jul 26 22:04:05 2012
@@ -26,13 +26,17 @@ import javax.mail.internet.ParseExceptio
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
 
 import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.impl.builder.OMAttachmentAccessorMimePartProvider;
 import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPModelBuilder;
+import org.w3c.dom.EntityReference;
 import org.xml.sax.InputSource;
+import org.xml.sax.ext.LexicalHandler;
 
 /**
  * Provides static factory methods to create various kinds of object model builders from different
@@ -293,6 +297,56 @@ public class OMXMLBuilderFactory {
     }
     
     /**
+     * Create an object model builder that reads a plain XML document from the provided
+     * {@link DOMSource}.
+     * 
+     * @param source
+     *            the source of the XML document
+     * @param expandEntityReferences
+     *            Determines how {@link EntityReference} nodes are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each {@link EntityReference}. The child nodes of
+     *            {@link EntityReference} nodes are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and the children of {@link EntityReference} nodes are converted and
+     *            inserted into the Axiom tree.
+     *            </ul>
+     * @return the builder
+     */
+    public static OMXMLParserWrapper createOMBuilder(DOMSource source, boolean expandEntityReferences) {
+        OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory();
+        return metaFactory.createOMBuilder(metaFactory.getOMFactory(), source, expandEntityReferences);
+    }
+    
+    /**
+     * Create an object model builder that reads a plain XML document from the provided
+     * {@link SAXSource}.
+     * 
+     * @param source
+     *            the source of the XML document
+     * @param expandEntityReferences
+     *            Determines how entity references (i.e. {@link LexicalHandler#startEntity(String)}
+     *            and {@link LexicalHandler#endEntity(String)} events) are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each pair of {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events. Other events reported between
+     *            these two events are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events are ignored. However, events
+     *            between {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} are processed normally.
+     *            </ul>
+     * @return the builder
+     */
+    public static OMXMLParserWrapper createOMBuilder(SAXSource source, boolean expandEntityReferences) {
+        OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory();
+        return metaFactory.createOMBuilder(metaFactory.getOMFactory(), source, expandEntityReferences);
+    }
+    
+    /**
      * Create an object model builder that reads an XML document from the provided {@link Source}
      * using a specified object model factory.
      * 
@@ -302,11 +356,64 @@ public class OMXMLBuilderFactory {
      *            the source of the XML document
      * @return the builder
      */
+    // TODO: update Javadoc to explain relationship with the methods that take a DOMSource or SAXSource
     public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source) {
         return omFactory.getMetaFactory().createOMBuilder(omFactory, source);
     }
     
     /**
+     * Create an object model builder that reads an XML document from the provided {@link DOMSource}
+     * using a specified object model factory.
+     * 
+     * @param omFactory
+     *            the object model factory to use
+     * @param source
+     *            the source of the XML document
+     * @param expandEntityReferences
+     *            Determines how {@link EntityReference} nodes are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each {@link EntityReference}. The child nodes of
+     *            {@link EntityReference} nodes are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and the children of {@link EntityReference} nodes are converted and
+     *            inserted into the Axiom tree.
+     *            </ul>
+     * @return the builder
+     */
+    public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, DOMSource source, boolean expandEntityReferences) {
+        return omFactory.getMetaFactory().createOMBuilder(omFactory, source, expandEntityReferences);
+    }
+    
+    /**
+     * Create an object model builder that reads an XML document from the provided {@link SAXSource}
+     * using a specified object model factory.
+     * 
+     * @param omFactory
+     *            the object model factory to use
+     * @param source
+     *            the source of the XML document
+     * @param expandEntityReferences
+     *            Determines how entity references (i.e. {@link LexicalHandler#startEntity(String)}
+     *            and {@link LexicalHandler#endEntity(String)} events) are handled:
+     *            <ul>
+     *            <li>If the parameter is <code>false</code> then a single {@link OMEntityReference}
+     *            will be created for each pair of {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events. Other events reported between
+     *            these two events are not taken into account.
+     *            <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes
+     *            are created and {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} events are ignored. However, events
+     *            between {@link LexicalHandler#startEntity(String)} and
+     *            {@link LexicalHandler#endEntity(String)} are processed normally.
+     *            </ul>
+     * @return the builder
+     */
+    public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, SAXSource source, boolean expandEntityReferences) {
+        return omFactory.getMetaFactory().createOMBuilder(omFactory, source, expandEntityReferences);
+    }
+    
+    /**
      * Create an XOP aware model builder from the provided {@link Attachments} object and with a
      * given parser configuration.
      * 

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java Thu Jul 26 22:04:05 2012
@@ -32,12 +32,7 @@ public interface OMXMLParserWrapper {
     int next() throws OMException;
 
     /**
-     * Discards the current element. This will remove the given element and its descendants.
-     *
-     * @param el
-     * @throws OMException
-     *
-     * @throws OMException
+     * @deprecated Use {@link OMNode#discard()} to discard elements.
      */
     void discard(OMElement el) throws OMException;
 

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java Thu Jul 26 22:04:05 2012
@@ -25,6 +25,7 @@ import org.apache.axiom.om.OMAbstractFac
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMInformationItem;
 import org.apache.axiom.om.OMMetaFactory;
@@ -41,6 +42,7 @@ import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
 import org.w3c.dom.Node;
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
@@ -90,6 +92,10 @@ import org.w3c.dom.Text;
  * <td>{@link OMProcessingInstruction}</td>
  * <td>{@link ProcessingInstruction}</td>
  * </tr>
+ * <tr>
+ * <td>{@link OMEntityReference}</td>
+ * <td>{@link EntityReference}</td>
+ * </tr>
  * </table>
  * <dl>
  * <dt>[1]

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java Thu Jul 26 22:04:05 2012
@@ -36,7 +36,6 @@ import org.apache.axiom.attachments.life
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerWriter;
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.util.CommonUtils;
@@ -49,7 +48,6 @@ import org.apache.axiom.util.stax.xop.XO
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-
 /**
  * MTOMXMLStreamWriter is an XML + Attachments stream writer.
  * 
@@ -577,23 +575,6 @@ public class MTOMXMLStreamWriter impleme
         return os;
     }
     
-    /**
-     * Writes the relevant output.
-     *
-     * @param writer
-     * @throws XMLStreamException
-     */
-    private void writeOutput(OMText textNode) throws XMLStreamException {
-        int type = textNode.getType();
-        if (type == OMNode.TEXT_NODE || type == OMNode.SPACE_NODE) {
-            writeCharacters(textNode.getText());
-        } else if (type == OMNode.CDATA_SECTION_NODE) {
-            writeCData(textNode.getText());
-        } else if (type == OMNode.ENTITY_REFERENCE_NODE) {
-            writeEntityRef(textNode.getText());
-        }
-    }
-    
     public void setFilter(XMLStreamWriterFilter filter) {
         if (filter != null) {
             if (log.isDebugEnabled()) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java Thu Jul 26 22:04:05 2012
@@ -23,6 +23,7 @@ import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMProcessingInstruction;
@@ -51,10 +52,13 @@ public interface OMFactoryEx extends OMF
     
     OMComment createOMComment(OMContainer parent, String content, boolean fromBuilder);
     
-    OMDocType createOMDocType(OMContainer parent, String content, boolean fromBuilder);
+    OMDocType createOMDocType(OMContainer parent, String rootName, String publicId, String systemId,
+            String internalSubset, boolean fromBuilder);
     
     OMProcessingInstruction createOMProcessingInstruction(OMContainer parent,
             String piTarget, String piData, boolean fromBuilder);
     
+    OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder);
+    
     OMNode importNode(OMNode child);
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/SAXOMBuilder.java Thu Jul 26 22:04:05 2012
@@ -35,6 +35,7 @@ import org.apache.axiom.om.impl.OMNodeEx
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
+import org.xml.sax.ext.DeclHandler;
 import org.xml.sax.ext.LexicalHandler;
 import org.xml.sax.helpers.DefaultHandler;
 
@@ -43,9 +44,36 @@ import java.util.List;
 
 import javax.xml.XMLConstants;
 
-public class SAXOMBuilder extends DefaultHandler implements LexicalHandler, OMXMLParserWrapper {
+public class SAXOMBuilder extends DefaultHandler implements LexicalHandler, DeclHandler, OMXMLParserWrapper {
+    private final boolean expandEntityReferences;
+    
     private OMDocument document;
     
+    /**
+     * Stores the root name if there is a DTD.
+     */
+    private String dtdName;
+    
+    /**
+     * Stores the public ID if there is a DTD.
+     */
+    private String dtdPublicId;
+    
+    /**
+     * Stores the system ID if there is a DTD.
+     */
+    private String dtdSystemId;
+    
+    /**
+     * Stores the internal subset if there is a DTD.
+     */
+    private StringBuilder internalSubset;
+    
+    /**
+     * Flag indicating that the parser is processing the external subset.
+     */
+    private boolean inExternalSubset;
+    
     OMElement root = null;
 
     OMNode lastNode = null;
@@ -57,9 +85,16 @@ public class SAXOMBuilder extends Defaul
     List prefixMappings = new ArrayList();
     
     int textNodeType = OMNode.TEXT_NODE;
+    
+    private boolean inEntityReference;
 
-    public SAXOMBuilder(OMFactory factory) {
+    public SAXOMBuilder(OMFactory factory, boolean expandEntityReferences) {
         this.factory = (OMFactoryEx)factory;
+        this.expandEntityReferences = expandEntityReferences;
+    }
+    
+    public SAXOMBuilder(OMFactory factory) {
+        this(factory, true);
     }
     
     public SAXOMBuilder() {
@@ -95,10 +130,101 @@ public class SAXOMBuilder extends Defaul
     }
 
     public void startDTD(String name, String publicId, String systemId) throws SAXException {
-//        addNode(factory.createOMDocType(getContainer(), ""));
+        dtdName = name;
+        dtdPublicId = publicId;
+        dtdSystemId = systemId;
+        internalSubset = new StringBuilder();
+    }
+
+    public void elementDecl(String name, String model) throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!ELEMENT ");
+            internalSubset.append(name);
+            internalSubset.append(' ');
+            internalSubset.append(model);
+            internalSubset.append(">\n");
+        }
+    }
+
+    public void attributeDecl(String eName, String aName, String type, String mode, String value)
+            throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!ATTLIST ");
+            internalSubset.append(eName);
+            internalSubset.append(' ');
+            internalSubset.append(aName);
+            internalSubset.append(' ');
+            internalSubset.append(type);
+            if (value != null) {
+                internalSubset.append(' ');
+                internalSubset.append(value);
+            }
+            internalSubset.append(">\n");
+        }
+    }
+
+    public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!ENTITY ");            
+            internalSubset.append(name);
+            if (publicId != null) {
+                internalSubset.append(" PUBLIC \"");
+                internalSubset.append(publicId);
+            } else {
+                internalSubset.append(" SYSTEM \"");
+                internalSubset.append(systemId);
+            }
+            internalSubset.append("\">\n");
+        }
+    }
+
+    public void internalEntityDecl(String name, String value) throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!ENTITY ");
+            internalSubset.append(name);
+            internalSubset.append(" \"");
+            internalSubset.append(value);
+            internalSubset.append("\">\n");
+        }
+    }
+
+    public void notationDecl(String name, String publicId, String systemId) throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!NOTATION ");            
+            internalSubset.append(name);
+            if (publicId != null) {
+                internalSubset.append(" PUBLIC \"");
+                internalSubset.append(publicId);
+            } else {
+                internalSubset.append(" SYSTEM \"");
+                internalSubset.append(systemId);
+            }
+            internalSubset.append("\">\n");
+        }
+    }
+
+    public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
+            throws SAXException {
+        if (!inExternalSubset) {
+            internalSubset.append("<!ENTITY ");
+            internalSubset.append(name);
+            if (publicId != null) {
+                internalSubset.append(" PUBLIC \"");
+                internalSubset.append(publicId);
+            } else {
+                internalSubset.append(" SYSTEM \"");
+                internalSubset.append(systemId);
+            }
+            internalSubset.append("\" NDATA ");
+            internalSubset.append(notationName);
+            internalSubset.append(">\n");
+        }
     }
 
     public void endDTD() throws SAXException {
+        addNode(factory.createOMDocType(getContainer(), dtdName, dtdPublicId, dtdSystemId,
+                internalSubset.length() == 0 ? null : internalSubset.toString(), true));
+        internalSubset = null;
     }
 
     protected OMElement createNextElement(String localName) throws OMException {
@@ -210,7 +336,9 @@ public class SAXOMBuilder extends Defaul
 
     public void characters(char[] ch, int start, int length)
             throws SAXException {
-        characterData(ch, start, length, textNodeType);
+        if (!inEntityReference) {
+            characterData(ch, start, length, textNodeType);
+        }
     }
     
     public void ignorableWhitespace(char[] ch, int start, int length)
@@ -235,9 +363,20 @@ public class SAXOMBuilder extends Defaul
     }
 
     public void startEntity(String name) throws SAXException {
+        if (name.equals("[dtd]")) {
+            inExternalSubset = true;
+        } else if (!expandEntityReferences) {
+            addNode(factory.createOMEntityReference(getContainer(), name, null, true));
+            inEntityReference = true;
+        }
     }
 
     public void endEntity(String name) throws SAXException {
+        if (name.equals("[dtd]")) {
+            inExternalSubset = false;
+        } else {
+            inEntityReference = false;
+        }
     }
 
     public OMDocument getDocument() {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java Thu Jul 26 22:04:05 2012
@@ -40,6 +40,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
@@ -272,48 +273,60 @@ public abstract class StAXBuilder implem
         }
     }
 
-    /**
-     * Method discard.
-     *
-     * @param element
-     * @throws OMException
-     */
+    // For compatibility only
     public void discard(OMElement element) throws OMException {
+        discard((OMContainer)element);
+        element.discard();
+    }
+    
+    public void discard(OMContainer container) throws OMException {
 
 //        if (element.isComplete() || !cache) {
 //            throw new OMException();
 //        }
         try {
 
-            // Calculate the depth of the element to be discarded. This determines how many
-            // END_ELEMENT events we need to consume.
-            int targetDepth = elementLevel-1;
-            OMContainerEx current = target;
-            while (current != element) {
-                if (current instanceof OMElement) {
-                    targetDepth--;
-                    current = (OMContainerEx)((OMElement)current).getParent();
-                } else {
-                    throw new OMException("Called discard for an element that is not being built by this builder");
+            if (container instanceof OMDocument) {
+                if (container != document) {
+                    throw new OMException("Called discard for a document that is not being built by this builder");
+                }
+                while (parserNext() != XMLStreamConstants.END_DOCUMENT) {
+                    // Just loop
+                }
+            } else {
+                // Calculate the depth of the element to be discarded. This determines how many
+                // END_ELEMENT events we need to consume.
+                int targetDepth = elementLevel-1;
+                OMContainerEx current = target;
+                while (current != container) {
+                    if (current instanceof OMElement) {
+                        targetDepth--;
+                        current = (OMContainerEx)((OMElement)current).getParent();
+                    } else {
+                        throw new OMException("Called discard for an element that is not being built by this builder");
+                    }
+                }
+                while (elementLevel > targetDepth) {
+                    parserNext();
                 }
-            }
-            
-            while (elementLevel > targetDepth) {
-                parserNext();
             }
 
             // Mark nodes as discarded
-            current = target;
+            OMContainerEx current = target;
             while (true) {
                 current.discarded();
-                if (current == element) {
+                if (current == container) {
                     break;
                 }
                 current = (OMContainerEx)((OMElement)current).getParent();
             }
             
-            target = (OMContainerEx)element.getParent();
-            element.detach();
+            if (container instanceof OMDocument) {
+                target = null;
+                done = true;
+            } else {
+                target = (OMContainerEx)((OMElement)container).getParent();
+            }
         } catch (XMLStreamException e) {
             throw new OMException(e);
         } 

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java Thu Jul 26 22:04:05 2012
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.om.impl.builder;
 
+import org.apache.axiom.ext.stax.DTDReader;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
@@ -238,6 +239,7 @@ public class StAXOMBuilder extends StAXB
                     case XMLStreamConstants.END_DOCUMENT:
                         done = true;
                         ((OMContainerEx) this.document).setComplete(true);
+                        target = null;
                         break;
                     case XMLStreamConstants.SPACE:
                         try {
@@ -262,7 +264,7 @@ public class StAXOMBuilder extends StAXB
                         createPI();
                         break;
                     case XMLStreamConstants.ENTITY_REFERENCE:
-                        createOMText(XMLStreamConstants.ENTITY_REFERENCE);
+                        createEntityReference();
                         break;
                     default :
                         throw new OMException();
@@ -445,10 +447,22 @@ public class StAXOMBuilder extends StAXB
      * @throws OMException
      */
     protected OMNode createDTD() throws OMException {
-        if (!parser.hasText()) {
-            return null;
+        DTDReader dtdReader;
+        try {
+            dtdReader = (DTDReader)parser.getProperty(DTDReader.PROPERTY);
+        } catch (IllegalArgumentException ex) {
+            dtdReader = null;
+        }
+        if (dtdReader == null) {
+            throw new OMException("Cannot create OMDocType because the XMLStreamReader doesn't support the DTDReader extension");
+        }
+        String internalSubset = getDTDText();
+        // Woodstox returns an empty string if there is no internal subset
+        if (internalSubset != null && internalSubset.length() == 0) {
+            internalSubset = null;
         }
-        return omfactory.createOMDocType(target, getDTDText(), true);
+        return omfactory.createOMDocType(target, dtdReader.getRootName(), dtdReader.getPublicId(),
+                dtdReader.getSystemId(), internalSubset, true);
     }
     
     /**
@@ -493,6 +507,10 @@ public class StAXOMBuilder extends StAXB
         return omfactory.createOMProcessingInstruction(target, parser.getPITarget(), parser.getPIData(), true);
     }
 
+    protected OMNode createEntityReference() {
+        return omfactory.createOMEntityReference(target, parser.getLocalName(), parser.getText(), true);
+    }
+    
     protected void endElement() {
         target.setComplete(true);
         target = (OMContainerEx)((OMElement)target).getParent();

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/jaxp/OMSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/jaxp/OMSource.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/jaxp/OMSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/jaxp/OMSource.java Thu Jul 26 22:04:05 2012
@@ -24,15 +24,19 @@ import javax.xml.transform.sax.SAXSource
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.serialize.OMXMLReader;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
 import org.xml.sax.InputSource;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
 
 /**
  * Implementation of {@link javax.xml.transform.Source} for AXIOM.
  * The implementation is based on {@link SAXSource} and directly transforms an AXIOM
  * tree into a stream of SAX events using {@link OMXMLReader}.
  * <p>
- * Note that {@link org.apache.axiom.om.OMDocType} nodes are not supported and will be
- * silently skipped.
+ * Note that this class only supports {@link ContentHandler} and {@link LexicalHandler}.
+ * {@link DTDHandler} and {@link DeclHandler} are not supported.
  * <p>
  * <b>NOTE: As of version 1.2.13, application code should use
  * {@link OMContainer#getSAXSource(boolean)} instead of instantiating this class directly.</b>

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/OMXMLReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/OMXMLReader.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/OMXMLReader.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/OMXMLReader.java Thu Jul 26 22:04:05 2012
@@ -29,8 +29,10 @@ import java.util.Set;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMProcessingInstruction;
@@ -38,17 +40,20 @@ import org.apache.axiom.om.OMText;
 import org.apache.axiom.util.sax.AbstractXMLReader;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
 
 /**
  * SAX {@link XMLReader} implementation that traverses a given OM tree and invokes the
  * callback methods on the configured {@link ContentHandler}. This can be used to
  * serialize an Axiom tree to SAX.
  * <p>
- * Note that this class doesn't support serializing {@link org.apache.axiom.om.OMDocType}
- * nodes. They will be silently skipped.
+ * Note that this class only supports {@link ContentHandler} and {@link LexicalHandler}.
+ * {@link DTDHandler} and {@link DeclHandler} are not supported.
  * <p>
  * This class can also generate SAX events for a subtree. This is the case if the
  * element passed to the constructor is not the root element of the document. In this
@@ -177,6 +182,13 @@ public class OMXMLReader extends Abstrac
         for (Iterator it = parent.getChildren(); it.hasNext(); ) {
             OMNode node = (OMNode)it.next();
             switch (node.getType()) {
+                case OMNode.DTD_NODE:
+                    if (lexicalHandler != null) {
+                        OMDocType doctype = (OMDocType)node;
+                        lexicalHandler.startDTD(doctype.getRootName(), doctype.getPublicId(), doctype.getSystemId());
+                        lexicalHandler.endDTD();
+                    }
+                    break;
                 case OMNode.ELEMENT_NODE:
                     generateEvents((OMElement)node);
                     break;
@@ -204,6 +216,12 @@ public class OMXMLReader extends Abstrac
                 case OMNode.PI_NODE:
                     OMProcessingInstruction pi = (OMProcessingInstruction)node;
                     contentHandler.processingInstruction(pi.getTarget(), pi.getValue());
+                    break;
+                case OMNode.ENTITY_REFERENCE_NODE:
+                    contentHandler.skippedEntity(((OMEntityReference)node).getName());
+                    break;
+                default:
+                    throw new IllegalStateException("Unrecognized node type " + node.getType());
             }
         }
     }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java Thu Jul 26 22:04:05 2012
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.om.impl.serialize;
 
+import org.apache.axiom.ext.stax.DTDReader;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerWriter;
 import org.apache.axiom.om.OMDataSource;
@@ -193,6 +194,12 @@ public class StreamingOMSerializer imple
                     } catch (Exception e) {
                         //TODO: log exceptions
                     }
+                    break;
+                case DTD:
+                    serializeDTD(reader, writer);
+                    break;
+                case ENTITY_REFERENCE:
+                    writer.writeEntityRef(reader.getLocalName());
                 }
             }
             if (depth == 0) {
@@ -623,4 +630,18 @@ public class StreamingOMSerializer imple
             throw new XMLStreamException("Error while reading data handler", ex);
         }
     }
+
+    private void serializeDTD(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+        DTDReader dtdReader;
+        try {
+            dtdReader = (DTDReader)reader.getProperty(DTDReader.PROPERTY);
+        } catch (IllegalArgumentException ex) {
+            dtdReader = null;
+        }
+        if (dtdReader == null) {
+            throw new XMLStreamException("Cannot serialize the DTD because the XMLStreamReader doesn't support the DTDReader extension");
+        }
+        XMLStreamWriterUtils.writeDTD(writer, dtdReader.getRootName(), dtdReader.getPublicId(),
+                dtdReader.getSystemId(), reader.getText());
+    }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/CopyUtils.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/CopyUtils.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/CopyUtils.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/CopyUtils.java Thu Jul 26 22:04:05 2012
@@ -20,7 +20,7 @@ package org.apache.axiom.om.util;
 
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMDocument;
-import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMInformationItem;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.soap.SOAPCloneOptions;
@@ -50,7 +50,7 @@ public class CopyUtils {
 
     /**
      * @deprecated This method has the same effect as calling
-     *             {@link OMElement#cloneOMElement(OMCloneOptions)} on the source
+     *             {@link OMInformationItem#clone(OMCloneOptions)} on the source
      *             {@link SOAPEnvelope} with the following options enabled:
      *             <ul>
      *             <li>{@link OMCloneOptions#setFetchDataHandlers(boolean)}
@@ -58,7 +58,7 @@ public class CopyUtils {
      *             <li>{@link OMCloneOptions#setCopyOMDataSources(boolean)}
      *             </ul>
      *             Instead of using this method, application code should use
-     *             {@link OMElement#cloneOMElement(OMCloneOptions)} directly and fine tune the
+     *             {@link OMInformationItem#clone(OMCloneOptions)} directly and fine tune the
      *             options for the particular use case.
      */
     public static SOAPEnvelope copy(SOAPEnvelope sourceEnv) {
@@ -66,7 +66,7 @@ public class CopyUtils {
         options.setFetchDataHandlers(true);
         options.setPreserveModel(true);
         options.setCopyOMDataSources(true);
-        return (SOAPEnvelope)sourceEnv.cloneOMElement(options);
+        return (SOAPEnvelope)sourceEnv.clone(options);
     }
 
     /**

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/om/util/StAXUtils.java Thu Jul 26 22:04:05 2012
@@ -240,6 +240,29 @@ public class StAXUtils {
         }
     }
 
+    public static XMLStreamReader createXMLStreamReader(StAXParserConfiguration configuration,
+            final String systemId, final InputStream in) throws XMLStreamException {
+        
+        final XMLInputFactory inputFactory = getXMLInputFactory(configuration);
+        try {
+            XMLStreamReader reader = 
+                (XMLStreamReader)
+                AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    public Object run() throws XMLStreamException {
+                        return inputFactory.createXMLStreamReader(systemId, in);
+                    }
+                }
+                );
+            
+            if (log.isDebugEnabled()) {
+                log.debug("XMLStreamReader is " + reader.getClass().getName());
+            }
+            return reader;
+        } catch (PrivilegedActionException pae) {
+            throw (XMLStreamException) pae.getException();
+        }
+    }
+
     public static XMLStreamReader createXMLStreamReader(Reader in)
             throws XMLStreamException {
         

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java Thu Jul 26 22:04:05 2012
@@ -376,12 +376,16 @@ public class StAXSOAPModelBuilder extend
 
     /** Method createDTD. Overriding the default behaviour as a SOAPMessage should not have a DTD. */
     protected OMNode createDTD() throws OMException {
-        throw new OMException("SOAP message MUST NOT contain a Document Type Declaration(DTD)");
+        throw new SOAPProcessingException("SOAP message MUST NOT contain a Document Type Declaration(DTD)");
     }
 
     /** Method createPI. Overriding the default behaviour as a SOAP Message should not have a PI. */
     protected OMNode createPI() throws OMException {
-        throw new OMException("SOAP message MUST NOT contain Processing Instructions(PI)");
+        throw new SOAPProcessingException("SOAP message MUST NOT contain Processing Instructions(PI)");
+    }
+
+    protected OMNode createEntityReference() {
+        throw new SOAPProcessingException("A SOAP message cannot contain entity references because it must not have a DTD");
     }
 
     // Necessary to allow SOAPBuilderHelper to access this method