Fixed Mustang XML/ZUGFeRD standards namespace issues.

This commit is contained in:
Ivan Vaklinov
2014-09-19 17:37:23 +03:00
committed by Thomas Chojecki
parent f087d08119
commit 1a16ac296a
2 changed files with 13 additions and 13 deletions

View File

@@ -15,16 +15,16 @@ import org.w3c.dom.Element;
* Additionally to adding a RDF namespace with a indication which file * Additionally to adding a RDF namespace with a indication which file
* attachment if Zugferd, this namespace has to be described in a PDFA * attachment if Zugferd, this namespace has to be described in a PDFA
* Extension Schema. * Extension Schema.
* *
* I know there is a PDFAExtensionSchema in the context of PDFBox' XMPBOX * I know there is a PDFAExtensionSchema in the context of PDFBox' XMPBOX
* but I have been using PDFBox' JempBOX so far because I could not find out * but I have been using PDFBox' JempBOX so far because I could not find out
* how to write XMPBOX XMPMetadata to a PDF file. * how to write XMPBOX XMPMetadata to a PDF file.
* *
* So this is my version of PDFAExtensionSchema * So this is my version of PDFAExtensionSchema
* for PDFBox' jempbox XMPMetadata * for PDFBox' jempbox XMPMetadata
* *
* @author jstaerk * @author jstaerk
* *
*/ */
public class XMPSchemaPDFAExtensions extends XMPSchemaBasic { public class XMPSchemaPDFAExtensions extends XMPSchemaBasic {
@@ -52,8 +52,8 @@ import org.w3c.dom.Element;
} }
public XMPSchemaPDFAExtensions(org.apache.jempbox.xmp.XMPMetadata parent) { public XMPSchemaPDFAExtensions(org.apache.jempbox.xmp.XMPMetadata parent) {
super(parent); super(parent);
@@ -101,7 +101,7 @@ import org.w3c.dom.Element;
Element nsInfoNode = schema.getOwnerDocument().createElement( Element nsInfoNode = schema.getOwnerDocument().createElement(
"pdfaSchema:namespaceURI"); //$NON-NLS-1$ "pdfaSchema:namespaceURI"); //$NON-NLS-1$
XMLUtil.setStringValue(nsInfoNode, "urn:ferd:pdfa:invoice:rc#"); //$NON-NLS-1$ XMLUtil.setStringValue(nsInfoNode, "urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"); //$NON-NLS-1$
bagListNode.appendChild(nsInfoNode); bagListNode.appendChild(nsInfoNode);
Element prefixInfoNode = schema.getOwnerDocument().createElement( Element prefixInfoNode = schema.getOwnerDocument().createElement(

View File

@@ -15,14 +15,14 @@ import org.w3c.dom.Element;
public class XMPSchemaZugferd extends XMPSchemaBasic { public class XMPSchemaZugferd extends XMPSchemaBasic {
/** /**
* This is what needs to be added to the RDF metadata - basically the name of the embedded * This is what needs to be added to the RDF metadata - basically the name of the embedded
* Zugferd file * Zugferd file
* */ * */
public XMPSchemaZugferd(org.apache.jempbox.xmp.XMPMetadata parent) { public XMPSchemaZugferd(org.apache.jempbox.xmp.XMPMetadata parent) {
super(parent); super(parent);
schema.setAttributeNS(NS_NAMESPACE, "xmlns:zf", //$NON-NLS-1$ schema.setAttributeNS(NS_NAMESPACE, "xmlns:zf", //$NON-NLS-1$
"urn:ferd:pdfa:invoice:rc#"); //$NON-NLS-1$ "urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"); //$NON-NLS-1$
// the superclass includes this two namespaces we don't need // the superclass includes this two namespaces we don't need
schema.removeAttributeNS(NS_NAMESPACE, "xapGImg"); //$NON-NLS-1$ schema.removeAttributeNS(NS_NAMESPACE, "xapGImg"); //$NON-NLS-1$
schema.removeAttributeNS(NS_NAMESPACE, "xmp"); //$NON-NLS-1$ schema.removeAttributeNS(NS_NAMESPACE, "xmp"); //$NON-NLS-1$
@@ -37,12 +37,12 @@ public class XMPSchemaZugferd extends XMPSchemaBasic {
schema.appendChild(textNode); schema.appendChild(textNode);
textNode = schema.getOwnerDocument().createElement("zf:Version"); //$NON-NLS-1$ textNode = schema.getOwnerDocument().createElement("zf:Version"); //$NON-NLS-1$
XMLUtil.setStringValue(textNode, "RC"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, "1.0"); //$NON-NLS-1$
schema.appendChild(textNode); schema.appendChild(textNode);
textNode = schema.getOwnerDocument().createElement( textNode = schema.getOwnerDocument().createElement(
"zf:ConformanceLevel"); //$NON-NLS-1$ "zf:ConformanceLevel"); //$NON-NLS-1$
XMLUtil.setStringValue(textNode, "BASIC"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, "COMFORT"); //$NON-NLS-1$
schema.appendChild(textNode); schema.appendChild(textNode);
} }