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/14 22:44:45 UTC
svn commit: r1361584 - in /webservices/axiom/branches/AXIOM-435: ./
modules/axiom-api/src/main/java/org/apache/axiom/om/
modules/axiom-api/src/main/java/org/apache/axiom/util/stax/
modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common...
Author: veithen
Date: Sat Jul 14 20:44:45 2012
New Revision: 1361584
URL: http://svn.apache.org/viewvc?rev=1361584&view=rev
Log:
Merged latest changes from trunk.
Added:
webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
- copied unchanged from r1361583, webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
Modified:
webservices/axiom/branches/AXIOM-435/ (props changed)
webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java
webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java
webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
webservices/axiom/branches/AXIOM-435/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
Propchange: webservices/axiom/branches/AXIOM-435/
------------------------------------------------------------------------------
Merged /webservices/commons/trunk/modules/axiom:r1361523-1361583
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/OMXMLBuilderFactory.java Sat Jul 14 20:44:45 2012
@@ -302,6 +302,7 @@ public class OMXMLBuilderFactory {
* the source of the XML document
* @return the builder
*/
+ // TODO: if the source is a SAXSource or DOMSource and the document has a DTD, then Axiom will remove the DTD (or even fail); fix this and/or specify the behavior
public static OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source) {
return omFactory.getMetaFactory().createOMBuilder(omFactory, source);
}
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/AbstractXMLStreamReader.java Sat Jul 14 20:44:45 2012
@@ -19,6 +19,7 @@
package org.apache.axiom.util.stax;
+import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -30,6 +31,10 @@ import javax.xml.stream.XMLStreamReader;
* implementation.
*/
public abstract class AbstractXMLStreamReader implements XMLStreamReader {
+ public Location getLocation() {
+ return DummyLocation.INSTANCE;
+ }
+
/**
* @return Returns boolean.
* @see javax.xml.stream.XMLStreamReader#hasText()
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java Sat Jul 14 20:44:45 2012
@@ -31,7 +31,6 @@ import java.util.Stack;
import javax.activation.DataHandler;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -58,7 +57,6 @@ import org.apache.axiom.om.impl.builder.
import org.apache.axiom.om.impl.exception.OMStreamingException;
import org.apache.axiom.util.namespace.MapBasedNamespaceContext;
import org.apache.axiom.util.stax.AbstractXMLStreamReader;
-import org.apache.axiom.util.stax.DummyLocation;
import org.apache.axiom.util.stax.XMLStreamReaderUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -1174,15 +1172,6 @@ class SwitchingWrapper extends AbstractX
}
/**
- * Method getLocation.
- *
- * @return Returns Location.
- */
- public Location getLocation() {
- return DummyLocation.INSTANCE;
- }
-
- /**
* Method getVersion.
*
* @return Returns String.
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java Sat Jul 14 20:44:45 2012
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.common.
import javax.xml.stream.XMLStreamException;
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.OMException;
@@ -99,6 +100,8 @@ public abstract class AbstractOMMetaFact
public OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Source source) {
if (source instanceof SAXSource) {
return new SAXOMXMLParserWrapper(omFactory, (SAXSource)source);
+ } else if (source instanceof DOMSource) {
+ return new StAXOMBuilder(omFactory, new DOMXMLStreamReader(((DOMSource)source).getNode()));
} else {
try {
return new StAXOMBuilder(omFactory, StAXUtils.getXMLInputFactory().createXMLStreamReader(source));
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java Sat Jul 14 20:44:45 2012
@@ -49,16 +49,11 @@ public class OMImplementationTest extend
// TODO: this case is not working because Axiom generates an XML declaration
// but uses another charset encoding to serialize the document
builder.exclude(TestSerialize.class, "(&(file=iso-8859-1.xml)(container=document))");
+ builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=iso-8859-1.xml)");
// TODO: this case is not working because Axiom doesn't serialize the DTD
builder.exclude(TestSerialize.class, "(&(file=spaces.xml)(container=document))");
- // TODO: CDATA sections are lost when using createOMBuilder with a DOMSource
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(|(file=cdata.xml)(file=test.xml))");
-
- // TODO: suspecting Woodstox bug here
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=spaces.xml)");
-
// TODO: investigate why this is not working with DOOM
builder.exclude(TestGetChildrenWithName4.class);
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java?rev=1361584&r1=1361583&r2=1361584&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java Sat Jul 14 20:44:45 2012
@@ -23,7 +23,6 @@ import junit.framework.TestSuite;
import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
import org.apache.axiom.ts.om.OMTestSuiteBuilder;
-import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource;
import org.apache.axiom.ts.om.container.TestSerialize;
import org.apache.axiom.ts.om.document.TestDigest;
import org.apache.axiom.ts.om.element.TestGetXMLStreamReaderWithOMSourcedElementDescendant;
@@ -47,12 +46,6 @@ public class OMImplementationTest extend
// TODO: this case is not working because Axiom doesn't serialize the DTD
builder.exclude(TestSerialize.class, "(&(file=spaces.xml)(container=document))");
- // TODO: CDATA sections are lost when using createOMBuilder with a DOMSource
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(|(file=cdata.xml)(file=test.xml))");
-
- // TODO: suspecting Woodstox bug here
- builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=spaces.xml)");
-
// TODO: if there is a comment node surrounded by text, then these text nodes need to be merged
builder.exclude(TestDigest.class, "(|(file=digest3.xml)(file=digest4.xml))");