abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r597720 - in /incubator/abdera/java/trunk: examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java
Date Fri, 23 Nov 2007 19:04:14 GMT
Author: jmsnell
Date: Fri Nov 23 11:04:12 2007
New Revision: 597720

URL: http://svn.apache.org/viewvc?rev=597720&view=rev
Log:
Do not write out the xmlns:xml decl and add writeBase and writeLanguage to the StreamWriter
example

Modified:
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java?rev=597720&r1=597719&r2=597720&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/StreamWriterExample.java
Fri Nov 23 11:04:12 2007
@@ -40,6 +40,8 @@
         .setAutoIndent(true)
         .startDocument()
           .startFeed()
+            .writeBase("http://example.org")
+            .writeLanguage("en-US")
             .writeId("http://example.org")
             .writeTitle("<Testing 123>")
             .writeSubtitle("Foo")

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java?rev=597720&r1=597719&r2=597720&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/StaxStreamWriter.java
Fri Nov 23 11:04:12 2007
@@ -29,6 +29,7 @@
 
 import org.apache.abdera.parser.stax.util.FOMHelper;
 import org.apache.abdera.util.AbstractStreamWriter;
+import org.apache.abdera.util.Constants;
 import org.apache.abdera.writer.StreamWriter;
 import org.apache.axiom.om.util.StAXUtils;
 
@@ -233,10 +234,12 @@
       if (value == null) return this;
       try {
         if (prefix != null) {
-          writeNamespace(prefix,namespace,true);
+          if (!prefix.equals("xml"))
+            writeNamespace(prefix,namespace,true);
           writer.writeAttribute(prefix, namespace, name, value);
         } else if (namespace != null) {
-          writeNamespace(prefix,namespace,true);
+          if (!namespace.equals(Constants.XML_NS));
+            writeNamespace(prefix,namespace,true);
           writer.writeAttribute(namespace, name, value);
         } else { 
           writer.writeAttribute(name,value);



Mime
View raw message