Petras created PDFBOX-2913:
------------------------------

             Summary: DomXpmParser fails on property containing qualifier
                 Key: PDFBOX-2913
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2913
             Project: PDFBox
          Issue Type: Bug
          Components: XmpBox
    Affects Versions: 1.8.10
            Reporter: Petras


According to XMP specification properties may have qualifiers. In our scenario 
we used {{xmp:Identifier}} element from XMP Basic Schema holding an array of 
text strings. An array item may be qualified with {{xmpidq:Scheme}}:
{code:xml}
<rdf:Description rdf:about=""
                 xmlns:xmp="http://ns.adobe.com/xap/1.0/";
                 xmlns:xmpidq="http://ns.adobe.com/xmp/Identifier/qual/1.0/";>
  <xmp:Identifier>
    <rdf:Bag>
      <rdf:li rdf:parseType="Resource">
        <rdf:value>A</rdf:value>
        <xmpidq:Scheme>http://archyvai.lt/pdf-ltud/2013/level/</xmpidq:Scheme>
      </rdf:li>
    </rdf:Bag>
  </xmp:Identifier>
</rdf:Description>
{code}
{{DomXmpParser}} fails when parsing XMP containing such qualifiers:
{code}
org.apache.xmpbox.xml.XmpParsingException: Schema is not set in this document : 
http://www.w3.org/1999/02/22-rdf-syntax-ns#
        at 
org.apache.xmpbox.xml.DomXmpParser.checkPropertyDefinition(DomXmpParser.java:787)
        at 
org.apache.xmpbox.xml.DomXmpParser.parseLiDescription(DomXmpParser.java:508)
        at 
org.apache.xmpbox.xml.DomXmpParser.parseLiElement(DomXmpParser.java:449)
        at org.apache.xmpbox.xml.DomXmpParser.manageArray(DomXmpParser.java:407)
        at 
org.apache.xmpbox.xml.DomXmpParser.createProperty(DomXmpParser.java:309)
        at 
org.apache.xmpbox.xml.DomXmpParser.parseDescriptionRoot(DomXmpParser.java:267)
        at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:199)
        at 
org.apache.xmpbox.TestXMPWithDefinedSchemas.main(TestXMPWithDefinedSchemas.java:66)
...
{code}
It appears it failed on {{rdf:value}} element as 
{{org.apache.xmpbox.type.TypeMapping}} class is not aware about 
{{http://www.w3.org/1999/02/22-rdf-syntax-ns#}} standard namespace.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to