abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r493154 - in /incubator/abdera/java/trunk: build/ dependencies/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Fri, 05 Jan 2007 19:34:39 GMT
Author: jmsnell
Date: Fri Jan  5 11:34:38 2007
New Revision: 493154

URL: http://svn.apache.org/viewvc?view=rev&rev=493154
Log:
Move up to Axiom version 1.2.1
For some reason the Stax Reference Impl version we're using doesn't work properly with xml:lang
and xml:base attributes.
(it outputs xmlns:lang and xmlns:base).  For now, I've removed the stax ref impl from the
dependency chain (meaning that
we're using Woodstox by default).

Unfortunately, Axiom 1.2.1 jars don't seem to be available in the maven repo so, for now,
I've uploaded them to 
people.apache.org/~jmsnell for our download process.

Axiom 1.0 had a bug that did not properly handle namespace declarations.  This is fixed in
1.2.1 so I commented out
the workaround.

Modified:
    incubator/abdera/java/trunk/build/build.xml
    incubator/abdera/java/trunk/dependencies/deps.properties
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Modified: incubator/abdera/java/trunk/build/build.xml
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/build/build.xml?view=diff&rev=493154&r1=493153&r2=493154
==============================================================================
--- incubator/abdera/java/trunk/build/build.xml (original)
+++ incubator/abdera/java/trunk/build/build.xml Fri Jan  5 11:34:38 2007
@@ -141,7 +141,7 @@
           <available file="${dependencies}/${axiom.impl.jar}" />
           <available file="${dependencies}/${jaxen.jar}" />
           <available file="${dependencies}/${log4j.jar}" />
-          <available file="${dependencies}/${stax.jar}" />
+          <!--available file="${dependencies}/${stax.jar}" /-->
           <available file="${dependencies}/${stax.api.jar}" />
           <available file="${dependencies}/${commons.logging.jar}" />
           <available file="${dependencies}/${commons.codec.jar}" />
@@ -559,9 +559,9 @@
       <get src="${log4j.dir}/${log4j.jar}"
            dest="${dependencies}/${log4j.jar}"
            usetimestamp="true" />
-      <get src="${stax.dir}/${stax.jar}"
+      <!--get src="${stax.dir}/${stax.jar}"
            dest="${dependencies}/${stax.jar}"
-           usetimestamp="true" />
+           usetimestamp="true" /-->
       <get src="${stax.dir}/${stax.api.jar}"
            dest="${dependencies}/${stax.api.jar}"
            usetimestamp="true" />

Modified: incubator/abdera/java/trunk/dependencies/deps.properties
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/deps.properties?view=diff&rev=493154&r1=493153&r2=493154
==============================================================================
--- incubator/abdera/java/trunk/dependencies/deps.properties (original)
+++ incubator/abdera/java/trunk/dependencies/deps.properties Fri Jan  5 11:34:38 2007
@@ -1,9 +1,12 @@
 geronimo.activation.dir=http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars
 geronimo.activation.jar=geronimo-activation_1.0.2_spec-1.1.jar
 
-axiom.dir=http://www.apache.org/dist/java-repository/ws-commons/jars
-axiom.api.jar=axiom-api-1.0.jar
-axiom.impl.jar=axiom-impl-1.0.jar
+#axiom.dir=http://www.apache.org/dist/java-repository/ws-commons/jars
+#axiom.api.jar=axiom-api-1.0.jar
+#axiom.impl.jar=axiom-impl-1.0.jar
+axiom.dir=http://people.apache.org/~jmsnell
+axiom.api.jar=axiom-api-1.2.1.jar
+axiom.impl.jar=axiom-impl-1.2.1.jar
 
 jaxen.dir=http://dist.codehaus.org/jaxen/jars
 jaxen.jar=jaxen-1.1-beta-7.jar
@@ -12,9 +15,12 @@
 log4j.jar=log4j-1.2.12.jar
 
 stax.dir=http://dist.codehaus.org/stax/jars
-stax.jar=stax-1.1.2-dev.jar
+#stax.jar=stax-1.1.2-dev.jar
 stax.api.jar=stax-api-1.0.jar
 
+wstx.dir=http://woodstox.codehaus.org/2.0.5
+wstx.jar=wstx-asl-2.0.5.jar
+
 commons.logging.dir=http://www.apache.org/dist/java-repository/commons-logging/jars
 commons.logging.jar=commons-logging-1.0.4.jar
 
@@ -33,10 +39,6 @@
 geronimo.servlet.dir=http://www.apache.org/dist/java-repository/org.apache.geronimo.specs/jars
 geronimo.servlet.jar=geronimo-servlet_2.4_spec-1.0.jar
 
-axiom.dir=http://www.apache.org/dist/java-repository/ws-commons/jars
-axiom.api.jar=axiom-api-1.0.jar
-axiom.impl.jar=axiom-impl-1.0.jar
-
 jaxen.dir=http://dist.codehaus.org/jaxen/jars
 jaxen.jar=jaxen-1.1-beta-7.jar
 
@@ -58,9 +60,6 @@
 
 junit.dir=http://www.ibiblio.org/maven/junit/jars
 junit.jar=junit-3.8.1.jar
-
-wstx.dir=http://woodstox.codehaus.org/2.0.5
-wstx.jar=wstx-asl-2.0.5.jar
 
 retroweaver.dir=http://easynews.dl.sourceforge.net/sourceforge/retroweaver
 retroweaver.zip=retroweaver-1.2.3.zip

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java?view=diff&rev=493154&r1=493153&r2=493154
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Fri Jan  5 11:34:38 2007
@@ -291,7 +291,7 @@
                 value, namespace);
       }
     }
-}
+  }  
   
   @Override
   protected void endElement() {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?view=diff&rev=493154&r1=493153&r2=493154
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Fri Jan  5 11:34:38 2007
@@ -29,7 +29,7 @@
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.iri.IRI;
 import org.apache.abdera.util.iri.IRISyntaxException;
-import org.apache.axiom.attachments.DataHandlerUtils;
+import org.apache.axiom.attachments.utils.DataHandlerUtils;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?view=diff&rev=493154&r1=493153&r2=493154
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Fri Jan  5 11:34:38 2007
@@ -31,7 +31,7 @@
 import javax.activation.MimeTypeParseException;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
+//import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Base;
@@ -93,12 +93,9 @@
     OMFactory factory) 
       throws OMException {
     super(
-        qname.getLocalPart(), 
-        factory.createOMNamespace(
-          qname.getNamespaceURI(), 
-          qname.getPrefix()),
-        parent,
-        factory);
+      qname.getLocalPart(), 
+      getOrCreateNamespace(qname,parent,factory),
+      parent,factory);
   }
 
   public FOMElement(
@@ -116,6 +113,21 @@
         factory);
   }
     
+  private static OMNamespace getOrCreateNamespace(
+    QName qname, 
+    OMContainer parent, 
+    OMFactory factory) {
+      String namespace = qname.getNamespaceURI();
+      String prefix = qname.getPrefix();
+      if (parent != null && parent instanceof OMElement) {
+        OMNamespace ns = ((OMElement)parent).findNamespace(namespace, prefix);
+        if (ns != null) return ns;
+      }
+      return factory.createOMNamespace(
+        qname.getNamespaceURI(), 
+        qname.getPrefix());
+  }
+  
   protected Element getWrapped(Element internal) {
     if (internal == null) return null;
     FOMFactory factory = (FOMFactory) getFactory();
@@ -589,20 +601,23 @@
     return (Factory) this.factory;
   }
 
-  @Override
-  protected void internalSerialize(
-    XMLStreamWriter writer, 
-    boolean bool) throws XMLStreamException {
-    if (this.getNamespace() != null)
-      this.declareNamespace(this.getNamespace());
-    Iterator i = this.getAllAttributes();
-    while (i.hasNext()) {
-      OMAttribute attr = (OMAttribute) i.next();
-      if (attr.getNamespace() != null)
-        this.declareNamespace(attr.getNamespace());
-    }
-    super.internalSerialize(writer, bool);
-  }
+// This appears to no longer be necessary with Axiom 1.2
+//
+//  @Override
+//  protected void internalSerialize(
+//    XMLStreamWriter writer, 
+//    boolean bool) throws XMLStreamException {
+//    if (this.getNamespace() != null) {
+//      this.declareNamespace(this.getNamespace());
+//    }
+//    Iterator i = this.getAllAttributes();
+//    while (i.hasNext()) {
+//      OMAttribute attr = (OMAttribute) i.next();
+//      if (attr.getNamespace() != null)
+//        this.declareNamespace(attr.getNamespace());
+//    }
+//    super.internalSerialize(writer, bool);
+//  }
   
   public void addComment(String value) {
     factory.createOMComment(this, value);



Mime
View raw message