<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Ecrion Forum : Java code needed to read/render  the XSL</title>
  <link>http://www.ecrion.com/forum/</link>
  <description>This is an XML content feed of; Ecrion Forum : Sample Code : Java code needed to read/render  the XSL</description>
  <copyright>Copyright (c) 2006-2009 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 23 May 2013 08:45:33 +0000</pubDate>
  <lastBuildDate>Mon, 25 Oct 2010 07:08:15 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ecrion.com/forum/RSS_post_feed.asp?TID=291</WebWizForums:feedURL>
  <image>
   <title>Ecrion Forum</title>
   <url>http://www.ecrion.com/forum//images/logo.png</url>
   <link>http://www.ecrion.com/forum/</link>
  </image>
  <item>
   <title>Java code needed to read/render  the XSL : Would using a Server Template...</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=694#694</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=5" rel="nofollow">gabig</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 25 Oct 2010 at 7:08am<br /><br />Would using a Server Template work for you? It means you would first upload your XFD or XSL template to the server, then let Ultrascale handle the transform server-side.<br /><br />Also, could you send a sample template to support? Perhaps we can troubleshoot the original issue and see why the template cannot be processed successfully with Java's internal XSL engine.<br /><br />Regards,<br />Gabi<span style="font-size:10px"><br /><br />Edited by gabig - 25 Oct 2010 at 7:09am</span>]]>
   </description>
   <pubDate>Mon, 25 Oct 2010 07:08:15 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=694#694</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : I still face the same issue...Could...</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=691#691</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=152" rel="nofollow">srivatsahg</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 25 Oct 2010 at 3:37am<br /><br />I still face the same issue...<img src="http://www.ecrion.com/forum/smileys/smiley19.gif" border="0" alt="Cry" /><br>Could you please send me a snippet of the code which <br><br>1. Reads a stylesheet from a file location.<br>2. Sets the Transformation parameters and<br>3. sets the parameter for Rendering engine.<br><br>Though im sure of points 2 and 3. I am not sure about the Point 1.<br><br>Kindly reply<br>Srivatsa<br><br><br><br>]]>
   </description>
   <pubDate>Mon, 25 Oct 2010 03:37:27 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=691#691</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : We have multiple XSLT engines....</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=689#689</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=5" rel="nofollow">gabig</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 22 Oct 2010 at 4:34am<br /><br />We have multiple XSLT engines. Are you sure you're using the same in both cases?<br /><br />In XF Designer, go to the Options dialog, in the XSL Transformations section. Here you can view or change the XSLT engine used by the Designer.<br /><br />Now in your code, you can choose to let Ultrascale perform the transformation using that engine. Use the XsltEngine rendering parameter to set it.<br /><br />Use InputFormat.XML instead of XSLFO to pass the XML stream directly to Ultrascale. The idea here is to let Ultrascale manage the transformation as well.<br /><br />Create a LocalDocumentTemplate from your XSL and set it as the Template parameter. The transformation will be performed client side.<br /><br />Finally, pass the XML stream as the input for the Engine.Render() method.<br /><br />Let me know if you encounter any issues.<br /><br />Regards,<br />Gabi<br />]]>
   </description>
   <pubDate>Fri, 22 Oct 2010 04:34:46 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=689#689</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : The same stylesheet works perfectly...</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=688#688</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=152" rel="nofollow">srivatsahg</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 22 Oct 2010 at 3:46am<br /><br />The same stylesheet works perfectly from the XF designer. But it does not work when i do it&nbsp; programmatically. I dont think its a problem with the XSL.<br><br><br><br>]]>
   </description>
   <pubDate>Fri, 22 Oct 2010 03:46:52 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=688#688</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : If you get a stylesheet compilation...</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=687#687</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=3" rel="nofollow">florinv</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 21 Oct 2010 at 3:07pm<br /><br />If you get a stylesheet compilation error, most likely the error is in the XSL file, not in the JAVA code.Try to validate the XSL in XF Designer.]]>
   </description>
   <pubDate>Thu, 21 Oct 2010 15:07:35 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=687#687</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : Anyone out there to help me  </title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=658#658</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=152" rel="nofollow">srivatsahg</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 20 Oct 2010 at 4:51am<br /><br />Anyone out there to help me]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 04:51:13 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=658#658</guid>
  </item> 
  <item>
   <title>Java code needed to read/render  the XSL : Hello I have modified the sample...</title>
   <link>http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=657#657</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ecrion.com/forum/member_profile.asp?PF=152" rel="nofollow">srivatsahg</a><br /><strong>Subject:</strong> 291<br /><strong>Posted:</strong> 20 Oct 2010 at 3:19am<br /><br />Hello <br><br>I have modified the sample Java snippet provided by Ecrion to my needs. However i get error when i start the transformation using TransformerFactory and i get the error msg as the stylesheet could not be compiled<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff">String xmlString;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String xslString;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; File xmlFile = new File("C:/Srivatsa/Reports/Ecrion/DemoReport/Demo.xml");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File xsltFile = new File("C:/Srivatsa/Reports/Ecrion/DemoReport/Demo.xsl");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlString = FileUtils.readFileToString(xmlFile);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xslString = FileUtils.readFileToString(xsltFile,"utf-8");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InputStream xml = new StringBufferInputStream(xmlString);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InputStream xslt = new StringBufferInputStream(xslString);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OutputStream outputStream = new&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileOutputStream("C:\\XSLTransformation.pdf");<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // JAXP reads data using the Source interface<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Source xmlSource = new StreamSource(xml);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Source xsltSource = new StreamSource(xslt);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // the factory pattern supports different XSLT processors<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TransformerFactory transFact = TransformerFactory.newInstance();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Transformer trans = transFact.newTransformer(xsltSource);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ByteArrayOutputStream xmlResult = new ByteArrayOutputStream();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; trans.transform(xmlSource, new StreamResult(xmlResult));<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InputStream inputStream = new StringBufferInputStream(xmlResult.toString());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Engine eng = new Engine();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RenderingParameters rp = new RenderingParameters();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rp.InputFormat = Engine.InputFormat.XSLFO;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rp.OutputFormat = Engine.OutputFormat.PDF;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eng.Render(inputStream, outputStream, rp);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // remember to close the streams<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; inputStream.close();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; outputStream.close();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Document rendered successfully!");</font><br><br>Any idea where am i going wrong<br><br>Vatsa<br><br><br>]]>
   </description>
   <pubDate>Wed, 20 Oct 2010 03:19:25 +0000</pubDate>
   <guid isPermaLink="true">http://www.ecrion.com/forum/forum_posts.asp?TID=291&amp;PID=657#657</guid>
  </item> 
 </channel>
</rss>