Index: xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
===================================================================
--- xmlgraphics-commons-1.4.dfsg.orig/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-20 21:38:39.391336779 +0100
+++ xmlgraphics-commons-1.4.dfsg/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java 2010-12-20 21:39:04.295336685 +0100
@@ -188,6 +188,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();