<div>I am running into an issue with XSLT signing and need an expert help in resolving the issue.&nbsp;</div>
<div>&nbsp;</div>
<div>I just did quite R&amp;D on XML digital signature for JDOM and am following the below steps.</div>
<div>1)Convert an XML file into JDOM</div>
<div>2)Convert JDOM into DOM</div>
<div>3)To set the namespace aware true&nbsp;so that XSLT signature works.</div>
<div>Store the w3c DOM to an inputstream tho' outputstream as follows</div>
<div>org.apache.xml.security.utils.XMLUtils.outputDOMc14nWithComments(docSign, os);</div>
<div>4)Then set the namespace aware&nbsp; and parse the w3c DOM stored in an inputstream.</div>
<div>DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();<br>dbf.setNamespaceAware(true);</div>
<div>5)singed the DOM after setting namespace aware true.</div>
<div>&nbsp;</div>
<div>I am getting the following error when i parse the DOM that is in the inputstream which was converted from JDOM</div>
<div><font color="#ff0000" size="2">[Fatal Error] :-1:-1: Premature end of file.</font></div>
<div>&nbsp;</div>
<div>can any expert guide me the right way to resolve the issue/to implement signing for JDOM.</div>
<div>Note : The URI signing works in this way not the XSLT signing.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt; <br>&lt;Flow Id=&quot;new&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;&gt; 
<br>&lt;Empid&gt;121212&lt;/Empid&gt;<br>&lt;Salary&gt;120000&lt;/Salary&gt;<br>&lt;Command&gt;<br>&nbsp; &lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform
</a> &quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:template match=&quot;/&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:copy-of select=&quot;Flow/Salary&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:template&gt;<br>&nbsp;&lt;/xsl:stylesheet&gt;<br>&lt;/Command&gt; 
<br>&lt;Skills&gt;<br>&nbsp; &lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:template match=&quot;/&quot;&gt; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:copy-of select=&quot;Flow&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;<br>&lt;/Skills&gt;<br>&lt;/Flow&gt;</div>
<p>&nbsp;</p><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:jdom-interest@jdom.org"></a>