Your message dated Wed, 22 Dec 2010 19:47:07 +0000
with message-id <[email protected]>
and subject line Bug#605940: fixed in xmlgraphics-commons 1.4.dfsg-2
has caused the Debian Bug report #605940,
regarding libxmlgraphics-commons-java: handles top-level elements in XMP poorly
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
605940: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605940
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libxmlgraphics-commons-java
Version: 1.4.dfsg-1
Severity: normal
Tags: patch
XMP permits only rdf:Description elements directly under rdf:RDF.
libxmlgraphics-commons-java does not enforce this and produces some odd
results in the XMP (it looks like it treats top-level non-Description
elements as properties). Attached is a patch that raises an exception
if it discovers this in XMP data. It is part of a larger patch that
also fixes another bug that I am about to file.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libxmlgraphics-commons-java depends on:
ii default-jre-headless [java2- 1:1.6-40 Standard Java or Java compatible R
ii gcj-4.4-jre-headless [java2- 4.4.5-9 Java runtime environment using GIJ
ii gcj-jre-headless [java2-runt 4:4.4.5-1 Java runtime environment using GIJ
ii openjdk-6-jre-headless [java 6b20~pre1-2 OpenJDK Java runtime, using Hotspo
libxmlgraphics-commons-java recommends no packages.
libxmlgraphics-commons-java suggests no packages.
-- no debconf information
--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
diff -ur xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPArray.java xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPArray.java
--- xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPArray.java 2010-12-04 18:46:09.000000000 +0000
+++ xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPArray.java 2010-12-04 20:18:25.000000000 +0000
@@ -19,6 +19,8 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+
import java.util.List;
import org.xml.sax.ContentHandler;
@@ -216,15 +218,19 @@
for (int i = 0, c = values.size(); i < c; i++) {
String lang = (String)xmllang.get(i);
atts.clear();
+ Object v = values.get(i);
if (lang != null) {
atts.addAttribute(XMPConstants.XML_NS, "lang", "xml:lang", "CDATA", lang);
}
+ if (v instanceof URI) {
+ atts.addAttribute(XMPConstants.RDF_NAMESPACE, "resource",
+ "rdf:resource", "CDATA", ((URI)v).toString());
+ }
handler.startElement(XMPConstants.RDF_NAMESPACE,
"li", "rdf:li", atts);
- Object v = values.get(i);
if (v instanceof XMPComplexValue) {
((XMPComplexValue)v).toSAX(handler);
- } else {
+ } else if (!(v instanceof URI)) {
String value = (String)values.get(i);
char[] chars = value.toCharArray();
handler.characters(chars, 0, chars.length);
diff -ur xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
--- xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-04 18:46:09.000000000 +0000
+++ xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-04 20:35:47.000000000 +0000
@@ -19,6 +19,9 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import java.util.Stack;
import org.xml.sax.Attributes;
@@ -188,6 +191,12 @@
throw new SAXException("Unexpected element in the RDF namespace: " + localName);
}
} else {
+ String about = attributes.getValue(XMPConstants.RDF_NAMESPACE, "about");
+ if (this.contextStack.peek().equals(this.meta) && (about != null)) {
+ //rdf:RDF is the parent, so this is a top-level item that isn't
+ //an rdf:Description, which isn't allowed.
+ throw new SAXException("Top-level element " + qName + " not an rdf:Description");
+ }
if (getCurrentPropName() != null) {
//Structure (shorthand form)
startStructure();
@@ -227,6 +236,15 @@
} else {
getCurrentArray(true).add(s);
}
+ } else {
+ String res = atts.getValue(XMPConstants.RDF_NAMESPACE,
+ "resource");
+ try {
+ URI resource = new URI(res);
+ getCurrentArray(true).add(resource);
+ } catch (URISyntaxException e) {
+ throw new SAXException("rdf:resource value is not a well-formed URI", e);
+ }
}
}
} else if ("Description".equals(localName)) {
@@ -261,9 +279,18 @@
String s = content.toString().trim();
prop = new XMPProperty(name, s);
String lang = atts.getValue(XMPConstants.XML_NS, "lang");
+ String res = atts.getValue(XMPConstants.RDF_NAMESPACE, "resource");
if (lang != null) {
prop.setXMLLang(lang);
}
+ if (res != null) {
+ try {
+ URI resource = new URI(res);
+ prop.setValue(resource);
+ } catch (URISyntaxException e) {
+ throw new SAXException("rdf:resource value is not a well-formed URI", e);
+ }
+ }
}
if (prop.getName() == null) {
throw new IllegalStateException("No content in XMP property");
diff -ur xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java
--- xmlgraphics-commons.old/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java 2010-12-04 18:46:09.000000000 +0000
+++ xmlgraphics-commons.work/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java 2010-12-04 20:15:46.000000000 +0000
@@ -19,6 +19,8 @@
package org.apache.xmlgraphics.xmp;
+import java.net.URI;
+
import java.util.Iterator;
import java.util.Map;
@@ -38,6 +40,7 @@
private Object value;
private String xmllang;
private Map qualifiers;
+ private boolean uri;
/**
* Creates a new XMP property.
@@ -47,6 +50,7 @@
public XMPProperty(QName name, Object value) {
this.name = name;
this.value = value;
+ this.uri = false;
}
/** @return the qualified name of the property (namespace URI + local name) */
@@ -192,12 +196,15 @@
public void toSAX(ContentHandler handler) throws SAXException {
AttributesImpl atts = new AttributesImpl();
String qName = getEffectiveQName();
+ if (value instanceof URI) {
+ atts.addAttribute(XMPConstants.RDF_NAMESPACE, "resource", "rdf:resource", "CDATA", ((URI)value).toString());
+ }
handler.startElement(getName().getNamespaceURI(),
getName().getLocalName(), qName, atts);
if (value instanceof XMPComplexValue) {
XMPComplexValue cv = ((XMPComplexValue)value);
cv.toSAX(handler);
- } else {
+ } else if (!(value instanceof URI)) {
char[] chars = value.toString().toCharArray();
handler.characters(chars, 0, chars.length);
}
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---
Source: xmlgraphics-commons
Source-Version: 1.4.dfsg-2
We believe that the bug you reported is fixed in the latest version of
xmlgraphics-commons, which is due to be installed in the Debian FTP archive:
libxmlgraphics-commons-java_1.4.dfsg-2_all.deb
to main/x/xmlgraphics-commons/libxmlgraphics-commons-java_1.4.dfsg-2_all.deb
xmlgraphics-commons_1.4.dfsg-2.debian.tar.gz
to main/x/xmlgraphics-commons/xmlgraphics-commons_1.4.dfsg-2.debian.tar.gz
xmlgraphics-commons_1.4.dfsg-2.dsc
to main/x/xmlgraphics-commons/xmlgraphics-commons_1.4.dfsg-2.dsc
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Vincent Fourmond <[email protected]> (supplier of updated xmlgraphics-commons
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Wed, 22 Dec 2010 20:29:33 +0100
Source: xmlgraphics-commons
Binary: libxmlgraphics-commons-java
Architecture: source all
Version: 1.4.dfsg-2
Distribution: experimental
Urgency: low
Maintainer: Debian Java Maintainers
<[email protected]>
Changed-By: Vincent Fourmond <[email protected]>
Description:
libxmlgraphics-commons-java - reusable components used by Batik and FOP
Closes: 605940 605941
Changes:
xmlgraphics-commons (1.4.dfsg-2) experimental; urgency=low
.
* Applied patches by Brian M. Carlson <[email protected]>
to fix various problems with XMP (closes: #605940, #605941)
* Dropping simple-patchsys now that we have switched to format 3.0
* Conforms to standards 3.9.1
Checksums-Sha1:
9296d064b17f1f7a47a9269e528e4a1ef8955abb 1631
xmlgraphics-commons_1.4.dfsg-2.dsc
f38017053dc5b2db5e7e0b5bc55f27a00353b3f8 5661
xmlgraphics-commons_1.4.dfsg-2.debian.tar.gz
71ebaed046f7a15dbd640f0f96ed0662c5a1d15e 525562
libxmlgraphics-commons-java_1.4.dfsg-2_all.deb
Checksums-Sha256:
0f8cae376c8b394cd385c3adf3f18f8abf8e7f2c11884e95d5b51249da7f43fd 1631
xmlgraphics-commons_1.4.dfsg-2.dsc
fa80a4dda257b141208a1a5475ea28592ef5dd1cb50122de5272fcb7e4da281f 5661
xmlgraphics-commons_1.4.dfsg-2.debian.tar.gz
64b7324dc4f9bc9dc1a214ba015ffda6baf6b6d3296ae719c2745af477fd31b5 525562
libxmlgraphics-commons-java_1.4.dfsg-2_all.deb
Files:
e3c273007d724e0056df6eda91026127 1631 java optional
xmlgraphics-commons_1.4.dfsg-2.dsc
1059647dda38a0e1e887fcf76988ba06 5661 java optional
xmlgraphics-commons_1.4.dfsg-2.debian.tar.gz
dc2a265404734a86e796c382b1746ac6 525562 java optional
libxmlgraphics-commons-java_1.4.dfsg-2_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk0SU+YACgkQx/UhwSKygsrBxwCgrktCKMQwbIHhH4AMlEwPmHrM
CPkAnRO0039h6kRtwoyhkuX9e4wRLfew
=1Rtr
-----END PGP SIGNATURE-----
--- End Message ---
__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers>. Please
use
[email protected] for discussions and questions.