You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2003/09/30 16:13:33 UTC
cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/xscript StringBufferContentHandler.java
vgritsenko 2003/09/30 07:13:33
Modified: . status.xml
src/java/org/apache/cocoon/components/xscript
StringBufferContentHandler.java
Log:
Sneak in a bugfix while Carsten asleep:
Fix default namespace handling in Xscript variables (bug #23516)
Revision Changes Path
1.159 +5 -2 cocoon-2.1/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/status.xml,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- status.xml 28 Sep 2003 05:01:05 -0000 1.158
+++ status.xml 30 Sep 2003 14:13:32 -0000 1.159
@@ -191,7 +191,10 @@
<changes>
<release version="@version@" date="@date@">
- <action dev="AG" type="add">
+ <action dev="VG" type="fix" fixes-bug="23516">
+ Fix default namespace handling in Xscript variables.
+ </action>
+ <action dev="AG" type="add">
OJB block: Object Relational mapping tool integration.
</action>
<action dev="BD" type="add">
1.2 +8 -4 cocoon-2.1/src/java/org/apache/cocoon/components/xscript/StringBufferContentHandler.java
Index: StringBufferContentHandler.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/xscript/StringBufferContentHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StringBufferContentHandler.java 9 Mar 2003 00:09:27 -0000 1.1
+++ StringBufferContentHandler.java 30 Sep 2003 14:13:33 -0000 1.2
@@ -103,7 +103,6 @@
}
namespaces.push(marker);
-
stringBuffer.append("<").append(qName);
for (int i = 0, len = a.getLength(); i < len; i++) {
@@ -112,7 +111,6 @@
// as an attribute. We need to catch this case so that we
// don't end up generating the namespace declaration twice.
String attrName = a.getQName(i);
-
if (attrName.startsWith("xmlns:")) {
// We have a namespace declaration
String name = a.getLocalName(i);
@@ -152,9 +150,15 @@
continue;
}
NPU npu = (NPU) obj;
- stringBuffer.append(" xmlns:").append(npu.prefix).append("=\"").append(npu.uri).append("\"");
+ if ("".equals(npu.prefix)) {
+ // Default namespace
+ stringBuffer.append(" xmlns").append("=\"").append(npu.uri).append("\"");
+ } else {
+ stringBuffer.append(" xmlns:").append(npu.prefix).append("=\"").append(npu.uri).append("\"");
+ }
}
}
+
stringBuffer.append(">");
}
RE: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/xscript StringBufferContentHandler.java
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Here comes another volunteer for a free beer :)
Thanks!
Carsten
> From: vgritsenko@apache.org [mailto:vgritsenko@apache.org]
>
> Log:
> Sneak in a bugfix while Carsten asleep:
> Fix default namespace handling in Xscript variables (bug #23516)
>