Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3471

XMP parsing fails if XMP contain comments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.3, 3.0.0 PDFBox
    • XmpBox
    • None

    Description

      DomXmpParser parser fails with such correct XMP:

      <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
      <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
          <!-- PDF/A standarto versija (1 ar 2) ir suderinamumo lygmuo (A, B ar U) -->
          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
              <rdf:Description rdf:about = ""
                               xmlns:pdfaid = "http://www.aiim.org/pdfa/ns/id/">
                  <pdfaid:part>1</pdfaid:part>
                  <pdfaid:conformance>B</pdfaid:conformance>
              </rdf:Description>
          </rdf:RDF>
      </x:xmpmeta>
      <?xpacket end="w"?>
      

      DomXmpParser finds comment node and fails:

      org.apache.xmpbox.xml.XmpParsingException: More than one element found in x:xmpmeta
      	at org.apache.xmpbox.xml.DomXmpParser.findDescriptionsParent(DomXmpParser.java:750)
      	at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:183)
      	at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:111)
      ...
      

      Attachments

        Activity

          People

            msahyoun Maruan Sahyoun
            abyss Petras
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: