Search in sources :

Example 1 with RelationshipReferenceDocument

use of org.openxmlformats.schemas.xpackage.x2006.digitalSignature.RelationshipReferenceDocument in project poi by apache.

the class RelationshipTransformService method marshalParams.

@Override
public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException {
    LOG.log(POILogger.DEBUG, "marshallParams(parent,context)");
    DOMStructure domParent = (DOMStructure) parent;
    Element parentNode = (Element) domParent.getNode();
    // parentNode.setAttributeNS(XML_NS, "xmlns:mdssi", XML_DIGSIG_NS);
    Document doc = parentNode.getOwnerDocument();
    for (String sourceId : this.sourceIds) {
        RelationshipReferenceDocument relRef = RelationshipReferenceDocument.Factory.newInstance();
        relRef.addNewRelationshipReference().setSourceId(sourceId);
        Node n = relRef.getRelationshipReference().getDomNode();
        n = doc.importNode(n, true);
        parentNode.appendChild(n);
    }
}
Also used : Element(org.w3c.dom.Element) Node(org.w3c.dom.Node) DOMStructure(javax.xml.crypto.dom.DOMStructure) RelationshipReferenceDocument(org.openxmlformats.schemas.xpackage.x2006.digitalSignature.RelationshipReferenceDocument) Document(org.w3c.dom.Document) TransformDocument(org.w3.x2000.x09.xmldsig.TransformDocument) RelationshipsDocument(org.openxmlformats.schemas.xpackage.x2006.relationships.RelationshipsDocument) RelationshipReferenceDocument(org.openxmlformats.schemas.xpackage.x2006.digitalSignature.RelationshipReferenceDocument)

Aggregations

DOMStructure (javax.xml.crypto.dom.DOMStructure)1 RelationshipReferenceDocument (org.openxmlformats.schemas.xpackage.x2006.digitalSignature.RelationshipReferenceDocument)1 RelationshipsDocument (org.openxmlformats.schemas.xpackage.x2006.relationships.RelationshipsDocument)1 TransformDocument (org.w3.x2000.x09.xmldsig.TransformDocument)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1 Node (org.w3c.dom.Node)1