Search in sources :

Example 1 with XSLTTransformParameterSpec

use of javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec in project camel by apache.

the class XmlSignatureHelper method getXslTranform.

/**
     * Returns a configuration for an XSL transformation.
     * 
     * @param is
     *            input stream of the XSL
     * @return XSL transform
     * @throws IllegalArgumentException
     *             if <tt>is</tt> is <code>null</code>
     * @throws Exception
     *             if an error during the reading of the XSL file occurs
     */
public static AlgorithmMethod getXslTranform(InputStream is) throws SAXException, IOException, ParserConfigurationException {
    if (is == null) {
        throw new IllegalArgumentException("is must not be null");
    }
    Document doc = parseInput(is);
    DOMStructure stylesheet = new DOMStructure(doc.getDocumentElement());
    XSLTTransformParameterSpec spec = new XSLTTransformParameterSpec(stylesheet);
    XmlSignatureTransform transformXslt = new XmlSignatureTransform();
    transformXslt.setAlgorithm(Transform.XSLT);
    transformXslt.setParameterSpec(spec);
    return transformXslt;
}
Also used : XSLTTransformParameterSpec(javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec) DOMStructure(javax.xml.crypto.dom.DOMStructure) Document(org.w3c.dom.Document)

Example 2 with XSLTTransformParameterSpec

use of javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec in project jdk8u_jdk by JetBrains.

the class DOMXSLTTransform method marshalParams.

public void marshalParams(XMLStructure parent, XMLCryptoContext context) throws MarshalException {
    super.marshalParams(parent, context);
    XSLTTransformParameterSpec xp = (XSLTTransformParameterSpec) getParameterSpec();
    Node xsltElem = ((javax.xml.crypto.dom.DOMStructure) xp.getStylesheet()).getNode();
    DOMUtils.appendChild(transformElem, xsltElem);
}
Also used : XSLTTransformParameterSpec(javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec) Node(org.w3c.dom.Node) javax.xml.crypto(javax.xml.crypto)

Aggregations

XSLTTransformParameterSpec (javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec)2 javax.xml.crypto (javax.xml.crypto)1 DOMStructure (javax.xml.crypto.dom.DOMStructure)1 Document (org.w3c.dom.Document)1 Node (org.w3c.dom.Node)1