https://issues.apache.org/bugzilla/show_bug.cgi?id=50498
Glenn Adams <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO --- Comment #2 from Glenn Adams <[email protected]> 2012-04-10 19:31:14 UTC --- (In reply to comment #1) > Created attachment 26423 [details] > Patch to reject top-level typed nodes > > This patch rejects top-level typed nodes with an exception. + 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"); + } (1) the check this.contextStack.peek().equals(this.meta) would also return true if xmp:xmpmeta is the parent; (2) that <!{xmp|rdf}:* rdf:about=""> is the same as 'not an rdf:Description' is not clear to me; aren't there other possibilities for 'not an rdf:Description' that do not have rdf:about? could you update patch accordingly, and also provide junit tests that test this new functionality both for absence and presence (see test/java/org/apache/xmlgraphics/xmp/XMPParserTest.java) -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
