Can I have JavaScript in an XSLT stylesheet?

I posted this first on the Dreamweaver forum, and it was suggested that I post here instead...
I have two related (I think) problems.
I am using Dreamweaver CS4 in Windows XP, Service Pack 3.
I have created an XSLT stylesheet that transforms a simple XML file into HTML. I have a very short JavaScript that writes the day's date into the document. It is a script that I have used in many other HTML pages. The XSLT stylesheet also has a Spry widget, an accordion, in one of its DIV elements. Originally, I developed the accordion as part of a Dreamweaver template, and it works fine there. I cannot get the scripts to work completely in Firefox and Internet Explorer.
If I just link in the external JavaScript files, the XML document displays correctly in both browsers. Note that MY external JavaScript file is the definition of one function, today(). The other JavaScript file is the Spry js file for the accordion widget. Of course the widget displays, but is not functional.
If I add the script to display the date (document.write(today()); document.close();) in one of the DIVs, Internet Explorer(7) displays the date correctly in the correct location AND displays all the other content correctly, including the accordion, which of course is not functional. However, FireFox (latest version) displays ONLY the date in a white background and NOTHING else, such as background image, other DIVs with content, the accordion widget, etc.
If I add the script to instantiate the accordion widget, FireFox displays the date and nothing else, as before. Internet Explorer displays the date, the other content, and the accordion widget, as before, but the widget is still not functional, that is, the accordion does not close or open when the panels are clicked.
So, do I have to be extra careful on where I place scripts in an XSLT? Or is there some reason why scripts in an XSLT file do not work? It seems that once the browser transforms the XML file into HTML, which includes the scripts, it should display correctly.
For now, I am trying to create a whole page XSLT, not fragments.
Thanks,
Van

Not sure what you mean by a CDATA section. But here is the XSLT file showing the template for the root element. The script is included using a <script> element, inserted in the <head> element. Should it be some place else?
<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="Trial procedure.xml" -->
<!DOCTYPE xsl:stylesheet  [
    <!ENTITY nbsp   "&#160;">
    <!ENTITY copy   "&#169;">
    <!ENTITY reg    "&#174;">
    <!ENTITY trade  "&#8482;">
    <!ENTITY mdash  "&#8212;">
    <!ENTITY ldquo  "&#8220;">
    <!ENTITY rdquo  "&#8221;">
    <!ENTITY pound  "&#163;">
    <!ENTITY yen    "&#165;">
    <!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><xsl:value-of select="MovexUser/Title"/></title>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="resources/navigatorSpryAccordion.css" rel="stylesheet" type="text/css" />
</head>
<body id="body">
--- The JavaScript funtions are called inside DIV elements here. ---
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Similar Messages

  • Can I use some JavaScript in an XSLT stylesheet?

    I have two related (I think) problems.
    I am using Dreamweaver CS4 in Windows XP, Service Pack 3.
    I have created an XSLT stylesheet that transforms a simple XML file into HTML. I have a very short JavaScript that writes the day's date into the document. It is a script that I have used in many other HTML pages. The XSLT stylesheet also has a Spry widget, an accordion, in one of its DIV elements. Originally, I developed the accordion as part of a Dreamweaver template, and it works fine there. I cannot get the scripts to work completely in Firefox and Internet Explorer.
    If I just link in the external JavaScript files, the XML document displays correctly in both browsers. Note that MY external JavaScript file is the definition of one function, today(). The other JavaScript file is the Spry js file for the accordion widget. Of course the widget displays, but is not functional.
    If I add the script to display the date (document.write(today()); document.close();) in one of the DIVs, Internet Explorer(7) displays the date correctly in the correct location AND displays all the other content correctly, including the accordion, which of course is not functional. However, FireFox (latest version) displays ONLY the date in a white background and NOTHING else, such as background image, other DIVs with content, the accordion widget, etc.
    If I add the script to instantiate the accordion widget, FireFox displays the date and nothing else, as before. Internet Explorer displays the date, the other content, and the accordion widget, as before, but the widget is still not functional, that is, the accordion does not close or open when the panels are clicked.
    So, do I have to be extra careful on where I place scripts in an XSLT? Or is there some reason why scripts in an XSLT file do not work? It seems that once the browser transforms the XML file into HTML, which includes the scripts, it should display correctly.
    Thanks,
    Van

    Not sure what you mean by a CDATA section. But here is the XSLT file showing the template for the root element. The script is included using a <script> element, inserted in the <head> element. Should it be some place else?
    <?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="Trial procedure.xml" -->
    <!DOCTYPE xsl:stylesheet  [
        <!ENTITY nbsp   "&#160;">
        <!ENTITY copy   "&#169;">
        <!ENTITY reg    "&#174;">
        <!ENTITY trade  "&#8482;">
        <!ENTITY mdash  "&#8212;">
        <!ENTITY ldquo  "&#8220;">
        <!ENTITY rdquo  "&#8221;">
        <!ENTITY pound  "&#163;">
        <!ENTITY yen    "&#165;">
        <!ENTITY euro   "&#8364;">
    ]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
    <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><xsl:value-of select="MovexUser/Title"/></title>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="resources/navigatorSpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body id="body">
    --- The JavaScript funtions are called inside DIV elements here. ---
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  • Can we have javascript function in the HTML header of Page 0

    Hello,
    I want to have a javascript function implemented on page zero, Can anyone help me out with this issue.
    Thanks,
    Orton

    There is no HTML Header on Page Zero. The equivalent would be to use the page template.
    It's also possible to place JavaScript in HTML regions on Page Zero, but I wouldn't consider this a good practice. JavaScript is better kept in external files and referenced using the SRC attribute.

  • Use Java to process the XSLT stylesheet

    Background:-
    I used Java to design a very simple Interface, which was composed of two components, one is an editable comboBox, the other is a button. What I want to achieve is selecting the value in the combobox and clicking the button, then it will achieve the relevant transformation process against the value selected from the comboBox.
    Implementation:-
    The transformation process is to extracting a set of information about a certain bird from an XML document, which contains many birds' information, to form a new XML document of one bird. The bird that I want to transform is listed in the comboBox and can be selected there. I use the Java to control the transformation process. My design is: I use Java programme to read the selected comboBox's value (bird name) and pass this value to the XSLT stylesheet, which is used to transform the XML document to a new XML document. What I have implemented: The Java programme has successfully controlled the transformation process, but I have defined in the XSLT stylesheet the bird name in advance. So the transformation is limited.
    What I want:-
    What I want is the transformation process will be carried out based on the value (bird name) read from the comboBox on the interface. And I hope to use Java to achieve this design!
    XSLT stylesheet code:-
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:template match="node()">
         <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="class[own-slots/own-slot/entry/value = 'Barn_swallow']">
         <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:stylesheet> I am very appreciated if you can provide me some helps kindly!
    Thanks a lot! Waiting for your nice suggestions!
    David

    I mean, you can find the bird name(Barn_swallow) in my
    attached XSLT stylesheet code. This name was actually
    defined in advance. What I want to perform now is to
    use the Java program to get the bird name from the
    comboBox (you have gave out the method) and pass it to
    the XSLT(actually needed to implement by Java), then
    continue to use the Java programe to achieve the
    transformation process (this step, I think, has been
    achieved.) Obviously, how to perform the second step
    "pass it to the XSLT" is the current task!What can you do already? Can you get a Transformer object from a TransformerFactory? If so, then simply call its setParameter("bird", "Barn Swallow") method. You'll have to declare a top-level xsl:param element whose name is "bird" in your XSL transformation, which you can then use as if it were a variable.

  • How can I have a backing file call a JavaScript function?

    I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
    thanks

    Hi
    your questions are not correct because you are mixing up server side operations with client side operations.
    First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
    However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
    <script type="text/javascript">
    var action = '${requestScope.action}';
    alert(action);//or whatever you want to do
    <c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
    callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
    </c:if>
    </script>
    i.e. you can output the javascript that has the variables you need or the function calls you want.
    Like I said understand whats server side and whats client side.

  • Firefox says that in order to load a webpage, I have to have javascript enabled. When I follow the instructions, it shows that java IS installed, but I still can't load the page. What can I do to fix this?

    When I try to load certain webpages, a message says I have to have Javascript enabled with instructions on how to enable Javascript. Javascript IS enabled, but I still get the same message. What can I do to fix this?

    To avoid confusion: http://kb.mozillazine.org/JavaScript_is_not_Java
    http://kb.mozillazine.org/Java <br />
    http://kb.mozillazine.org/JavaScript

  • Can I have a conditional javascript:apex.confirm when column is null

    Hi All,
    I am relatively new to the product but am picking up things all the time. I was recently asked to create a confirmation on submit dialog which I did quite easily using javascript:apex.confirm. I was then asked to only display the confirmation message if a comment column was empty. The column is optional but it is preferred if something is added. I am using 4.1.1. Is this possible? Any ideas would be appreciated
    Regards
    Chris

    Hello Chris,
    >
    user4023958 wrote:
    I am relatively new to the product but am picking up things all the time. I was recently asked to create a confirmation on submit dialog which I did quite easily using javascript:apex.confirm. I was then asked to only display the confirmation message if a comment column was empty. The column is optional but it is preferred if something is added. I am using 4.1.1. Is this possible? Any ideas would be appreciated.
    >
    How have you implemented the apex.confirm?
    <ul>
    <li>If you have done it in dynamic action on button click then you have to make the dynamic action conditional by using Item/Column value is not null condition with expression as your comment item say P1_COMMENTS</li>
    <li>If you have done it in Button Action as Redirect to URL then simply you can write a javascript function in your page header as :
    <script type="text/javascript">
    function f_showConfirm () {
      if ($x('P1_COMMENTS').value == '') {
        apex.confirm('Do you want to submit this page?', 'SUBMIT');
      } else {
        apex.submit('SUBMIT');
    </script>and call this javascript function in Button Action - Redirect to URL with URL Target set as:
    javascript:f_showConfirm();</li>
    </ul>
    In order to get accurate/appropriate response you should include relevant details from following information with your question:
    <ul>
    <li>Full APEX version</li>
    <li>Full Database version</li>
    <li>APEX Web server architecture (EPG, OHS or APEX listener)</li>
    <li>Browser(s) and version(s) used</li>
    <li>Operating system with version, architecture(32/64)</li>
    <li>Theme</li>
    <li>Template(s)</li>
    <li>Region/item type(s)</li>
    </ul>
    The above information will help the forum members to ascertain the problem context and post most relevant response.
    Please read the [url https://wikis.oracle.com/display/Forums/Forums+FAQ]FAQ and [url https://forums.oracle.com/forums/ann.jspa?annID=1324]forum instructions for more information on using OTN forums effectively.
    Please update your forum profile with a real handle instead of user4023958.
    Hope it helps!
    Regards,
    Kiran

  • Default XSLT Stylesheet to transform BW XML Data?

    I'm currently working on a deafult XSLT Stylesheet to convert a BW XML Query Result Set into an html grid.
    [code]
    <!--
    #==========================================================================
    XSL Transformation that displays
    Template Properties, List of Data Providers and List of Items
    #==========================================================================
    -->
    <xml id="xsl_transform_1">
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="header">
    <tr bgcolor="white"> <xsl:for-each select="//RRWS_SX_TUPLE[1]/*">
      <td>
      <xsl:value-of select="local-name()"/>
      </td>
    </xsl:for-each>
    </tr>
    </xsl:variable>
    <xsl:template match="/">
    <table bgcolor="gold" border="1">
    TESTVALUE -
    <tr>
      <xsl:copy-of select="$header" /> <xsl:apply-templates />
    </tr>
    <xsl:for-each select="//RRWS_SX_TUPLE">
          <tr>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
              <xsl:for-each select="//RRWS_S_CELL">           
              <td><xsl:value-of select="CELL_ORDINAL"></td>
              </xsl:for-each>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
            <td><xsl:value-of select="CHANM"/></td>
            <td><xsl:value-of select="CAPTION"/></td>
            <td><xsl:value-of select="CHAVL"/></td>
            <td><xsl:value-of select="CHAVL_EXT"/></td>
            <td><xsl:value-of select="NIOBJNM"/></td>
            <td><xsl:value-of select="TLEVEL"/></td>
            <td><xsl:value-of select="DRILLSTATE"/></td>
            <td><xsl:value-of select="OPT"/></td>
            <td><xsl:value-of select="SIGN"/></td>                    
            <td><xsl:value-of select="ATTRIBUTES"/></td>     
          </tr>
    <xsl:for-each select="//RRWS_S_CELL">
         <tr>     
            <td><xsl:value-of select="CELL_ORDINAL"/></td> 
            <td><xsl:value-of select="VALUE"/></td>            
            <td><xsl:value-of select="FORMATTED_VALUE"/></td> 
            <td><xsl:value-of select="VALUE_TYPE"/></td> 
            <td><xsl:value-of select="CURRENCY"/></td> 
            <td><xsl:value-of select="UNIT"/></td> 
            <td><xsl:value-of select="MWKZ"/></td> 
            <td><xsl:value-of select="NUM_SCALE"/></td> 
            <td><xsl:value-of select="NUM_PREC"/></td> 
            <td><xsl:value-of select="CELL_STATUS"/></td> 
            <td><xsl:value-of select="BACK_COLOR"/></td> 
         </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    <xsl:template match="RRWS_S_CELL/*">
    <td> <xsl:value-of select="." /> </td>
    </xsl:template></xsl:stylesheet>
    </xml>
    [/code]
    I've started this, but I need to join the top tree with the bottom. Right now I'm just flattening the tree. Does anyone know if any work has been done in this area? I'm looking to create these XSLT Transforms. Also, I'd like to create generic javascript functions that I can use as an include, such as
    function join_BW_Table(table1, table2, fieldtojoin, typeofjoin)
    This would allow anyone to generically combine BW Data from multiple sources all on the FrontEnd and render it all as an html table. My ultimate goal would be have all this in includes and available for all BW Reporting. Anyone have any thoughts on:
    1. Has this been done before?
    2. If it hasn't, anyone have comments on how I can combine the 2 tables that I'm rendering with the attached XSLT transform?
    I'm running these transforms via a javscript function on the load of the html page.
    Prakash

    Prakash,
    did you ever compile the Stylesheet?  I am looking for an alternative way to format the pre-compiled XML file from the Report Designer.  The more complex my report is, the less robust the application becomes.
    Your insight would be greatly appreciated.
    Thank you

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • Calling java instance methods in XSLT stylesheet

    HI
    I know this has been answered in this forum but I cnanot get it to work.
    Before calling the transform() method on my transformer instance I do the following
    transformer.setParameter( "Confirm", confirm)confim is an instance of one of my own classes. I want to get the
    XSLT stylesheet to call a method on this object. The method sig is
    public void setTitle(String title)Accordingly in my stylesheet I do the following
    <xsl:param name="Confirm"/>having already declared the java namespace in my stylesheet element as xmlns:java="java", and later on call the setTitle method
    <xsl:value-of select="java:setTitle($Confirm,$Title)/>where $Title is another var generated in the XSLT.
    This should work, right? Well I get an error
    'The first argument to the non-static Java function 'setTitle' is not a valid object reference.'But it is as I can do this
    <xsl:value-of select="$Confirm"/>Thanks
    Mark

    Hi !
    I've being trying to use a java class into xsl but without success.
    If anybody can help me to no how do I have to organize the files (.class, .xsl)????
    My organization is like this
    c:
    WEBAPP
    WEB-INF (here I have the .xml and .xsl)
    classes
    com
    example (here I have the .class)
    And I use it as follows:
    --------------------------------------xslextension_prueba.XSL------------------ ---------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="java"
    extension-element-prefixes="java"
    version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <html>
    <body bgcolor="#FFFFFF">
    <h2>The smoking calendar</h2>
    <h3>
    <xsl:value-of select="java:Date.new()"/>
    </h3>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    --------------------------------------------XML-------------------------------- ----
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="xslextension_prueba.xsl"?>
    <articles>
    <article>
    <title>Using Web Services</title>
    <author>T. Cowan</author>
    <date>11/30/01</date>
    <text>
    content of article.
    </text>
    </article>
    <article>
    <title>Java May Be Just a Fad</title>
    <author>J. Burke</author>
    <date>08/15/95</date>
    <text>
    content of article.
    </text>
    </article>
    </articles>
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!AND I GET THIS ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    E The URI java does not identify an external Java class
    THANKS FOR YOUR HELP......

  • XSQL/XSL help (iPlanet): Error processing XSLT stylesheet

    hello-
    i am running XSQL and XSL pages on an iPlanet web server and i am receiving the following error:
    XSQL-011: Error processing XSLT stylesheet: /xslt/page/xsl_page.xsl
    XSL-1002: Error while processing include XSL file (\xslt\util\other_xsl.xsl (The system cannot find the path specified)).
    here's the deal: other_xsl.xsl (the one it says it can't find) is there in the right place, but the web server is not looking from the document root (which IS set correctly on the web server). it is looking for the file starting at the current directory.
    for example, the server is processing /xslt/page/xsl_page.xsl. it is then looking for the include file using this path: /xslt/page/XSLT/UTIL/other_xsl.xsl --- instead of the correct /xslt/util/other_xsl.xsl.
    the include statement uses the full path starting from the web root (<xsl:include href="/xslt/util/other_xsl.xsl"/>)
    any help would be appreciated.

    thanks for the response. the /xslt/util directory is browsable by the web server, and using relative paths does work (that is one of the ways i discovered what was going on in the first place), but i am rebuilding a machine and redeploying an exisiting application-- the intention is to not re-write any code.
    the part that is most confusing is that the current code/directory structure works on the current box, but not on my rebuilt box. i have gone through every config file with a fine tooth comb. it appears that the current box and my build are set up exactly the same-- but, like i said, on one it reads the include-path from the document root, on the other from the current directory.
    so confusing.

  • Pass object to xslt stylesheet and invoke its methods

    I'd like to pass an external created object to a xslt stylesheet to dynamically modify the xslt file at run time. After searching around for weeks, I'm really desperate.
    I used Xalan transformer's method setParameter(name, obj) to initialize a variable in xslt file with this object. Then the object's method was invoked.
    The class that I want to invoke the method:
    class test{
    private String testString = "abc";
    public String valueOf(){
    return testString;
    xslt file:
    <xsl:param name="myType"></xsl:param>
    <<xsl:variable name="new-pop"
    select="my-class:valueOf($myType)">
    Any help is greatly appreciated.
    Thank you.
    Message was edited by:
    Orbital
    Message was edited by:
    Orbital

    Thank sabre. I have looked through your link.
    The problem is for all the info I knew, we can only
    create a new object inside the stylesheet using new()
    and then invoke this particular object's instance
    method.
    However, I want to pass an already created java
    object into the stylesheet and then invoke its
    method.
    Xalan seems to not allow this. I have tried to pass
    an object as the parameter of
    transformer.setParameter(name, object) but it doesn't
    work.
    Any one know what 3rd party transformer that allow to
    pass object directly into xslt?setParameter will work... in your XSL, you should have
    <xsl:param name="myParam" />set the parameter in your transformer like what you had in your post...
    In your XSL header, you must declare the your Java object namespace and path, such as:
    xml:myJavaObject= "com.MyCompany.MyJavaObject"then in your template or anywhere that you want to use your object, you should have:
    <xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam)" />The XSL will treat $myParam as the instance object, if there is any other method parameters needed to be passed in do:
    <xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam, 'blah', 'blah')" />Good luck.

  • OPM gives error when trying to use XSLT stylesheet

    Hi,
    I am trying use a simple XSLT stylesheet into an OPM project and see the result in the web determination screen.But when ever i am clicking on the link that is created when i compile the project with the XSL file, i am getting the error
    "An error occurred trying to process your request.
    This error has been logged and is available in the application logs.
    For support and assistance please contact [email protected]"
    I have kept the XSL file inside the "templates" folder in "include" folder.
    I am using a very simple one i.e
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0" >
    <xsl:output method="html"/>
    </xsl:stylesheet>
    How do I find what the error is and what do I need to do to solve this?
    Thanks and regards
    Sagnik

    Yes, now that above issue is solved and now when I click on the "HTML" or "PDF" link, I think some file is being generated but not properly.
    For HTML, I am getting blank page error and for PDF I am getting "file is damaged" error.May be, the xslt stylesheet that I am using is wrong, but I am absolutley stuck with this. I have tried many different formats of xlst stylesheets, but none seem to be working.
    pasting the two xslts below:
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<xsl:apply-templates/>*
    *</xsl:template>*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<xsl:template match="entity name">*
    *<entity-name align="center"><xsl:apply-templates/></entity-name>*
    *</xsl:template>*
    *<xsl:template match="instance label">*
    *<instance-label align="center"><xsl:apply-templates/></instance-label>*
    *</xsl:template>*
    *<xsl:template match="attribute id">*
    *<attribute-id><xsl:apply-templates/></attribute-id>*
    *</xsl:template>*
    *<xsl:template match="date-val">*
    *<date-val><xsl:apply-templates/></date-val>*
    *</xsl:template>*
    *<xsl:template match="text-val">*
    *<text-val><xsl:apply-templates/></text-val>*
    *</xsl:template>*
    *<xsl:template match="unknown-val">*
    *<unknown-val><xsl:apply-templates/></unknown-val>*
    *</html>*
    *</body>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    and
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">*
    *<xsl:output method="html"/>*
    *<xsl:template match="/">*
    *<html>*
    *<body>*
    *<xsl:template match="session">*
    *<session><xsl:apply-templates/></session>*
    *</xsl:template>*
    *<enityName>*
    *<xsl:for-each select="entity name">*
    *<instancelabel>*
    *<xsl:for-each select="instance label">*
    *<attribute-id>*
    *<xsl:for-each select="attribute id">*
    *<text-val>*
    *<xsl:value-of select="text-val"/>*
    *</text-val>*
    *<date-val>*
    *<xsl:value-of select="date-val"/>*
    *</date-val>*
    *</xsl:for-each>*
    *</attribute-id>*
    *</xsl:for-each>*
    *</instancelabel>*
    *</xsl:for-each>*
    *</enityName>*
    *</body>*
    *</html>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    also pasting the source xml file I am trying to convert.
    - <session xmlns="http://oracle.com/determinations/engine/relational/sessiondata/10.0" sessionDateTime="2010-12-17T11:34:08" locale="en-US" rulebase="Barclay_2910" rulebase-build="2010-12-17 06:04:02Z">
    - <entity name="global">
    - <instance label="global">
    - <attribute id="S_Other_Type_of_Business1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Desired_Review_Period">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_new_investors_ID_Vd">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_of_Capital_Invested">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_BTA_Code1">
    *<text-val>Central Government</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Total_Amount_Capital_Invested_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_State_Business_use_Trading_name">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_Organisation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Established1">
    *<date-val>2010-01-01</date-val>*
    *</attribute>*
    - <attribute id="S_Telephone_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation1">
    *<uncertain-val />*
    *</attribute>*
    - <attribute id="S_Date_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type_Non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments_non_corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b8@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b6@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_use_Trading_name1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_address_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Start_Up_Type">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Priority1">
    *<text-val>Standard</text-val>*
    *</attribute>*
    - <attribute id="S_Correspondence_address_same_Main_Trading">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Sort_Code">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Source_of_funds">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Choose_Start_Up1">
    *<text-val>Start Up/New Entity/Businesses</text-val>*
    *</attribute>*
    - <attribute id="S_Registered_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Fax_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Contributer">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_Account_number_Roll_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Previous_registered_names1">
    *<text-val />*
    *</attribute>*
    - <attribute id="b9@Rules_startuprule_doc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_CIS_Record1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Employees_Members1">
    *<text-val>1-9</text-val>*
    *</attribute>*
    - <attribute id="S_shareholders_Contributors">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="b7@Properties_PropBkACC_xsrc">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_select_the_high_risk_industry_operated">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_business_organisations_annual_turnover">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Postcode">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Nature_of_Business1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation1">
    *<text-val>1</text-val>*
    *</attribute>*
    - <attribute id="N_issued_share_capital_company">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Correspondence_Country">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Type_of_Business1">
    *<text-val>Sole Trader</text-val>*
    *</attribute>*
    - <attribute id="S_Web_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number1">
    *<text-val />*
    *</attribute>*
    - <attribute id="S_Business_operate_high_risk_industry1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Additional_Source_Capital1">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="Source_of_funds_non_Corporate">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Country_of_Incorporation">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_if_registered_address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Date_Established">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registration_Number">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_ID_VD">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_confirm_form_287">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Investments">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_I_Confirm1">
    *<text-val>Yes</text-val>*
    *</attribute>*
    - <attribute id="S_Date_Form_Lodged">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Registered_Address">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="S_Other_Type_of_Business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_start_up_capital_business">
    *<unknown-val />*
    *</attribute>*
    - <attribute id="N_Approx_transferring_balance">
    *<unknown-val />*
    *</attribute>*
    *</instance>*
    *</entity>*
    *</session>*
    Edited by: Sagnik on Dec 21, 2010 12:06 AM

  • How can I have users change textures in acrobat 3d and Reader question tia sal2

    I'm trying to have users in Acrobat reader change textures of a box which I made in acrobat 3d
    how can I do this?
    Example
    I made three textures for a box and I would like the user to have the ability to change the textures if they choose. How can I do this? Any examples?
    Can I have a user select the textures or the layers from a photoshop file in Acrobat 3d?
    Tia sal2

    Yo ratboy,
    You can do this. In order to map the images, they must be attached as a 3D resource. (There is a free plugin for this; search the forum for "Attach3DResource.api"). Once the images are attached, you can use the 3D Javascript API to map them to the meshes you desire.
    For one doc, I attached 25 images in this manner. I then used the script below to create a bunch of empty meshes, and then apply the images to said meshes.
    Hope this helps!
    //3D javascript ========================================
    //create 25 procedural meshes ======
    var leftEdge = -180;
    var horizontalOffset = leftEdge;
    var verticalOffset = 0;
    var myMesh = new Array();
    var myVector = new Array();
    for ( i=0; i<25; i++ ) { myMesh[i] = scene.createSquareMesh(64, 48, "myMesh" + i); myVector[i] = new Vector3( horizontalOffset, verticalOffset, 0 ); myMesh[i].transform.translateInPlace(myVector[i]); horizontalOffset += 74; if ( horizontalOffset > 180 )
    horizontalOffset = leftEdge;
    verticalOffset += 58;
    //create image array and resource objs ============
    var myImageResources = new Array();
    var myImageFiles = new Array("8d91.jpg",
    "ad2e.jpg",
    "barnpond.jpg",
    "Beach01.jpg",
    "Beach04.jpg",
    "Beach05.jpg",
    "Beach06.jpg",
    "Beach13.jpg",
    "bike trailer.jpg",
    "cobra.jpg",
    "cr80xr200.jpg",
    "craigs_place.jpg",
    "Dandrea.jpg",
    "dirtbike.jpg",
    "e027.jpg",
    "f5b5.jpg",
    "f613.jpg",
    "halfdome.jpg",
    "Iceberg.jpg",
    "island.jpg",
    "kx100_gb.jpg",
    "maui_horanhero.jpg",
    "norcal_ocean.jpg",
    "sierraLake.jpg",
    "Smokey Light.jpg",
    "test.txt");
    //create resource objs
    for ( i=0; i<25; i++ ) { myImageResources[i] = new Resource("pdf://" + myImageFiles[i]); }
    //load images on meshes with handler ============
    var myImageObjs = new Array();
    var myImageMats = new Array();
    myRenderer = new RenderEventHandler();
    myRenderer.onEvent = function(renderEvent)
    for ( i=0; i<25; i++ ) { //create image from resource myImageObjs[i] = new Image(myImageResources[i]); console.println("Image = " + i);
    //add image to model
    myImageMats[i] = myMesh[i].material;
    myImageMats[i].diffuseTexture.setImage(myImageObjs[i]);
    //remove handler
    runtime.removeEventHandler(myRenderer);
    runtime.addEventHandler(myRenderer);
    //cause a recalculation of the scenegraph.
    scene.update();
    console.println("Call scene.update()");
    console.println("Created 25 Square meshes: (64, 48, 'myMeshN')");

  • How can I get JavaScript for Windows 7 in order to connect to certain links?

    I have JavaScript 1.6.0_27 and a website is sending me information which I cannot get because their website only supports up to JavaScript 1.6.0_26. How can I install JavaScript 1.6.0_26 on my computer?

    Please continue at --> https://support.mozilla.com/en-US/questions/891126
    Moderator: Duplicate; please LOCK this thread - https://support.mozilla.com/en-US/questions/891123

Maybe you are looking for

  • Sharepoint 2013 WIKI change new page content

    After surfing throught a lot of tutorials talking about how to create content templates, Master Templates and everything else in Older versions of Sharepoint, I can't modify the default content on a new Entreprise Wiki page. All I want is when someon

  • While creating RFx getting error

    hi we are using SRM 7 SP13 classic scenario.while creating RFx getting error. Line 0001: Item type 'Service' not allowed for this Item. i created SC with free text and selected type -service .when purchaser is trying to create RFx getting error like

  • CHARACTER TO DECIMAL Conversion

    hi all , i get data from a flat file for one column i am getting 65900 650 754399 for eg : 65900 i should insert into table as 659.00 for : 754399 i should insert into table as 7543.99 The last two digits should be separated i cant change the datatyp

  • How to access front camera

    Am devaloping a small applicatioin using JME.. I have to retrive image from front camera for that.. S there any API to access front cam in a Midlet application.. Anyone who knows ploease explain in detail.. Thanks in advance..

  • Modificaiton of standard sap transaction screen

    Hi All, I have a requirement to modify standard sap screen for transaction PR05 in travel module. I need to add a few fields to the screen and hide a current field. Can you guide me the best way to do it. I think of the following ways:- 1. Change the