Proprietary Sys.= XML= XSL-FO= PDF In memory transform

I am trying to preform an in memory creation of a pdf (using XSL-FO and FOP) from data contained in a proprietary system.
The process I am using is:
1: get xml of the data in the proprietary system (this works and the xml is fine)
2: create the XSL-FO using the xml from stage 1 and an xslt (where I am going wrong)
3: transform the xml to pdf (this works if I save the XSL-FO.xml and the xslt used to disk and then run FOP seperately)
When I run the code I get a Fatal Error from FOP - Content not allowed in prolog. When I write the XSL-FO file to disk and look at it, it's not been transformed to XSL-FO and is missing all the mark-up.
I have put the code below - any help would be very appreciated.
Thanks
// Setup XML input - The methods to create the initial xml return a String
StringReader inSource = new StringReader( inResult );
// Setup XSLT Stylesheet - The fo styles are stored in the proprietary system
String foXSL = getStyleSheet("FOStyleSheet");
ByteArrayOutputStream foXMLba = new ByteArrayOutputStream();
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer( new StreamSource( new StringReader( foXSL ) ) );
Result foRes = new StreamResult( foXMLba );
transformer.transform( new StreamSource( inSource), foRes );
Driver driver = new Driver();
driver.setRenderer( Driver.RENDER_PDF );
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
driver.setOutputStream( pdfOut );
driver.setInputSource( new InputSource( in_foResult ) );
driver.run();

an xslt (where I am going wrong)Yes, I would say that's a good guess at your problem. It does indeed sound like one of the common XSLT errors, where none of your templates are being matched and the default handling takes over; all that does is to copy the text nodes to the output.
PC²

Similar Messages

  • Converting xml/xsl to pdf

    Hi,
    I am using apache's FOP 0.20.3, xerces 2.0.0.beta4 and xalan j.2.2.0 to convert xml/xsl file to pdf. The code is same as the one given in the org.apache.fop.apps.Driver class.
    <pre>
         Driver driver = new Driver();
         driver.setRenderer(Driver.RENDER_PDF);
         InputHandler inputHandler = new XSLTInputHandler(new File(xmlFile), new File(xslFile));
         try
              XMLReader parser = inputHandler.getParser();
              driver.setOutputStream(new FileOutputStream(outFile));
              driver.render(parser, inputHandler.getInputSource());
         catch (FOPException fope)
              fope.printStackTrace();
         catch (FileNotFoundException fnfe)
              fnfe.printStackTrace();
    </pre>
    The xml and xsl files I am using are glossary.xml and glossary.xsl files that come with FOP.
    Now, this code compiles successfully and while running gives the following exception:
    <pre>
    [ERROR]: Logger not set
    [INFO]: building formatting object tree
    [INFO]: [1]
    org.apache.fop.apps.FOPException: java.lang.NullPointerException
         at org.apache.fop.apps.Driver.render(Driver.java:486)
         at XmlToPdf2.<init>(XmlToPdf2.java:28)
         at XmlToPdf2.main(XmlToPdf2.java:42)
    java.lang.RuntimeException: java.lang.NullPointerException
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1132)
         at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
         at org.apache.fop.apps.Driver.render(Driver.java:481)
         at XmlToPdf2.<init>(XmlToPdf2.java:28)
         at XmlToPdf2.main(XmlToPdf2.java:42)
    java.lang.RuntimeException: java.lang.NullPointerException
         at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3170)
         at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:433)
         at org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:629)
         at org.apache.xerces.impl.XMLNamespaceBinder.endDocument(XMLNamespaceBinder.java:702)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(XMLDTDValidator.java:974)
         at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:445)
         at org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1123)
         at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3078)
         at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityManager.java:2766)
         at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(XMLDocumentScannerImpl.java:995)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:332)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:510)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:557)
         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1096)
         at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
         at org.apache.fop.apps.Driver.render(Driver.java:481)
         at XmlToPdf2.<init>(XmlToPdf2.java:28)
         at XmlToPdf2.main(XmlToPdf2.java:42)
    java.lang.RuntimeException: java.lang.NullPointerException
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1132)
         at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
         at org.apache.fop.apps.Driver.render(Driver.java:481)
         at XmlToPdf2.<init>(XmlToPdf2.java:28)
         at XmlToPdf2.main(XmlToPdf2.java:42)
    java.lang.RuntimeException: java.lang.NullPointerException
         at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3170)
         at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:433)
         at org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:629)
         at org.apache.xerces.impl.XMLNamespaceBinder.endDocument(XMLNamespaceBinder.java:702)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(XMLDTDValidator.java:974)
         at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:445)
         at org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1123)
         at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3078)
         at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityManager.java:2766)
         at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(XMLDocumentScannerImpl.java:995)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:332)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:510)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:557)
         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1096)
         at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
         at org.apache.fop.apps.Driver.render(Driver.java:481)
         at XmlToPdf2.<init>(XmlToPdf2.java:28)
         at XmlToPdf2.main(XmlToPdf2.java:42)
    </pre>
    Can anybody help?

    Hi,
    I also facing same problem,did you get the solution.
    I am using apache's FOP 0.20.3, xerces-1.2.3 and xalan-2.0.0 and jdk1.3 with weblogic5.1 to convert xml/xsl file to pdf. The code is same as the one given in the org.apache.fop.apps.Driver class.
    please give me sample code.
    thanks,
    [email protected]

  • Large Pdf using XML XSL - Out of Memory Error

    Hi Friends.
    I am trying to generate a PDF from XML, XSL and FO in java. It works fine if the PDF to be generated is small.
    But if the PDF to be generated is big, then it throws "Out of Memory" error. Can some one please give me some pointers about the possible reasons for this errors. Thanks for your help.
    RM
    Code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.apache.fop.apps.Driver;
    import org.apache.fop.apps.Version;
    import org.apache.fop.apps.XSLTInputHandler;
    import org.apache.fop.messaging.MessageHandler;
    import org.apache.avalon.framework.logger.ConsoleLogger;
    import org.apache.avalon.framework.logger.Logger;
    public class PdfServlet extends HttpServlet {
    public static final String FO_REQUEST_PARAM = "fo";
    public static final String XML_REQUEST_PARAM = "xml";
    public static final String XSL_REQUEST_PARAM = "xsl";
    Logger log = null;
         Com_BUtil myBu = new Com_BUtil();
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException {
    if(log == null) {
         log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
         MessageHandler.setScreenLogger(log);
    try {
    String foParam = request.getParameter(FO_REQUEST_PARAM);
    String xmlParam = myBu.getConfigVal("filePath") +"/"+request.getParameter(XML_REQUEST_PARAM);
    String xslParam = myBu.SERVERROOT + "/jsp/servlet/"+request.getParameter(XSL_REQUEST_PARAM)+".xsl";
         if((xmlParam != null) && (xslParam != null)) {
    XSLTInputHandler input = new XSLTInputHandler(new File(xmlParam), new File(xslParam));
    renderXML(input, response);
    } else {
    PrintWriter out = response.getWriter();
    out.println("<html><head><title>Error</title></head>\n"+
    "<body><h1>PdfServlet Error</h1><h3>No 'fo' "+
    "request param given.</body></html>");
    } catch (ServletException ex) {
    throw ex;
    catch (Exception ex) {
    throw new ServletException(ex);
    public void renderXML(XSLTInputHandler input,
    HttpServletResponse response) throws ServletException {
    try {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.setContentType("application/pdf");
    Driver driver = new Driver();
    driver.setLogger(log);
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setOutputStream(out);
    driver.render(input.getParser(), input.getInputSource());
    byte[] content = out.toByteArray();
    response.setContentLength(content.length);
    response.getOutputStream().write(content);
    response.getOutputStream().flush();
    } catch (Exception ex) {
    throw new ServletException(ex);
    * creates a SAX parser, using the value of org.xml.sax.parser
    * defaulting to org.apache.xerces.parsers.SAXParser
    * @return the created SAX parser
    static XMLReader createParser() throws ServletException {
    String parserClassName = System.getProperty("org.xml.sax.parser");
    if (parserClassName == null) {
    parserClassName = "org.apache.xerces.parsers.SAXParser";
    try {
    return (XMLReader) Class.forName(
    parserClassName).newInstance();
    } catch (Exception e) {
    throw new ServletException(e);

    Hi,
    I did try that initially. After executing the command I get this message.
    C:\>java -Xms128M -Xmx256M
    Usage: java [-options] class [args...]
    (to execute a class)
    or java -jar [-options] jarfile [args...]
    (to execute a jar file)
    where options include:
    -cp -classpath <directories and zip/jar files separated by ;>
    set search path for application classes and resources
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -showversion print product version and continue
    -? -help print this help message
    -X print help on non-standard options
    Thanks for your help.
    RM

  • Is XML+XSL possible within a PDF?

    Hello!
    After much searching all I could find were articles about converting xml+xsl INTO a pdf file.  I'm wondering if I could embed XML+XSL INSIDE a pdf file and have it render.  Does Reader support XSL processing?  I'm new to pdf generation in general so any tips or advice would be useful and there is very little on the interwebs about XSL inside a pdf.
    Thank you!

    After looking at http://partners.adobe.com/public/developer/opensource/index.html I was under the impression that Reader used the Sablotron engine for some reason.  What adobe products use Sablotron and XSL then?

  • SharePoint 2010 Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error.

    Hello,
    I currently having a series of errors (18 issues) that are occurring under the below Correlation ID ad1a22f5-1ddb-4fa5-8487-143cb6fd0f9d
    I have listed (3) that are in the Web Parts category, this error/issue is causing several timed job to no longer work properly I have been trying to find the root cause for about a week now. If anyone has encountered a issue
    such as this one I'm open for suggestions.     
    (1)
    Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (1,475). ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception
    stack trace ---     at System.Net.HttpWebRequest.GetResponse()     at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri
    uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)    
    --- End of inner exception stack trace ---     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver
    xmlResolver)     at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)     at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings
    settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader
    stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
    (2)
    InnerException 1: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according
    to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean
    receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)    
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback,
    Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception stack trace ---     at System.Net.HttpWebRequest.GetResponse()    
    at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)    
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
    (3)
    InnerException 2: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)

    Hello,
    It seems that issue is related to certificate. Could you please upload certificate to central admin and make it trust.
    Just try this and see the result:
    http://social.technet.microsoft.com/Forums/en-US/cbc58585-1673-4c91-b8c1-1b95c339bbb7/could-not-establish-trust-relationship-for-the-ssltls-secure-channel?forum=fastsharepoint
    http://social.msdn.microsoft.com/Forums/en-US/7a7e56ba-6e95-4a84-9384-791818cce89d/the-underlying-connection-was-closed-could-not-establish-trust-relationship-for-the-ssltls-secure?forum=sharepointdevelopmentprevious
    http://www.infotext.com/help/sharepoint-could-not-estabilish-trust-relationship-for-the-ssltls-secure-channel-when-crawling-ssl-enabled-websites/
    If still face the issue then tell us more about your webparts and also confirm if you are facing same problem to other page and site.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Publish XML Form to PDF

    Hi all,
    Do you know a way of publishing XML forms to PDF ?
    Is it possible using XSL-FO transformation within the portal ? Has someone already done it ?
    I can not find any information regarding this.
    Thanks a lot
    Nicolas

    HI
    the basics involve using
    1>an XSLT filter already available
    2>using an  custom dev oped xsl which brings the transformation and configuring the xsl in XSLT filter
    3>keeping the xml doccuments in a repository in KM Content and configuring the xslt filter to point to the repository/doccument .
    4>restarting the server.
    u will find help if u navigate to KMconfiguration under system configuration and then
    <b>Configuration
    Content Management
      Repository Filters</b> 
    Please do give points if this helps you atleast gives u a guideline
    With Regards
    subrato kundu
    IBM
    SAP Enterprise Portal  technology Consultant

  • Weaknesses I've come across in the Oracle XML/XSL implementation

    Weaknesses I've come across in the Oracle XML/XSL implementation
    NOTE: I think Oracle is a fantastic database and the XML implementation is lovely to use - also I know these are not limited to XE and also that some are fixed in 11g enterprise however I'm not sure if all are so I am posting here in the hope that Oracle will include fixes for all if any have been missed
    1. getclobval() returns a spurious carriage return on end of the value returned
    2. extract does not handle mixed content tags well (for example it simply discards tags that only have whitespace between them
    3. XSL: using a xsl:number level="multiple" with anything beyond a simple count= xpath value crashes the database completely
    4. XSL: insists on pretty printing output XML which is extremely odd behaviour and causes problems when dealing with mixed content

    Another weakness I've seen is with the appendchildxml function and mixed content xml - it appears to likewise pretty print XML causing the injection of carriage returns and whitespace into mixed content nodes

  • UPK Template Customization (XML/XSL)

    Hi all,
    I've created a content in Oracle UPK 11.1.0 developers edition. My concern here is that, during string input of data for e.g., Enter the approriate month, for instance October*. Help text will appear in See It!, Try It! and Know It!, but in Do It! mode the same available instruction will be displayed. What I want in this case, in Do It! mode I need to insert generic text rather than template text. Hence, I want to edit this in Template.xml, associated with two additional xlst files in the Library > Systems > Templates > en > Microsoft - English > Template.xml. Is it possible to edit the xml and xlst and implement the above said. Please let me know, if you require any additional information.
    Thanks,
    Gopivista

    I'm not trying to be difficult...I'm explaining my problem as best as I know how. I didn't realize that alban was asking for input...frankly I didn't understand his "ISP happy you're not using much bandwidth" comments and while I realize a more experienced person probably would have known he wanted input, I didn't and I would have gladly provided it if the request had been explicit. Perhaps this isn't the place for me to ask a question as someone not well versed in xml/xsl but I have provided the input below in case this might help someone help me.
    1 - java code executes sql query
    2 - sql query returns resultSet to java code (see below resultSet)
    3 - java code passes resultSet to xsl template file that I included in my initial post
    ClientAccountNumber     COB_DATE_D     NetQuantity
    1111222     20061108     1
    1111222     20061108     2
    1111222     20061108     10
    1111222     20061108     10
    1111222     20061108     2
    1111222     20061108     2
    1111222     20061108     2
    1111222     20061108     2
    1111222     20061108     1
    1111222     20061108     1
    1111222     20061108     8
    1111222     20061108     7
    1111222     20061108     5
    1111222     20061108     3
    1111222     20061108     2
    1111222     20061108     1
    1111222     20061108     14
    1111222     20061108     1
    1111222     20061108     2
    Message was edited by:
    tech_isis
    Message was edited by:
    tech_isis
    Message was edited by:
    tech_isis

  • XML, XSL - HTML(JSP), bad UTF-8 encoding on Tomcat

    I use simple transformation to create HTML (JSP) page from XML, XSL (both are encoded in UTF-8}. When doing this in embedded web server in JD9i developer, the result is fine. But when run at Tomcat 4.0.3, UTF-8 chars are displayed as 2 characters. It's interesting that the transformation gives different results:
    - in JD9i the UTF-8 chars are left unchanged and shown good in IE browser
    - in Tomcat the chars with acute (/) are transformed into "&iacute;" , "&aacute;" and so on and shown properly, whereas chars with caron (V) are encoded and shown badly.
    Does somebody know solution to this ? Thanks.

    Doing some more experiments reveals a subtle difference between GET and POST with Tomcat - it may apply to other application servers, but I have only tested with Tomcat 5 and Tomcat 6, so I can't say.
    The following is essentially what most people have indicated you need to do to have your JSP handle UTF-8:
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>My Title</title>
    </head>
    <body>
    </body>
    </html>This is what I couldn't get working with my GET (the default for forms) and ended up working when I specified the URIEncoding for the connector in the server.xml file.
    It turns out that the above will work with no modifications to the server.xml file if the form method is POST. If you need to be able use GETs then you will need to modify the connector, otherwise it would seem nothing you do at the JSP or servlet level will make a difference, unless you want to convert each parameter manually:
      String parameter = new String( request.getParameter("myParam").getBytes("ISO-8859-1"), "UTF-8" );Edited by: ajmasx on Sep 27, 2007 10:20 AM

  • Load data in xml file into Pdf form created by LiveCycle Designer

    I want to load data in xml file into Pdf form when Pdf opened and Form field will be filled with data from xml file .I try to use $host.importdata("filename.xml"); But i could not find suitable place to run my code. Can anyone give me some advice? thank you.

    Hi,
    extract your xml and then you can use insert all clause.
    here's very small example on 10.2.0.1.0
    SQL> create table table1(id number,val varchar2(10));
    Table created.
    SQL> create table table2(id number,val varchar2(10));
    Table created.
    SQL> insert all
      2  into table1 values(id,val)
      3  into table2 values(id2,val2)
      4  select extractValue(x.col,'/a/id1') id
      5        ,extractValue(x.col,'/a/value') val
      6        ,extractValue(x.col,'/a/value2') val2
      7        ,extractValue(x.col,'/a/id2') id2
      8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
    2 rows created.
    SQL> select * from table1;
            ID VAL                                                                 
             1 a                                                                   
    SQL> select * from table2;
            ID VAL                                                                 
             2 b                                                                    Ants

  • Attach an xml to a pdf using ADS

    Hi all,
    I have a scenario where we are sending a Base64 encoded PDF (a bill) and the corresponding xml data from SAP backend on level 4.6C to PI 7.1. In PI we should attach the xml data to the PDF. I have already succeeded to do this using iText but we have a requirement to do this with ADS instead. In Netweaver Developer Studio I created an example project where I am reading a PDF as a byte array, also reading an XML file and try to attach the XML to the PDF using the ADS api. The project successfully built in NWDS but when I am running the project it failes.
    I am using standard code to attach the xml stream to the pdf, the error message is thrown when the following line is executed:
    IWDPDFDocument document = context.execute();
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.impl.PDFDocumentAccessibleContextWDImpl.execute(PDFDocumentAccessibleContextWDImpl.java:99)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.addAttachmentWithSap(PdfWithAttachment.java:129)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.main(PdfWithAttachment.java:218)
    Caused by: java.lang.NullPointerException
         at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getSystemDeployableObjectName(DeployableObjectInternal.java:53)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.<clinit>(AdobeFormHelper.java:115)
         ... 3 more
    Is it the problem with the PDF that it is not an Interactive Form?
    Or the problem is simply that I am trying to run the project on my local machine where ADS is not available?
    Thanks for your help.
    Pal
    Edited by: Pal Somogyi on Oct 17, 2010 10:30 PM
    Edited by: Pal Somogyi on Oct 18, 2010 11:44 AM

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file and re-generate a PDF.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64.
    You have mentioned that you have had to send a base 64 encoded pdf. Could you pelase guide me through the process?
    Thanks,
    Preethi.

  • JAXP working with XML-XSL files - urgent help

    I have the code below to transform xml file into html file using xsl file:
    Transformer transformer = tFactory.newTransformer(new StreamSource("D:/Test/26120108026263560502.xsl"));
    transformer.transform(new StreamSource("D:/Test/26120108028469387014574415483532664948806162003.xml"), new StreamResult(new FileOutputStream("D:/Test/Test.html")));
    The code works fine with simple xml, xsl files, but it shows strange error messages when transforming more complex xsl file, please look at the errors below:
    [Error] 26120108026263560502.xsl:3:80: Element type "xsl:stylesheet" must be declared.
    [Error] 26120108026263560502.xsl:4:58: Element type "xsl:output" must be declared.
    [Error] 26120108026263560502.xsl:6:75: Element type "xsl:include" must be declared.
    [Error] 26120108026263560502.xsl:12:25: Element type "xsl:template" must be declared.
    [Error] 26120108026263560502.xsl:14:7: Element type "html" must be declared.
    [Error] 26120108026263560502.xsl:15:7: Element type "head" must be declared.
    [Error] 26120108026263560502.xsl:16:8: Element type "title" must be declared.
    [Error] 26120108026263560502.xsl:17:75: Element type "xsl:value-of" must be declared.
    [Error] 26120108026263560502.xsl:19:74: Element type "meta" must be declared.
    [Error] 26120108026263560502.xsl:20:8: Element type "style" must be declared.
    [Error] 26120108026263560502.xsl:38:25: Element type "body" must be declared.
    [Error] 26120108026263560502.xsl:39:48: Element type "xsl:call-template" must be declared.
    [Error] 26120108026263560502.xsl:40:55: Element type "xsl:call-template" must be declared.
    [Error] 26120108026263560502.xsl:41:49: Element type "xsl:call-template" must be declared.
    [Error] 26120108026263560502.xsl:43:67: Element type "table" must be declared.
    [Error] 26120108026263560502.xsl:44:7: Element type "tr" must be declared.
    [Error] 26120108026263560502.xsl:45:21: Element type "td" must be declared.
    [Error] 26120108026263560502.xsl:45:24: Element type "b" must be declared.
    [Error] 26120108026263560502.xsl:45:51: Element type "br" must be declared.
    [Error] 26120108026263560502.xsl:46:123: Element type "xsl:value-of" must be declared.
    It look to me that JAXP can't recognize the tags. Everyone's help is appreciated.
    Neil

    Here is the top part of it: ***********************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="no" encoding="UTF-8" />
    <xsl:include href="http://connexion.vdr.com/ematrix/reports/xsllib.xsl" />
    <xsl:template match="/">
    <html>
    <head>
    <title>
    <xsl:value-of select="//businessObject[objectType='CRA']/objectName"/>
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <style>
    TABLE
    font-family: Arial Narrow, Tahoma, Verdana;
    border: #000000 solid;
    border-width: 2px 2px 0px;}
    TABLE.BOTTOM
    font-family: Arial Narrow, Tahoma, Verdana;
    border: #000000 solid;
    border-width: 2px 2px 2px;}
    TD.DATA, TH.DATA
    border: #cccccc solid;
    border-width: 0px 1px 1px 0px;}
    </style>
    </head>
    <body bgcolor="#FFFFFF">
    <xsl:call-template name="ECRHeaderTable" />
    <xsl:call-template name="ECRHeaderDetailsTable" />
    <xsl:call-template name="ECRDetailsTable" />
    Anh here is the top part of file xsllib.xsl in the xsl:include: ********
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!--*******************************************************************
    CalJulian - Calculate the Julian date for any date
    Inputs: Year - Year
    Month - Month
    Day - Day
    hour - hour (24 hour based, 0=midnight, 23=11pm)
    min - minute
    sec - second
    History:
    http://www.nr.com/julian.html
    *********************************************************************-->
    <xsl:template name="CalJulian">
    <xsl:param name="Year"/>
    <xsl:param name="Month" select="1"/>
    <xsl:param name="Day" select="1"/>
    <xsl:param name="Hour" select="0"/>
    <xsl:param name="Min" select="0"/>
    <xsl:param name="Sec" select="0"/>
    <xsl:variable name="jy">
    <xsl:choose>
    <xsl:when test="($Year < 0) and ($Month > 2)">
    <xsl:value-of select="$Year + 1"/>
    </xsl:when>
    <xsl:when test="($Year >= 0) and ($Month <= 2)">
    <xsl:value-of select="$Year - 1"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$Year"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    The files work fine when I use msxsl.exe without any errors. I forgot to mention that dispite all the errors, JAXP still creates the html file but seeing the errors is not a good thing.
    Neil

  • How to convert XML file to PDF

    Hi there,
    Does anyone know by any chance, how to covert XML file to PDF? Thanks

    Hello,
    You can convert most of the files in PDF by using the Print menu.
    Open the file you want to save in PDF and choose in the menu bar File > Print....
    You will see a will the Print window and at the left, click on the PDF button.
    Choose in the menu “Save as PDF...”
    Insert the name and you can also set security settings (like a password) and click on the “Save” button.
    Hope this will help.
    EDIT : (oups, dsimagry posted as the same time of me)

  • JEditorPane xml/xsl to html

    I have build a little and simple xml/xsl parser that recive the xml file and the xsl file and return me a String that rapresent an html document respecting the input files.
    Now, i try to put this string ina JEditpr Pane but if i set as ContentType text/html i just see a white background and if I set, again, as contentType text/plain I can read the html code that i need.
    Sorry if this could be a stupid question, I'm a newbie in Swing.
    thx to all
    0m4r
    here is a little example of what I do
    JEditorPane jep = new JEditorPane();
    jep.setContentType("text/html");
    jep.setText(returnStringFromXMLParser);

    this could be the problem
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">i try to not use this line of code and it works fine...ut the promlem is that this line is added ny the XMLParser...what can I do?
    the Transformer I use:
    public static String toHTML(Document doc, String xslSource){
            ByteArrayOutputStream testo = new ByteArrayOutputStream();
            try{
                DOMSource source = new DOMSource(doc);
                TransformerFactory tFactory = TransformerFactory.newInstance();
                System.out.println("----> " + xslSource);
                Transformer transformer = tFactory.newTransformer(new StreamSource(xslSource));
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
                transformer.setOutputProperty("encoding","iso-8859-1");   
                transformer.transform(source, new StreamResult(testo));
            }catch(Exception ioe){
                System.out.println("2 XMLTool.toHTML " + new java.util.Date());
                System.out.println(ioe);        
            return testo.toString();
        }

  • XML, XSL, XSLT, DOM??  What should be used?

    I want to develop an application using JSP, Java, mySQL, and XML.
    The application needs to be able to store data in the database but also define this data using XML. Some sort of style sheet for this data is also needed to assist in creating forms based on this data and style sheet on the fly for a new page that needs to be displayed based on the data that was entered before.
    What XML technolgoies could best help in this situation? Can you see any problems associated with building these pages on the fly based on the XML and XML style sheet???
    Any feedback or suggestions would be greatly appreciated?
    Thank you and I look forward to hearing from anyone that could help!!!!

    Two things. One JRUN has a JSP tag that converts XML and an XSL to XHTML. Despite the preference of some (who must work with only XML enabled browsers) many people on the internet and even some corporate intranets do not have XML enabled browsers thus the XML/XSL solution does not present usable data to them.
    The conversion to XHTML makes this data presented to ALL browsers.
    A good reason for having the XML is that this has become the defacto standard for communication between businesses/applications on the web. Especially with any Web Service usage XML will almost certainly be required. In other words, minimize rework use a "standard" data that is usable my many different layers of presentation.
    Hopefully I was clear enough. I am using XML as a pre-presentation data format and then using various forms (including JAXB) to present the data or manipulate the data depending on requirements.

Maybe you are looking for