DBMS_XSLPROCESSOR and xsl:import

Hi all!
I'm using Oracle 9.2 and DBMS_XSLPROCESSOR to transform my XML to HTML.
I build XML using DBMS_XMLDOM methods, build stylesheet using dbms_xslprocessor.newstylesheet,
then try to transform it using DBMS_XSLPROCESSOR.processXSL.
It work fine. But if I add <xsl:import href="http://server/myPackage.getXSL"/>
(myPackage.getXSL return another XSL) to my original xsl file, then dbms_xslprocessor.newstylesheet
function fails with error:
[1]: (Error): ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00412:
Message 412 not found; product=XDK; facility=LPX ORA-06512: at "XDB.DBMS_XSLPROCESSOR",
line 467 ORA-06512: at "XDB.DBMS_XSLPROCESSOR" ...
Does anybody have any ideas what is wrong ?
Thanks in advance,
Gregory.

Hi all!
I'm using Oracle 9.2 and DBMS_XSLPROCESSOR to transform my XML to HTML.
I build XML using DBMS_XMLDOM methods, build stylesheet using dbms_xslprocessor.newstylesheet,
then try to transform it using DBMS_XSLPROCESSOR.processXSL.
It work fine. But if I add <xsl:import href="http://server/myPackage.getXSL"/>
(myPackage.getXSL return another XSL) to my original xsl file, then dbms_xslprocessor.newstylesheet
function fails with error:
[1]: (Error): ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00412:
Message 412 not found; product=XDK; facility=LPX ORA-06512: at "XDB.DBMS_XSLPROCESSOR",
line 467 ORA-06512: at "XDB.DBMS_XSLPROCESSOR" ...
Does anybody have any ideas what is wrong ?
Thanks in advance,
Gregory.

Similar Messages

  • Xsl:include xsl:import and clob

    I can use xslprocessor.processXSL to perform transformation where the XML and XSL are in CLOBs.
    However, is it possible to perform transformation if the XML and XSLs are in CLOBs and the XSL have xsl:include and xsl:import?
    Thanks and Regards,
    Andy

    It will be supported in later release.

  • Using xsl:import and trying to access a variable defined in another xsl

    Hi
    I am having a a.xsl file with contents liek this :
    <xsl:variable name="PersonId" select="'1910'"/>
    inside b.xsl i am importing a.xsl like
    <xsl:import href="a.xsl"/>
    <xsl:value-of select="$PersonId"/>
    This is working fine when i am testing it standalone.
    when i port the code to weblogic server (meaning when all the
    project related files are placed in proper location in
    weblogic) and start the application then i get the error msg :
    xsl:1031 variable not defined 'PersonId'.
    i tried giving the enite path like :http://localhost:7001/....
    even then problem remains unresolved.
    am i making any mistake ?
    Thank you
    Regards
    Jaya

    This works fine for me with Oracle XSL Processor 9.0.2C
    <!-- a.xsl -->
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:variable name="PersonId" select="1910"/>
    </xsl:stylesheet>and
    <!-- b.xsl -->
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:import href="a.xsl"/>
      <xsl:template match="/">
       <xsl:value-of select="$PersonId"/>
      </xsl:template>
    </xsl:stylesheet>Make sure you're using the latest version of the XDK in your
    weblogic environment.

  • Xsl:import and xsl:call-template errors for xslt in mediator (ORAMED-03601)

    Hello,
    I decided for performance issues with bpel execution to use a mediator instead.
    In my requester i have a mediator that justs recieves an xml message, uses an xsl transformation (version 2) on that message and then sends it to the EBS.
    The xsl file that's works correctly when used in a bpel process has both <xsl:import..../>and <xsl:call_template.../> tags.
    When i tried and used the same xsl in the mediator i get an ORAMED-03601 error:
    ORAMED-03601:[Invalid transformer configuration]Unable to create transformer. It could be because of transformation file or configuration issues. Reason : "xsl/Xform_PriceListListABMReqMsg_to_PriceListEBMReqMsg.xsl"Possible Fix:Check log file for any exceptions and contact Oracle Support Services for further help
    It works correctly again if i comment/remove all the imports and call-template and incorporate them in the xsl file itself.
    Do anyone know if there are some limitations using xsl in a mediator instead of a bpel?

    Hi,
    I have a problem with call-template. I have passed
    sed some parameter with call-template tag and used
    that parameter in the conditional check tag <xsl:if>
    i am getting the error. Can any body tell how to use
    this? I actuall want to dynamically pass the tag name
    as the parameter and check the attribute value of the
    tag passed in the if condition and then i want to
    person some action. How can i do it?
    Here is the call-template code:
    <xsl:call-template name="selected-unselected">
    <xsl:with-param
    ram name="currentTag">motor-carrier</xsl:with-param>
    </xsl:call-template>
    Here is the template definition:
    <xsl:template name="selected-unselected">
    <xsl:param
    m name="currentTag">Quick-Quote</xsl:param>
         <xsl:if test="./{$currentTag}/@selected='true'">
              <xsl:text>checked</xsl:text>
         </xsl:if>
         <xsl:if test="./{$currentTag}/@selected='false'">
              <xsl:text>Unchecked</xsl:text>
         </xsl:if>
    </xsl:template>
    Here is the sample xml code:
    <motor-carrier selected="true"/>
    <motor-truck selected="false"/>
    <sched-mobile-equip selected="false"/>
    Here instead of writing the condition check for every
    tag i want to write it once and dynamically pass the
    tag name as parameter to the template. If the
    attribute of the tag has value true then one message
    should be displayed otherwise a different message
    should be displayed.try this:
    <xsl:template name="selected-unselected">
         <xsl:paramm name="currentTag">Quick-Quote</xsl:param>
         <xsl:if test="./*[name()=$currentTag]/@selected='true'">
              <xsl:text>checked</xsl:text>
         </xsl:if>
         <xsl:if test="./*[name()=$currentTag]/@selected='false'">
              <xsl:text>Unchecked</xsl:text>
         </xsl:if>
    </xsl:template>

  • Xsl:import and precedence?

    I am following Steve's example on using "ColumnOverrides.xsl"
    (page 700) to create drill down links for certain values I'm
    returning. Problem is, my generic:
    <xsl:template match="ROW/*">
    <td valign="top"><xsl:apply-templates/></td>
    </xsl:template>
    ...seems to be taking precedence over the templates I am
    <xsl:import>ing:
    <xsl:template match="ROW/Team">
    <td>
    <xsl:apply-templates/>
    </td>
    </xsl:template>
    <xsl:template match="ROW/League">
    <td>
    <xsl:apply-templates/>
    </td>
    </xsl:template>
    The ROW/Team and ROW/League returned values are not in hyperlink
    form.
    I can verify that the import is working by changing the ROW/*
    template to specify ROW/Team. When I do that, the value for team
    remains normal/un-hyperlinked, but the value for ROW/League is
    now the correct hyperlink! So, that leads me to believe that the
    ROW/* is taking precedence over the ROW/Team and ROW/League
    imports.
    Steve's book says to use xsl:import to make sure imported
    templates take higher predcedence. Am I missing something?
    Thanks. Excuse my lenghtly post.

    I figured it out. The <xsl:import>'s have to be in a particular
    order as well.

  • Xsl:include and xml:import

    I want to use another stylesheet within the original one.
    the documentation just said how to declare an
    xsl:include or xsl:import element as top level, but no examples about how to call the imported or included stylesheet.
    I'll appreciate any examples you can provide to me .
    Thanks
    Chris

    I've done this, and the way i think about it is that each "imported" XSL document combines (or are appended) into the XSL document that imports the other XSL documents. As such, all of the template matching that is occuring has to be consistent with the way the XML tags are matching up with XSL templates.
    It is important that the templates in each imported XSL document will match up to the XML tags that the templates are designed to transform.
    In other words, if i have an employee list <emp>, and an XSL template matching the <emp> element, i can produce a transformation on the list itself. now, i can define a transformation for a child element of <emp> by "importing" the XSL document that defines the template match for the child element (for example, "emp/lastName" can be what the second XSL document matches on).
    Long story short, if you can paste the imported XSL into the importing XSL and things still work, then you can separate them out into multiple modular XSL files for inclusion.
    -dave
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Christos Kouros ([email protected]):
    I want to use another stylesheet within the original one.
    the documentation just said how to declare an
    xsl:include or xsl:import element as top level, but no examples about how to call the imported or included stylesheet.
    I'll appreciate any examples you can provide to me .
    Thanks
    Chris<HR></BLOCKQUOTE>
    null

  • Not able to use xsl:import in my XSL doc

    Hi,
    I'm using Oracle 9.2.0.6.0 and DBMS_XSLPROCESSOR to transform my XML.
    I build XML using DBMS_XMLDOM methods, build stylesheet using dbms_xslprocessor.newstylesheet,
    then try to transform it using DBMS_XSLPROCESSOR.processXSL.
    It work fine. But if I add <xsl:import href="new_file.xsl"/> to my original xsl file, then dbms_xslprocessor.newstylesheet
    function fails with error:
    [1]: (Error): ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00412:
    Message 412 not found; product=XDK; facility=LPX ORA-06512: at "XDB.DBMS_XSLPROCESSOR",
    line 467 ORA-06512: at "XDB.DBMS_XSLPROCESSOR" ...
    Any ideas??
    Thanks in advance
    Fred

    One idea. Do you have the namespace for the new_file.xsl defined?

  • Xsl:import in XSL templates

    Hi,
    I have BIP version 5.6.3 in EBS.
    I have an XSL-TEXT template and I would like to use the <xsl:import> statement to import subtemplates.
    So I do:
    <xsl:import href="http://myapps.xxx.yy:8000/OA_MEDIA/my_subtemplate.xsl"/>This works pretty well, if I place my template file in the $OA_MEDIA folder on my APPS server.
    BUT: This is using an absolute path to my server (myapps.xxx.yy:8000 in this case). For my development environments this absolute path is different of course.
    So my question:
    Does anybody know how to refer to my subtemplates by relative paths, or to construct an xsl:import statement that allows to have different paths based on the environment that I am currently working on?
    Thanks,
    David.

    Hi,
    well, the templates are always in the same path on the server, they are all either uploaded to Template Manager in BIP or stored in $OA_MEDIA.
    But the server name is different of course.
    Oracle has implemented a nice feature to reference to subtemples in RTF templates, would be nice if one could do the same in XSLT.
    Thanks,
    David.

  • XSL transformation with xsl:import generates exceptions

    I am using the Schematron's basic XSL file basic-schematron.xsl to validate the XML format of one of our data files. The XSL file looks something like this
    ================
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias">
    <xsl:import href="skeleton1-5.xsl"/>
    <xsl:template name="process-prolog">
    <axsl:output method="text" />
    </xsl:template>
    ==================
    But, the validation fails while trying to run the transformation on my Schematron input file using this basic-schematron.xsl with java.lang.NoSuchMethodError:
    ======= OUTPUT ============
    Markup Error: no match attribute on <key> outside <rule>
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: GregorSamsa.process$dash$root(Lcom/sun/org/apache/xalan/internal/xsltc/DOM;Lcom/sun/org/apache/xml/internal/dtm/DTMAxisIterator;Lcom/sun/org/apache/xml/internal/serializer/SerializationHandler;ILjava/lang/Object;)V
         at GregorSamsa.applyTemplates()
         at GregorSamsa.applyTemplates()
         at GregorSamsa.transform()
         at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:594)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:640)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
         at com.solipsa.xsdvalidator.XSDValidator.validateSchematron(XSDValidator.java:137)
         at com.solipsa.xsdvalidator.XSDValidator.validate(XSDValidator.java:181)
         at com.solipsa.xsdvalidator.XSDValidatorUI.jButton1ActionPerformed(XSDValidatorUI.java:244)
         at com.solipsa.xsdvalidator.XSDValidatorUI.access$300(XSDValidatorUI.java:21)
         at com.solipsa.xsdvalidator.XSDValidatorUI$4.actionPerformed(XSDValidatorUI.java:140)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1766)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ============= OUTPUT ==============
    I tried the individual JAXP 1.3 for J2SDK 1.4.2 (Using the -Djava.endorsed.dirs JVM param) and tried the JDK 1.5.0_02 which has JAXP 1.3 inbuilt and they all fail.
    I tried the above with separate Xalan/Xerces jar files, and then it works fine.
    The problem seems to be somthing specific to the JAXP 1.3 environment. I can provide more details, if required. Any help is highly appreciated.

    One morning your code woke up and found it had been transformed into a giant insect.
    But seriously, here's the name of the method that doesn't exist:GregorSamsa.process$dash$rootIs GregorSamsa your class? Maybe your server has an old version of it which is missing that method? (Or: those $ signs look strange to me, maybe they are a mistranslation of some other character?)

  • Help-XML report which uses XSL-FO and XSL-FO contains OAF VO

    Hello All,
    I want to know functionality of one XML report developed by Oracle.
    From one oracle form after clicking one button, it is populating PDF file output of report to open.
    Here is what Oracle has done to achieve this:
    On the click of button on oracle form, it is calling one OAF form. (fnd_function.execute(function_name=> 'ONT_PRINT').
    This OAF form contains nothing on its layout. One CO (File is attached) and AM is attached to this OAF page.
    In CO, may be it is somehow it is calling RTF file.
    I got the RTF file from XML publisher, RTF imports one XSL-FO (ONTBSAEXSL is a Template of XSL-FO type in Oracle apps in XMP Publisher administrator responsibility) file using <?import:xdo://ONT.ONTBSAEXSL.en.00/?>
    In the XSL file, OAF View Objects has been used like,
    <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    What is the meaning of " /*/HeaderVO/HeaderVORow/LinesVO "? Does it mean LinesVO is getting called by HeadersVO. But in OAF this never happens.
    I want to add some columns in the RTF from LinesVO. But "Unit price" is not available in LinesVO.
    Do I need to extend this VO in JDeveloper and upload the .JPX and extended VO files?
    I have done extending the VO, but no use..
    So,
    In short my question is,
    If I extend the VO LinesVO by XXLinesVO, then will this <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    statement in XSL-FO use my XXLinesVO or LinesVO?
    Regards,
    Parag

    I want to customize one RTF template by adding some columns. This RTF imports one XSL-FO stylesheet.
    RTF has tags like <?for-each:/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow?>
    and XSL file has tags like <xsl:variable name="InternalOrgName" select="/*/HeaderVO/HeaderVORow/InternalOrgVO/InternalOrgVORow/Name"/>
    If I want to add one colun in LinesVO, what are all things I need to do?
    I customized it by adding the new columns through JDeveloper and extending the VO's and substituting them, importing JPX and bounced apache.
    But the XSL-FO file is very strange (attached herewith). Those changes are not reflecting in report even after extension.

  • JSF, tiles, xml and xsl

    Good days people, I am employed at an app that wants to integrate JSF, tiles, xml and xsl.
    Basically the app receives information of the user's interfaz, builds an url with the above mentioned information and invokes to a service web that a xml returns with the information. The idea is to generate the exit in format html or wml with an insole(staff) xsl and to send the result in this format to every jsp that is going to form a part of the page that it will generate tiles. at first I understand that it is feasible, i�d like to know if someone already has done it and since it has done it.
    Just now what I have is a managed bean that receives the parameters of the altar frontal and invokes a method of a service, like this:
    public String encuentra(){
    //deja los atributos privados rellenos.
    String mensaje ;
    crearYRellenarBusquedaVO();
    try {
    setResultado(this.getServicio().obtenerResultadosWML(this.getBusquedaVO()));
    mensaje="succesNoJS";
    }catch(java.lang.IllegalArgumentException e){
    mensaje="error";
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    mensaje="error";
    }catch(Exception e2){
    mensaje="error";
    return mensaje;
    public String obtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO){
    if (busquedaVO == null){
    throw new IllegalArgumentException(
    "obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO) - 'busquedaVO' no puede ser nulo.");
    try{
    return this.manejarObtenerResultadosWML(busquedaVO);
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e1.getCause(),e1);
    }catch(Exception e){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e.getCause(),e);
    //it returns html code!
    protected String manejarObtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO)
    throws java.lang.Exception{
    try{
    // xmlOrigen has full xml response from server
    String xmlOrigen = manejarObtenerResultadosJSActivado(busquedaVO);
    Source xmlSource = new StreamSource(new StringBufferInputStream(xmlOrigen));
    Source xsltSource = new StreamSource(SrvBusquedaNoxtrumServiceImpl.class.getResourceAsStream(Constantes.XSL_FILE));
    StringWriter cadenaSalida = new StringWriter();
    Result bufferResultado = new StreamResult(cadenaSalida);
    TransformerFactory factoriaTrans = TransformerFactory.newInstance();
    Transformer transformador = factoriaTrans.newTransformer(xsltSource);
    transformador.transform(xmlSource, bufferResultado);
    System.out.println(cadenaSalida.toString());
    return cadenaSalida.toString();
    }catch(Exception e2){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException (e2.getMessage());
    With this exit in html, since(as,like) how could i forward it towards a jsp especially?
    faces-config.xml
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>succesNoJS</from-outcome>
    <to-view-id>/jsDesactivado.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>error</from-outcome>
    <to-view-id>/error.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    index.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <f:view>
    <f:loadBundle basename="MessageResources" var="msg"/>
    <head>
    <title>
    ${msg.titulo}
    </title>
    </head>
    <body>
    <h:form id="formulario">
    Que:
    <h:inputText id="campoQue" value="#{yellProxy.campoQue}" />
    Donde
    <h:inputText id="campoDonde" value="#{ yellProxy.campoDonde}" />
    <h:commandButton id="boton" value="Encuentra" action="#{yellProxy.encuentra}"/>
    </h:form>
    </f:view>
    </body>
    </html>
    jsDesactivado.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!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>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    jsDesactivado!!
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    <jsp:getProperty name="yellProxy" property="resultado"/>
    </body>
    </html>
    If you could pass me a simple example of use of an app that uses JSF, tiles, xml and xsl, i�be grateful
    regards a lot!

    We too (at Viking Freight) would also be very interested to see if anybody
    has produced such a useful series of classes...
    Frank Lees, Developer
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: Wednesday, January 19, 2000 12:11 PM
    To: 'Forte User'
    Subject: (forte-users) XML and XSL in Forte
    Has anybody integrated an XSL parser with Forte. I know Forte provides us
    with an XML parser but that does not help with parsing XSL. There a lot of
    parsers written in JAVA but that will not integrate well with Forte. We
    need something that will be easy to integrate with Forte. This parser will
    take our XML and XSL to give us a result set. If anybody can comment on the
    subject or share some information I would appreciate it.
    thanks in advance.
    ka
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • Converting XML and XSL into HTML

    Hello!
    I'm designing a servlet class that merges an xml file and xsl file into html that will be sent to the client. But I don't understand how the (sparsely documented) javax.xml.transform.dom package works. An exception is generated for a missing "version" tag, when I've included one that has worked on client-side xml/xsl pages before. If it matters, I'm using Apache Tomcat/JDK 1.4.
    Here's the code:package mypackage.servlet.xml;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class XML2HTMLServlet extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {
              response.setContentType("text/html");
              PrintWriter writer = response.getWriter();
              try {
                   openFile("D:/Webdev/xml2html/data.xml", "D:/Webdev/xml2html/style.xsl", writer);
              } catch (Exception e) {
                   e.printStackTrace(writer);
         private void openFile(String xmlPath, String xslPath, PrintWriter writer)
          throws IOException, ParserConfigurationException, SAXException,
          TransformerConfigurationException, TransformerException {
              File xmlFile = new File(xmlPath);
              File xslFile = new File(xslPath);
              TransformerFactory tFact = TransformerFactory.newInstance();
              DocumentBuilderFactory dbFact = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = dbFact.newDocumentBuilder();
              Document xmlDoc = builder.parse(xmlFile);
              Document xslDoc = builder.parse(xslFile);
              Node xmlDocNode = (Node)xmlDoc;
              Node xslDocNode = (Node)xslDoc;
              DOMSource xmlSrc = new DOMSource(xmlDocNode);
              DOMSource xslSrc = new DOMSource(xslDocNode);
              DOMResult htmlResult = new DOMResult();
              Transformer transformer = tFact.newTransformer(xslSrc);  // the exception occurs here!
    When it runs, it complains:
    javax.xml.transform.TransformerConfigurationException:
    javax.xml.transform.TransformerConfigurationException:
    javax.xml.transform.TransformerException:
    javax.xml.transform.TransformerException: stylesheet requires attribute: version at
    org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:767) at
    mypackage.servlet.xml.XML2HTMLServlet.openFile(XML2HTMLServlet.java:49) at
    ...etc...etc...
    data.xml contains:
    <?xml version="1.0"?>
    <document type="lecture">
         <title>Test Data</title>
         <section>
              <name>A New Section</name>
         </section>
    </document>
    style.xsl contains:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <html>
              <head>
                   <title><xsl:value-of select="document/title"/></title>
              </head>
              <body>
                   <xsl:apply-templates select="document/section"/>
              </body>
         </html>
    </xsl:template>
    <xsl:template match="section">
         <div><i>Section</i><br/><xsl:value-of select="name"/></div>
    </xsl:template>
    </xsl:stylesheet>I'm not sure the method calls above are what I want, so here's the client-side equivalent in Internet Explorer 5.0:
    function createStyledXMLDocument(xmlUrl, xslUrl) {
         var xmlDocument = new ActiveXObject("Microsoft.XMLDOM");
         xmlDocument.load(xmlUrl);
         var xslDocument = new ActiveXObject("Microsoft.XMLDOM");
         xslDocument.load(xslUrl);
         return xmlDocument.transformNode(xslDocument);
    }Any help would be greatly appreciated.

    Hi!
    I found the immediate answer with
    dbFact.setNamespaceAware(true);As for parser, I'm just using the default JDK install. But I'd like to hear more on Xalan. Is it independent open source? How does Xalan compare to whatever is default in JDK?
    Thanks

  • Xsl:import error

    Why oracle xmlparserv2 dosen't support <xsl:import href="b.xsl"/>?
    What's the error message mean?
    "oracle.xml.parser.v2.XMLParseException: Error while processing include XSL file (b.xsl).
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205)......
    It's working at Xalan or Saxon but not Oracle!

    I think the error message is telling you that the visual design surface that simplifies creating transforms doesn't support the <xsl:import>. If you need to use <xsl:import>, and assuming that <xsl:include> (which is quite similar to import) is also not supported, then the only other option is working on the XSLT stylesheet in the source editor.

  • Xsl:import or xsl:include for ESB projects ?

    I have an XSLT stylesheet transformer in a routing service on the ESB, and it uses an <xsl:import> of another stylesheet. I have forced the auxiliary stylesheet into the project zip for deployment alongside the main stylesheet, but the XSLT engine cannot resolve the imported file, the error is either:
    "No protocol" if I just use "foo.xsl"
    "FileNotFound if I try "file:foo.xsl"
    The XSLT engine should import a relative URI wrt the main stylesheet, but it appears it cannot handle relative URIs, and what it's really expecting is a file: or classpath: protocol.
    Any ideas what URI incantation I need for it to locate the imported stylesheet ?
    Mik

    A bit of reverse engineering of the error message, reveals the shocking fact that I have to use this URI:
    <xsl:import href="esb:///ESB_Projects/MyProject_esb/foo.xsl" />
    So the stylesheets have to be modified from the original form used outside the ESB, and even changed depending on the project which contains them !
    Please tell me there's a better way ?
    Mik

  • Using xsl:import in Weblogic

    All,
    I have a requirement to import an XSL template into another XSL template and use one of the methods defined in the imported file into this importing file. The problem is that it works perfectly fine if I do this in XMLSPY .. but if I do this thru weblogic it throws me an error and doesnot perform the action.
    Would appreciate if someone could suggest what I can do to solve this problem.
    Thanks ,
    Adarsh

    This works fine for me with Oracle XSL Processor 9.0.2C
    <!-- a.xsl -->
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:variable name="PersonId" select="1910"/>
    </xsl:stylesheet>and
    <!-- b.xsl -->
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:import href="a.xsl"/>
      <xsl:template match="/">
       <xsl:value-of select="$PersonId"/>
      </xsl:template>
    </xsl:stylesheet>Make sure you're using the latest version of the XDK in your
    weblogic environment.

Maybe you are looking for

  • General question about storage, networking, and using large amounts of data

    I have been using a powermac tower G5 up until now. I bought my daughter a macbook pro 15" i7, talk about a zippy little machine. What a screamer. I can't believe how fast it is with final cut express, Aperture, and Photoshop. I tend to use higher en

  • Problem in Edit Message Payload in AE

    Hi all, actually we have a problem with editing the message payload of a failed message in the adapter engine. Messages Editor shows "The version you want to edit is locked" Log in NWA shows "EditorDynPage: loadMessage() Thrown: com.sap.aii.mdt.api.e

  • Connecting G5 with Sony Trinitron Only---Problems

    I am running MediaCentral on my Powermac G5 to turn it into a media center. All I want to do is connect my Sony Trinitron to the G5. I bought the comosite/S-Video adapter from Apple. However, when I plug in my TV, I get absolutely no picture on the s

  • To play a stream audio file with external program...

    Hi, I get with stream a sound file and I have to play it using an external program like VLC, reading the file continuously of a buffer. How can I do it? Would I have to controll VLC commands? I have been reading about it, but I have no idea how to do

  • Best android apps?

    I just got my shipment notification and my new Droid X is supposed to arrive tomorrow afternoon. I am very excited and will be new to the Android market, I want to know what is everyone's favorite app and why? Thanks for your answers in advance.