[ 
https://issues.apache.org/jira/browse/PDFBOX-2378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17761485#comment-17761485
 ] 

Tilman Hausherr commented on PDFBOX-2378:
-----------------------------------------

- The XMPSerializer isn't to blame, it happens because 
{{metadata.getAllSchemas()}} returns only 1 schema
- It happens when parsing
- Only 1 schema processed in {{parseDescriptionRoot}}, only the one of the child
- I suspect that it only looks at the schemas of direct children, not at the 
schemas mentioned in the attributes
- createXMPSchema() isn't called often enough
- all these thoughts are not relevant, because 
http://www.aiim.org/pdfa/ns/property# and http://www.aiim.org/pdfa/ns/schema# 
are of class AbstractStructuredType, not XMPSchema.
Unless I missed something, the result is: either we need to detect and save 
these types at the beginning in some extra list, or these types already exist 
in {{metadata}} somehow.


> XMPBox removes namespaces on serialization
> ------------------------------------------
>
>                 Key: PDFBOX-2378
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2378
>             Project: PDFBox
>          Issue Type: Bug
>          Components: XmpBox
>    Affects Versions: 1.8.7, 2.0.29, 3.0.0 PDFBox, 4.0.0
>            Reporter: Vadimo
>            Priority: Minor
>         Attachments: zf_extension.pdfbox.xmp
>
>
> {code:title=Bar.java|borderStyle=none}
> InputStream zfExtensionIs = 
> getClass().getResourceAsStream("/zf_extension.pdfbox.xmp");
> DomXmpParser builder = new DomXmpParser();
>          zfDefaultXmp = builder.parse(zfExtensionIs);
> PdfaExtensionHelper.populateSchemaMapping(zfDefaultXmp);
> new XmpSerializer().serialize(zfDefaultXmp, new 
> FileOutputStream("target/out.xmp.xml"), true);
> {code}
> the incoming file 
> {code:xml|title=incoming.xml|borderStyle=none}
>       <rdf:Description 
> xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/";
>          xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"; 
> xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#"; rdf:about="">
> {code}
> outgoing file 
> {code:xml|title=resulting.xml|borderStyle=none}
> <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"; 
> rdf:about="">
> {code}
> why are the two namespaces gone?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to