IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  problem to transform xml and xslt to html

    Posted Sun February 18, 2007 11:07 PM

    Hi,
    I have a problem when I try to generate html from xml and xslt pages in Java code. I have to use the instruction and it doesn’t work:

    //ERROR in the under function “TransFact.newTransformer”
    Transformer trans = transFact.newTransformer(xsltSource);

    and appears the following error:


    ERROR: ‘Sintax Error in ‘rp210Elements:ClipCreationDateAndTime >> .’.’
    ERROR: ‘It could not compile the stylesheet’
    Exception in thread “main” javax.xml.transform.TransformerConfigurationException: No se ha podido compilar la hoja de estilos
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source)
    at test.exampleSimple1(test.java:51)
    at test.main(test.java:70)

    The java code is very simple and I don’t know what more to test.

    I need a solution as soon as possible because it’s urgent to deliver the java application.

    If someone sould help me I will be very grateful.

    NOTE: Have a look to the attached file. Files DVD.xml, FX.xslt, Report.xslt, Storyboard.xslt and the java code.

    Regards,
    Diego
    error.rar (21.1 KB)


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: problem to transform xml and xslt to html

    Posted Mon February 19, 2007 01:27 PM

    Hi,
    Your stylesheet uses the XSLT 2.0 >> (order comparison) operator but you are trying to compile it using an XSLT 1.0 stylesheet processor. This will not work.


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: problem to transform xml and xslt to html

    Posted Mon February 19, 2007 02:38 PM

    Thanks a lot, I didn’t know why it was,
    It’s true that you say.
    You know what java library could I use to generate it with XSLT 2.0 stylesheet processor. If you could help me I will be very grateful.
    Regards,
    Diego

    Your stylesheet uses the XSLT 2.0 >> (order comparison) operator but you are trying to compile it using an XSLT 1.0 stylesheet processor. This will not work.


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: problem to transform xml and xslt to html

    Posted Mon February 19, 2007 04:13 PM

    Hi,
    There are several XSLT 2.0 processors but you could start with Saxon-B 8.9 from [url]http://saxon.sourceforge.net/[/url]. To make it work, install Saxon and put …\saxon\Saxon8.jar into classpath, and change your code to override the default xslt processor:

    System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl");

    Finally you need to remove the attribute “version=…” from the <xsl:output method=“html”…> lines in your xslt 2.0 stylesheets, or replace them with <xsl:output method=“xhtml” version=“1.0”…
    Then they should work fine.
    Cheers
    Bill


    #API-Management
    #webMethods
    #Tamino