Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] namespace issue

m2 r2sj

2006-05-02

Replies:

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

 

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.