public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { if (params == null) { throw new InvalidAlgorithmParameterException("params are required"); } if (!(params instanceof XSLTTransformParameterSpec)) { throw new InvalidAlgorithmParameterException("unrecognized params"); } this.params = params; }
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); }
@Override public void init(TransformParameterSpec params) throws InvalidAlgorithmParameterException { if (params == null) { throw new InvalidAlgorithmParameterException("params are required"); } if (!(params instanceof XSLTTransformParameterSpec)) { throw new InvalidAlgorithmParameterException("unrecognized params"); } this.params = params; }
@Override 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); }
/** * 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; }
private void unmarshalParams(Element sheet) { this.params = new XSLTTransformParameterSpec (new javax.xml.crypto.dom.DOMStructure(sheet)); }