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

Generated XMP Metadata with other XSLT processor are XML invalid

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.19
    • Fix Version/s: 2.0.20, 3.0.0 PDFBox
    • Component/s: XmpBox
    • Labels:
      None

      Description

      In our system I cannot affect javax.xml.transform.TransformerFactory property, it is per default set to org.apache.xalan.processor.TransformerFactoryImpl (Xalan v2.7.2).

      When I generate XMP metadata DublinCoreSchema with title, I will get following piece of XML:

      <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
        <dc:title>
         <rdf:Alt>
           <rdf:li lang="x-default">some title</rdf:li>
         </rdf:Alt>
        </dc:title>
      </rdf:Description>
      

      Problem is, that before lang attribute is xml: attribute prefix missing, and then is XML invalid as per specification. With org.apache.xalan.xsltc.trax.TransformerFactoryImpl is everything OK.

      Solution to the problem will be providing DocumentBuilderFactory and TransformerFactory from outside via constructor.

        Attachments

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              myroch Miroslav Holubec
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: