OutOfMemoryError when applying an xsl transformation

          Hello,I have an OutOfMemoryError when applying an xsl transformation to generate
          htmlcode in a web page. I'm running Weblogic 6.1 sp2I think the problem comes
          from the objectin which th html is stored during thetransformation. The problem
          only occurs from a minimal xml size. I could fixit by increasing JVM allocated
          size but I would like to find a more flexible solution. If I know an other way
          to solve this problem, I really would appreciate !
          Thank you,
          Laurent.
          [AgentsGeres.jsp]
          

Hello,
You might try asking your question in the JSP newsgroup:
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.developer.interest.jsp
There just may not be a more flexible solution :-)
This doc may be of some value, see chapter 2:
http://edocs.bea.com/wls/docs61/pdf/perform.pdf
HTH,
Bruce
Laurent Gosuin wrote:
>
Hello,
I have an OutOfMemoryError when applying an xsl transformation to generate html
code in a web page. I'm running Weblogic 6.1 sp2
I think the problem comes from the objectin which th html is stored during the
transformation. The problem only occurs from a minimal xml size. I could fix
it by increasing JVM allocated size but I would like to find a more flexible solution.
If I know an other way to solve this problem, I really would appreciate !
Thanl you,
Laurent.
Name: AgentsGeres.jsp
AgentsGeres.jsp Type: Hypertext Markup Language (text/html)
Encoding: base64

Similar Messages

  • Error when applying a XSLT transformation: No valid XSLT pro

    Dear All,
    I am getting following error when opening the "General Supplier Data" from Pre-Select Supplier.
    Error Message: "Error message: Error when applying a XSLT transformation: No valid XSLT program supplied"
    I have already read the related threads on SDN and checked the SAP Note 883896 and others. Even tried running the program UXS_DEL_NAVIGATION_NODE and UXS_ADD_MISSING_XSLT_NAME. But not able to solve the issue.
    Kindly Help.
    Regards,
    Sagar

    Hi Masa,
    Thanks for reply. I have checked this note. As note suggests, S_DEVELOP auth object is assigned to the user. and it has value *.
    Do I need to check anything else?
    Regards,
    Sagar

  • Error when applying a XSLT transformation

    central instance
    transaction SURVEY
    Extras->Target Group Hierarchy-> Import from file
    select file
    Error when applying a XSLT transformation
    dialog instance working

    Hello Andrey Kuryanov,
    Could make sure you describe the problem more clear as much as you can so that community can help you better.
    Please provide more details with more detailed steps and actual error messge.
    Thanks
    Raja Pamireddy
    Moderator

  • How to solve 'java/lang/OutOfMemoryError' when apply weblogic patch 10.3.6.0.10?

    Hi All:  Our platform is IBM AIX power system 64 bit, os level 6.  Oracle Fusion Middleware version is 10.3.6.0.8.  We tried to patch 10.3.6.0.10 on it, but encounter ‘out of memory error’ when  applied WebLogic patch 10.3.6.0.10 on UAT report server.  Currently UAT has 3GB memory (currently is 3G) .
    JVMDUMP006I Processing dump event "systhrow",
    detail "java/lang/OutOfMemoryError
    JVMDUMP032I JVM requested Heap dump using
    '/ora_bin01/u01/oracle/Middleware/utilhd' in response to an event
    JVMDUMP010I Heap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152727.6422620.0001.phd
    JVMDUMP032I JVM requested Java dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152727.6422620.0002.txt'
    in response to an event
    JVMDUMP010I Java dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152727.6422620.0002.txt
    JVMDUMP032I JVM requested Snap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152727.6422620.0003.trc'
    in response to an event
    JVMDUMP006I Processing dump event "systhrow",
    detail "java/lang/OutOfMemoryError" - please wait.
    JVMDUMP010I Snap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152727.6422620.0003.trc
    JVMDUMP013I Processed dump event "systhrow",
    detail "java/lang/OutOfMemoryError".
    JVMDUMP032I JVM requested Heap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152735.6422620.0004.phd'
    in response to an event
    JVMDUMP010I Heap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/heapdump.20150224.152735.6422620.0004.phd
    JVMDUMP032I JVM requested Java dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152735.6422620.0005.txt'
    in response to an event
    JVMDUMP010I Java dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/javacore.20150224.152735.6422620.0005.txt
    JVMDUMP032I JVM requested Snap dump using
    '/ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152735.6422620.0006.trc'
    in response to an event
    Exception in thread "main"
    java.lang.OutOfMemoryError at
    java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)
    at
    java.lang.StringBuffer.append(StringBuffer.java:201)
    at
    java.lang.Class.throwNoSuchMethodException(Class.java:278)
    at
    java.lang.Class.getMethod(Class.java:845)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.isValueSet(XBeanDataHandler.java:958)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.getValueFromObject(XBeanDataHandler.java:589)
    at
    com.bea.cie.common.dao.xbean.XBeanDataHandler.getSimpleValue(XBeanDataHandler.java:431)
    at
    com.bea.plateng.patch.dao.cat.PatchDependency.getRule(PatchDependency.java:48)
    at
    com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getInvalidatedPatchMap(PatchCatalogHelper.java:1625)
    at com.bea.plateng.patch.PatchSystem.updatePatchCatalog(PatchSystem.java:436)
    at
    com.bea.plateng.patch.PatchSystem.refresh(PatchSystem.java:130)
    at
    com.bea.plateng.patch.PatchSystem.setCacheDir(PatchSystem.java:201)
    at
    com.bea.plateng.patch.Patch.main(Patch.java:281)
    JVMDUMP010I Snap dump written to
    /ora_bin01/u01/oracle/Middleware/utils/bsu/Snap.20150224.152735.6422620.0006.trc
    JVMDUMP013I Processed dump event "systhrow",
    detail "java/lang/OutOfMemoryError".
    Exception in thread "Attach API wait loop"
    java.lang.OutOfMemoryError
       at
    com.ibm.tools.attach.javaSE.CommonDirectory.waitSemaphore(CommonDirectory.java:222)
    at
    com.ibm.tools.attach.javaSE.AttachHandler$WaitLoop.waitForNotification(AttachHandler.java:329)
    at com.ibm.tools.attach.javaSE.AttachHandler$WaitLoop.run(AttachHandler.java:396)
    bsu.sh -install -patch_download_dir=/ora_bin01/u01/oracle/Middleware/utils/bsu/cache_dir -patchlist=12UV -prod_dir=/ora_bin01/u01/oracle/Middleware/wlserver_10.3
    we followed the README.txt instructions, and stop/start weblogic service before/after apply patch. Can anyone suggest a solution or Doc ID for helping us?
    thank you very much!

    Solutions: Bounce the applications and check the arguments if you can increase it.  It is due to memory issue
    You can set these values in CommEnv.sh (.cmd for windows) file located in the weblogic_home/common/bin directory.
    This gets applied to all the domains under that wls home.
    If you want to make the changes to specific domain then edit the SetDomainEnv.sh file located under the domain/bin directory.
    How to solve java.lang.OutOfMemoryError: Java heap space
    solutions:  export JVM_ARGS="-Xms1024m -Xmx1024m"
    How to solve java.lang.OutOfMemoryError: PermGen space
    solution : export JVM_ARGS="-XX:PermSize=64M -XX:MaxPermSize=256m"

  • XSL transform sort problem in 1.5

    I am having problems applying an XSL transform to some XML data I have under the 1.5 JRE.
    Under 1.4.2 (and in several tools and browsers), the transform works correctly. In 1.5,
    <xsl:sort...> directives don't seem work correctly. Here's a simplified version of my
    code. Assume that the generateXMLReport outputs an XML document to a stream.
    public void generateHTMLReport( OutputStream out, String strXslSheet ){
         File f = new File( strXslSheet );
         if( f.exists() ){
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              // Generate the XML data we will work from
              generateXMLReport( bos );
              bos.flush();
              // Convert the XML to HTML by applying an XSL transform
              ByteArrayInputStream bis = new ByteArrayInputStream( bos.toByteArray() );
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer( new StreamSource( strXslSheet ) );
              transformer.transform( new StreamSource( bis), new StreamResult( out ) );
    }Here's an XSL template:
    <xsl:template name="totalTable">
         <xsl:param name="matchSet"/>
         <xsl:variable name="maxValue">
         <xsl:for-each select="$matchSet">
         <xsl:sort select="total" data-type="number" order="descending"/>
         <xsl:if test="position() = 1">
              <xsl:value-of select="number( total )" />
             </xsl:if>
             </xsl:for-each>
             </xsl:variable>
    </xsl:template>If I remove the sort directive, I get the first value in the list, as I would expect.
    Other 'for-each' loops behave similarly. The problem in 1.5. When I run against 1.4.2,
    the transformation works fine.

    Show us the code please. Not the WHOLE code, just an example that demonstrates what you're seeing. I've never seen the problem you're encountering, but I rather doubt that it's a failing in the api. More than likely it's a semantic of how you're doing the listener but that's a guess on my part. Let's see what you have and go from there.
    PS.

  • XSL transformation exception when using it in a subprocess

    Hi all
    I want to use a service task in sub-process that call a function with ref_cursor return type, when i map data association from output parameters to data object with xsl transformation an exception raise.
    in other hand my sub-process properties are : multiInstance, parallel , collection ,loop data input use an array , which create instances according to items of given array like http://www.avioconsulting.com/blog/simultaneous-creation-instances-array-oracle-bpm-11g
    by the way this feature works on service task that placed out of sub-process correctly.
    2.

    Hi Fazel,
    XSLT mapping is not working in the unpatched version of Oracle BPM 12c currently available.
    This work around is not great or even close to it, but the only way I've heard of anyone getting it to work is to right mouse click each of the individual children nodes.
    Know this bug has been reported by many people and has had a significant impact to all of us so it might be worth contacting Support to see if there might be a patch.
    Dan

  • How do we stop the XSL transform creating an empty tag when there is no inp

    Here is a way to stop the XSL transform from creating an empty tag when there is no input.
    1. Open the XSL Map in Jdev
    2. Go to the Design Tab
    3. Right click the tag in the target tree and select "Add XSL node -> xsl:if"
    4. Create a new link from the source tag (the same that is linked to the target tag) to the newly created xsl:if

    For anyone coming in to find this, I located my answer here:
    [Special Applet Attributes|http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/special_attributes.html#codebase]
    Thanks for reading.
    Sorry for the interruption.

  • Unused xml tags being printed in xsl transformation

    Hi,
    I'm just starting out with xslt, and I am have a small problem with unused data being added into the html output from an xsl transformation. The data set is very small and the transdorm is not complicated, but when I do a
    <xsl:template match="aa/bb/cc">
    <title><xsl:value-of select"."/></title>
    </xsl:template>
    cc will be used as the title, but aa/bb/dd and aa/bb/ee will be printed to the output stream directly after the </title> as standard text.
    <title>cc</title>ddee
    I have include the xml, the transform and the html source recieved at the end of this mail.
    Any help would be appreciated.
    Cheers
    Simon
    <webpage>
      <project>
        <title>Katrin</title>
        <version>Version 1.0</version>
        <start_date>01/01/2003</start_date>
      </project>
    </webpage>
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <xsl:output method="html"/>
        <!-- template rule matching source root element -->
        <xsl:template match="/">
            <html>
                <head>
                    <xsl:apply-templates mode="head"/>
                </head>
                <!-- Construct main body of page -->
                <body>
                    <xsl:apply-templates/>
                </body>
            </html>
        </xsl:template>
        <!-- Head -->
        <xsl:template match="webpage/project/title" mode="head">
            <title><xsl:value-of select="."/></title>
        </xsl:template>
        <!-- Body -->
        <xsl:template match="webpage/project/title">
            <h1><xsl:value-of select="."/></h1>
        </xsl:template>
        <xsl:template match="webpage/project/version">
            <div align="right" style="font-size : 8pt; font-family : Times serif; padding-top : 4; padding-bottom : 4; color : red"><xsl:value-of select="."/></div>
        </xsl:template>
        <xsl:template match="webpage/project/start_date">
            <div align="left" style="font-size : 8pt; font-family : Times serif; padding-top : 4; padding-bottom : 4; color : blue"><xsl:value-of select="."/></div>
        </xsl:template>
    </xsl:stylesheet>
    <html xmlns:fo="http://www.w3.org/1999/XSL/Format">
       <head>
          <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
          <title>Katrin</title>Version 0.101/01/2003</head>
       <body>
          <h1>Katrin</h1>
          <div align="right" style="font-size : 8pt; font-family : Times serif; padding-top : 4; padding-bottom : 4; color : red">Version 0.1</div>
          <div align="left" style="font-size : 8pt; font-family : Times serif; padding-top : 4; padding-bottom : 4; color : blue">01/01/2003</div>
       </body>
    </html>

    You had a couple of errors in your xsl. It should read something like:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
    <xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
    <xsl:template match="*|/">
    <html>
    <head><title>Greeting</title></head>
    <body>Words of greeting:
    <b><i><u><xsl:value-of select="greeting"/></u></i></b>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    This produces the result you are looking for:
    <html>
    <head>
    <title>Greeting</title>
    </head>
    <body>Words of greeting:
    <br>
    <b>
    <i>
    <u>Hello World.</u>
    </i>
    </b>
    </body>
    </html>
    null

  • Javax.xml.transform.TransformerException durin XSL Transformation in Java

    Hi,
    Below is my piece of code where i access a web service that returns a xml as a string. I apply a xsl tranformation on it and try to store the result as a string. I get this error message
    javax.xml.transform.TransformerException: Result object passed to ''{0}'' is invalid.
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(Unknown Source)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
         at NewService.main(NewService.java:52)My Code:
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.rmi.RemoteException;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ServiceException;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    public class NewService {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String endPoint = "http://localhost:8080/SampleDynamicWebProj/services/SampleClient";
              Service service = new Service();
              Call callOne;
              try {
                   callOne = (Call) service.createCall();
                   callOne.setTargetEndpointAddress(new URL(endPoint));
                   callOne.setOperationName(new QName("http://DefaultNamespace",
                             "getXMLString"));
                   String concated = (String) callOne.invoke(new Object[] { "s" });
                   InputStream xsltFile = new FileInputStream("xslpackage/empTran.xsl");
                   Source xmlSource = new StreamSource(new StringReader(concated));
                 Source xsltSource = new StreamSource(xsltFile);
                 TransformerFactory transFact =
                    TransformerFactory.newInstance();
                 Transformer trans = transFact.newTransformer(xsltSource);
                 Result result = new StreamResult();
                 trans.transform(xmlSource, result);
                 System.out.println(result.toString());
              } catch (ServiceException e) {
                   e.printStackTrace();
              } catch (MalformedURLException e) {
                   e.printStackTrace();
              } catch (RemoteException e) {
                   e.printStackTrace();
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } catch (TransformerConfigurationException e) {
                   e.printStackTrace();
              } catch (TransformerException e) {
                   e.printStackTrace();
    }I get the transformed XML into a Result object, but when i do a toString() oon it, i get the above exception.
    any help wil be appreciated,
    Dilip

    Oh well, yes it was a typo in address tag...ok agreed that its a bad example, check this out then,
    i have a XML data that i convert to a html format using xsl transformation, now this converted html has to be shown in a html page(i use the out.write option).
    so my initial xml looks like this ::
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Results>
        <ColumnCount>6</ColumnCount>
        <Columns>
            <column>UID</column>
            <column>UserName</column>
            <column>Password</column>
            <column>LastName</column>
            <column>FirstName</column>
            <column>EmailAddress</column>
        </Columns>
        <Rows>
            <Row>
                <value>1</value>
                <value>userone</value>
                <value>password-1</value>
                <value>Anant</value>
                <value>Dilip</value>
                <value>[email protected]</value>
            </Row>
            <Row>
                <value>2</value>
                <value>usertwo</value>
                <value>password-2</value>
                <value>Palli</value>
                <value>Gilli</value>
                <value>[email protected]</value>
            </Row>
        </Rows>I apply XSL transformation on this to get a HTML which i will be writing into my output screen hoping that the user will see it in a tabular format!
    <[!CDATA["
    <?xml version="1.0" encoding="UTF-8"?>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">UID</th>
    <th align="left">UserName</th>
    <th align="left">Password</th>
    <th align="left">LastName</th>
    <th align="left">FirstName</th>
    <th align="left">EmailAddress</th>
    </tr>
    <tr>
    <td>1</td>
    <td>userone</td>
    <td>password-1</td>
    <td>Anant</td>
    <td>Dilip</td>
    <td>[email protected]</td>
    </tr>
    <tr>
    <td>2</td>
    <td>usertwo</td>
    <td>password-2</td>
    <td>Palli</td>
    <td>Gilli</td>
    <td>[email protected]</td>
    </tr>
    </table>
    "]]>The entire data is passed to a XML parser . I want the transformed xml data (which will be inside a <status></status> tag to be untouched by this parser. As you see i have put the transformed xml in a CDATA tag, but this aint helping me...
    need urgent help,
    Dilip

  • Problem signing XML when applying XPATH2 filer

    I have a problem when applying XPATH2 filter to a XML Signature, because it inserts the namespaces from the main XML node to all descendants. I'm doing this:
    1. XMLSignatureFactory fac = XMLSignatureFactory.getInstance(AppConstants.DOM);
    2. XPathType tipoFiltro = new XPathType("//mainNode", Filter.INTERSECT);
         3. ArrayList<XPathType> lista = new ArrayList<XPathType>();
         4. lista.add(tipoFiltro);
         5. XPathFilter2ParameterSpec listaXPath = new XPathFilter2ParameterSpec(lista);
         6. Transform filtro = fac.newTransform(Transform.XPATH2, listaXPath);
         7. Transform enveloped = fac.newTransform(Transform.ENVELOPED,(TransformParameterSpec) null);
         8. ArrayList<Transform> listaTransformadas = new ArrayList<Transform>();
         9. listaTransformadas.add(filtro); //If comented, no problem
         10. listaTransformadas.add(enveloped);
         11. ref = fac.newReference("", fac.newDigestMethod(DigestMethod.SHA1, null), listaTransformadas,null,null);     
         12. SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE,(C14NMethodParameterSpec) null), fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null), Collections.singletonList(ref));
         ... more code (KeyInfo,...)
         13. DOMSignContext dsc = new DOMSignContext(keyEntry.getPrivateKey(), doc.getDocumentElement());
         14. XMLSignature signature = fac.newXMLSignature(si, ki);
         15. signature.sign(dsc);
         If I do the same without XPATH2 filter (Line 9 commented), it doesn't insert the namespaces in any node (they're only in the main node). The objetive of applying this xpath2 filter is to exclude XSLT reference (<?xml-stylesheet type="text/xsl" href=".\xsl\myTemplate.xsl"?>) from the signature.
         How can I avoid this situation? Is there another method for signing XML documents that allows this? Is there another way to exclude XLST reference that doesn't insert namespaces in all nodes?

    I have a problem when applying XPATH2 filter to a XML Signature, because it inserts the namespaces from the main XML node to all descendants. I'm doing this:
    1. XMLSignatureFactory fac = XMLSignatureFactory.getInstance(AppConstants.DOM);
    2. XPathType tipoFiltro = new XPathType("//mainNode", Filter.INTERSECT);
         3. ArrayList<XPathType> lista = new ArrayList<XPathType>();
         4. lista.add(tipoFiltro);
         5. XPathFilter2ParameterSpec listaXPath = new XPathFilter2ParameterSpec(lista);
         6. Transform filtro = fac.newTransform(Transform.XPATH2, listaXPath);
         7. Transform enveloped = fac.newTransform(Transform.ENVELOPED,(TransformParameterSpec) null);
         8. ArrayList<Transform> listaTransformadas = new ArrayList<Transform>();
         9. listaTransformadas.add(filtro); //If comented, no problem
         10. listaTransformadas.add(enveloped);
         11. ref = fac.newReference("", fac.newDigestMethod(DigestMethod.SHA1, null), listaTransformadas,null,null);     
         12. SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE,(C14NMethodParameterSpec) null), fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null), Collections.singletonList(ref));
         ... more code (KeyInfo,...)
         13. DOMSignContext dsc = new DOMSignContext(keyEntry.getPrivateKey(), doc.getDocumentElement());
         14. XMLSignature signature = fac.newXMLSignature(si, ki);
         15. signature.sign(dsc);
         If I do the same without XPATH2 filter (Line 9 commented), it doesn't insert the namespaces in any node (they're only in the main node). The objetive of applying this xpath2 filter is to exclude XSLT reference (<?xml-stylesheet type="text/xsl" href=".\xsl\myTemplate.xsl"?>) from the signature.
         How can I avoid this situation? Is there another method for signing XML documents that allows this? Is there another way to exclude XLST reference that doesn't insert namespaces in all nodes?

  • Weird behaviour when applying XLST in PL/SQL

    I came across this strange behaviour when applying XSLT to an XML document. Below is a simplified version, based on some code that I found in OTN
    declare
    indoc VARCHAR2(2000);
    xsldoc VARCHAR2(2000);
    myParser dbms_xmlparser.Parser;
    indomdoc dbms_xmldom.domdocument;
    xsltdomdoc dbms_xmldom.domdocument;
    xsl dbms_xslprocessor.stylesheet;
    outdomdocf dbms_xmldom.domdocumentfragment;
    outnode dbms_xmldom.domnode;
    proc dbms_xslprocessor.processor;
    buf varchar2(2000);
    begin
    indoc := '<emp><empno> 1</empno> <fname> robert </fname> <lname>
    smith</lname> <sal>1000</sal> <job> engineer </job> </emp>';
    xsldoc :=
    '<?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output encoding="utf-8"/>
    <xsl:variable name="CR">
    <xsl:text>
    </xsl:text>
    </xsl:variable>
    <xsl:template match="/">
    <xsl:value-of select="$CR" />
    <xsl:value-of select="$CR" />
    </xsl:template>
    </xsl:stylesheet>';
    myParser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseBuffer(myParser, indoc);
    indomdoc := dbms_xmlparser.getDocument(myParser);
    dbms_xmlparser.parseBuffer(myParser, xsldoc);
    xsltdomdoc := dbms_xmlparser.getDocument(myParser);
    xsl := dbms_xslprocessor.newstylesheet(xsltdomdoc, '');
    proc := dbms_xslprocessor.newProcessor;
    --apply stylesheet to DOM document  
    outdomdocf := dbms_xslprocessor.processxsl(proc, xsl, indomdoc);
    outnode := dbms_xmldom.makenode(outdomdocf);
    -- PL/SQL DOM API for XMLType can be used here
    dbms_xmldom.writetobuffer(outnode, buf);
    dbms_output.put_line(buf);
    end;
    I would expect this to output two carriage returns and this is what I get with xsltproc on the Linux server. Instead, it outputs the entire source XML document without the tags, as shown below.
    1 robert
    smith1000 engineer 1 robert
    smith1000 engineer
    Now, if you change the definition of the CR variable to add some text, for example to
    <xsl:variable name="CR">
    <xsl:text>XX
    </xsl:text>
    It outputs:
    XX
    XX
    which is what I would expect.
    Does anyone have any idea what is going on here? Changing the variable definition to <xsl:variable name="CR" select="'&#xD;&#xA;'" /> fixes the problem by the way.

    I came across this strange behaviour when applying XSLT to an XML document. Below is a simplified version, based on some code that I found in OTN
    declare
    indoc VARCHAR2(2000);
    xsldoc VARCHAR2(2000);
    myParser dbms_xmlparser.Parser;
    indomdoc dbms_xmldom.domdocument;
    xsltdomdoc dbms_xmldom.domdocument;
    xsl dbms_xslprocessor.stylesheet;
    outdomdocf dbms_xmldom.domdocumentfragment;
    outnode dbms_xmldom.domnode;
    proc dbms_xslprocessor.processor;
    buf varchar2(2000);
    begin
    indoc := '<emp><empno> 1</empno> <fname> robert </fname> <lname>
    smith</lname> <sal>1000</sal> <job> engineer </job> </emp>';
    xsldoc :=
    '<?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output encoding="utf-8"/>
    <xsl:variable name="CR">
    <xsl:text>
    </xsl:text>
    </xsl:variable>
    <xsl:template match="/">
    <xsl:value-of select="$CR" />
    <xsl:value-of select="$CR" />
    </xsl:template>
    </xsl:stylesheet>';
    myParser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseBuffer(myParser, indoc);
    indomdoc := dbms_xmlparser.getDocument(myParser);
    dbms_xmlparser.parseBuffer(myParser, xsldoc);
    xsltdomdoc := dbms_xmlparser.getDocument(myParser);
    xsl := dbms_xslprocessor.newstylesheet(xsltdomdoc, '');
    proc := dbms_xslprocessor.newProcessor;
    --apply stylesheet to DOM document  
    outdomdocf := dbms_xslprocessor.processxsl(proc, xsl, indomdoc);
    outnode := dbms_xmldom.makenode(outdomdocf);
    -- PL/SQL DOM API for XMLType can be used here
    dbms_xmldom.writetobuffer(outnode, buf);
    dbms_output.put_line(buf);
    end;
    I would expect this to output two carriage returns and this is what I get with xsltproc on the Linux server. Instead, it outputs the entire source XML document without the tags, as shown below.
    1 robert
    smith1000 engineer 1 robert
    smith1000 engineer
    Now, if you change the definition of the CR variable to add some text, for example to
    <xsl:variable name="CR">
    <xsl:text>XX
    </xsl:text>
    It outputs:
    XX
    XX
    which is what I would expect.
    Does anyone have any idea what is going on here? Changing the variable definition to <xsl:variable name="CR" select="'&#xD;&#xA;'" /> fixes the problem by the way.

  • ' Displays after XSL Transform

    I am converting Oracle XMLDB XMLSchema registered XML documents in an XMLTYPE table into HTML by using the database XSLT engine. The characters for & and quote(') are stored in the document as &amp; and &apos;. Unfortunately, after the transformation to HTML these characters display in a browser window (IE6) as &amp; and &apos; instead of as '&' and single quote('). This appears to be due to the fact that HTML does not recognise &amp; or &apos; but will correctly render &#38; and &#39; as '&' and single quote('). I would like to record these characters in my XML documents in XML DB as &#38; and &#39; so they display correctly when rendered to the web. Oracle's XML parser always seems to swap these for &amp; and &apos; whenever I do an XML document update.
    Can anyone tell me if there is another approach to getting & and single quote to display properly after an XSLT transformation to HTML?
    For reference sake our XML documents are stored in Oracle XMLDB (v9.2.0.5 on Solaris) with encode="ISO-8859-1" and we are doing the transformation in the database with the following code:
    CREATE OR REPLACE FUNCTION get_cu_xml(
    p_unitset_id IN NUMBER,
    p_year IN NUMBER)
    RETURN VARCHAR2
    IS
    CURSOR get_xml_cur(
    p_unitset_id NUMBER,
    p_year NUMBER)
    IS
    SELECT extract(VALUE(p),'/UnitSetYear')
    FROM cu_unit_set_years_xml p
    WHERE extractValue(VALUE(p),'/UnitSetYear/UnitSetID') = p_unitset_id
    AND extractValue(VALUE(p),'/UnitSetYear/Year') = p_year;
    xml_doc xmltype;
    xsl_clob CLOB;
    xml_clob CLOB;
    myParser dbms_xmlparser.Parser;
    indomdoc dbms_xmldom.domdocument;
    xsltdomdoc dbms_xmldom.domdocument;
    xsl dbms_xslprocessor.stylesheet;
    outdomdocf dbms_xmldom.domdocumentfragment;
    outnode dbms_xmldom.domnode;
    proc dbms_xslprocessor.processor;
    buf CLOB;
    BEGIN
    OPEN get_xml_cur(
    p_unitset_id,
    p_year);
    FETCH get_xml_cur INTO xml_doc;
    IF (get_xml_cur%FOUND) THEN
    xml_clob := xml_doc.getClobVal();
    xsl_clob := UriFactory.getUri('/home/cu/xsl/UMDetail.xslt').getXML().getClobVal();
    myParser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseBuffer(myParser, xml_clob);
    indomdoc := dbms_xmlparser.getDocument(myParser);
    dbms_xmlparser.parseBuffer(myParser, xsl_clob);
    xsltdomdoc := dbms_xmlparser.getDocument(myParser);
    xsl := dbms_xslprocessor.newstylesheet(xsltdomdoc, '');
    proc := dbms_xslprocessor.newProcessor;
    --apply stylesheet to DOM document
    outdomdocf := dbms_xslprocessor.processxsl(proc, xsl, indomdoc);
    outnode := dbms_xmldom.makenode(outdomdocf);
    -- PL/SQL DOM API for XMLType can be used here
    dbms_xmldom.writetoclob(outnode, buf);
    RETURN (buf);
    ELSE
    CLOSE get_xml_cur;
    RETURN (NULL);
    END IF;
    end get_cu_xml;

    Jinyu this is almost as if I need a disable-output-escaping="no" attribute for <xsl:for-each> but that appears not to be supported. The main section concerned in the xsl are the lines:
    <xsl:for-each select="n1:Desc">
    <xsl:apply-templates/>
    </xsl:for-each>
    The content in the Desc tag was edited with an XML editor which replaces quote characters with &apos;
    The full text of my xsl file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:n1="http://www.utas.edu.au/cu" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <xsl:output version="1.0" encoding="utf-8" omit-xml-declaration="no" indent="no" media-type="text/html"/>
         <xsl:template match="/">
              <html>
                   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
                   <head/>
                   <body>
                        <xsl:for-each select="n1:UnitSetDetails">
                             <h1 align="center">
                                  <xsl:for-each select="n1:UnitSetLabel">
                                       <xsl:apply-templates/>
                                  </xsl:for-each>&#160;<xsl:for-each select="n1:UnitSetTitle">
                                       <xsl:apply-templates/>
                                  </xsl:for-each>
                             </h1>
                             <xsl:if test="n1:UnitMembers/n1:UnitMember[1]/n1:FPTime != n1:UnitMembers/n1:UnitMember[2]/n1:FPTime">
                                  <h2 align="center">
                                       <xsl:for-each select="n1:UnitMembers">
                                            <xsl:for-each select="n1:UnitMember">
                                                 <xsl:for-each select="n1:UnitCode">
                                                      <xsl:apply-templates/>
                                                 </xsl:for-each>(<xsl:for-each select="n1:FPTime">
                                                      <xsl:apply-templates/>
                                                 </xsl:for-each>)&#160; </xsl:for-each>&#160;</xsl:for-each>
                                  </h2>
                             </xsl:if>
                             <p>
                                  <xsl:if test="string-length( n1:SpecialNote ) &gt; 0">
                                       <span style="font-weight:bold; ">SPECIAL NOTE:</span>&#160;<xsl:for-each select="n1:SpecialNote">
                                            <xsl:apply-templates/>
                                       </xsl:for-each>
                                  </xsl:if>
                             </p>
                             <p>
                                  <span style="font-weight:bold; ">OFFERINGS</span>
                                  <table bgcolor="#F3F3F3" border="1" cellpadding="5" cellspacing="0" width="500">
                                       <tbody>
                                            <tr>
                                                 <td width="535">
                                                      <xsl:if test="n1:Offered = &apos;N&apos;">Not Offered</xsl:if>
                                                      <xsl:if test="n1:Offered = &apos;Y&apos;">
                                                           <xsl:for-each select="n1:UnitMembers">
                                                                <table border="0" cellspacing="1">
                                                                     <thead>
                                                                          <tr bgcolor="silver">
                                                                               <td width="35">Unit</td>
                                                                               <td align="left" width="55">Sem 1</td>
                                                                               <td align="left" width="55">Sem 2</td>
                                                                               <td align="left" width="55">Full Yr</td>
                                                                               <td align="left" width="55">Spring</td>
                                                                               <td align="left" width="55">Summer</td>
                                                                               <td align="left" width="55">Winter</td>
                                                                          </tr>
                                                                     </thead>
                                                                     <tbody>
                                                                          <xsl:for-each select="n1:UnitMember">
                                                                               <tr>
                                                                                    <td width="35">
                                                                                         <xsl:for-each select="n1:UnitCode">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:Sem1">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:Sem2">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:SemF">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:Sem5">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:Sem3">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                                    <td align="left" width="55">
                                                                                         <xsl:for-each select="n1:Sem4">
                                                                                              <xsl:apply-templates/>
                                                                                         </xsl:for-each>
                                                                                    </td>
                                                                               </tr>
                                                                          </xsl:for-each>
                                                                     </tbody>
                                                                </table>
                                                           </xsl:for-each>
    Offered in Courses: <xsl:for-each select="n1:OfferedInCourses">
                                                                <xsl:apply-templates select="n1:Course"/>
                                                           </xsl:for-each>
                                                      </xsl:if>
                                                 </td>
                                            </tr>
                                       </tbody>
                                  </table>
                             </p>
                             <p>
                                  <span style="font-weight:bold; ">DESCRIPTION</span>
                                  <xsl:for-each select="n1:Desc">
                                       <xsl:apply-templates/>
                                  </xsl:for-each>
                             </p>
                             <p>
                                  <span style="font-weight:bold; ">WEIGHT:</span>&#160;<xsl:for-each select="n1:UnitMembers">
                                       <xsl:for-each select="n1:UnitMember">
                                            <xsl:for-each select="n1:UnitCode">
                                                 <xsl:apply-templates/>
                                            </xsl:for-each>&#160;<xsl:for-each select="n1:DefaultWeight">(<xsl:apply-templates/>%)</xsl:for-each>&#160;&#160;&#160;&#160; </xsl:for-each>
                                  </xsl:for-each>
                             </p>
                             <xsl:if test="string-length( n1:Assess ) &gt; 0">
                                  <p>
                                       <span style="font-weight:bold; ">ASSESSMENT: </span>
                                       <xsl:for-each select="n1:Assess">
                                            <xsl:apply-templates/>
                                       </xsl:for-each>
                                  </p>
                             </xsl:if>
                             <xsl:if test="string-length( n1:TeachPattern ) &gt; 0">
                                  <p>
                                       <span style="font-weight:bold; ">TEACHING PATTERN: </span>
                                       <xsl:for-each select="n1:TeachPattern">
                                            <xsl:apply-templates/>
                                       </xsl:for-each>
                                  </p>
                             </xsl:if>
                             <xsl:if test="string-length( n1:UnitMembers/n1:UnitMember/n1:WebSup ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:WebDep ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:FullOn ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:ResSupTL ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:ResDepTL ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:VideoConf ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:FlexSched ) &gt; 0
    or string-length( n1:UnitMembers/n1:UnitMember/n1:WPLearn ) &gt; 0">
                                  <p>
                                       <span style="font-weight:bold; ">FLEXIBLE &amp; ONLINE STUDY OPTIONS</span>
                                       <span style="font-weight:bold; ">Note:</span> Class attendance may still be required
                                       <xsl:for-each select="n1:UnitMembers">
                                            <xsl:for-each select="n1:UnitMember">
                                                 <xsl:for-each select="n1:UnitCode">
                                                      <xsl:apply-templates/>
                                                 </xsl:for-each>
                                                 <xsl:if test="string-length( n1:WebSup ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Web supported - <xsl:for-each select="n1:WebSup">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    Online access to some part of this unit online is optional
    </xsl:if>
                                                 <xsl:if test="string-length( n1:WebDep ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Web dependent - <xsl:for-each select="n1:WebDep">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    Some parts of this unit will be taught online
    </xsl:if>
                                                 <xsl:if test="string-length( n1:FullOn ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Fully online - <xsl:for-each select="n1:FullOn">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    This unit is taught entirely online
    </xsl:if>
                                                 <xsl:if test="string-length( n1:ResSupTL ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Resource supported teaching &amp; learning - <xsl:for-each select="n1:ResSupTL">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    Additional resources are provided for your optional use; e.g. video taped lectures
    </xsl:if>
                                                 <xsl:if test="string-length( n1:ResDepTL ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Resource dependent teaching &amp; learning - <xsl:for-each select="n1:ResDepTL">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    Independent study with provided resources replaces face-to-face or other classes (e.g. lectures)
    </xsl:if>
                                                 <xsl:if test="string-length( n1:VideoConf ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Video conferencing - <xsl:for-each select="n1:VideoConf">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    A live video link between campuses is used for at least some teaching in this unit
    </xsl:if>
                                                 <xsl:if test="string-length( n1:FlexSched ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Flexible scheduling - <xsl:for-each select="n1:FlexSched">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    You can attend some classes out of normal teaching hours; e.g. weekend blocks, summer schools etc
    </xsl:if>
                                                 <xsl:if test="string-length( n1:WPLearning ) &gt; 0">
    &#160; <img border="0">
                                                           <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://www.utas.edu.au/courses/images/dotarrowB.gif</xsl:text></xsl:attribute>
                                                      </img>&#160;Workplace learning - <xsl:for-each select="n1:WPLearn">
                                                           <xsl:apply-templates/>
                                                      </xsl:for-each>
    This unit involves study in the workplace
    </xsl:if>
                                            </xsl:for-each>
                                       </xsl:for-each>
                                       About Flexible Study Options
                                  </p>
                             </xsl:if>
                             <xsl:if test="count( /n1:UnitSetDetails/n1:Requisites/n1:Requisite ) &gt; 0">
                                  <p>
                                       <xsl:for-each select="n1:Requisites">
                                            <span style="font-weight:bold; ">REQUISITE INFO</span>
                                            <table border="0" cellpadding="3" cellspacing="0">
                                                 <tbody>
                                                      <xsl:for-each select="n1:Requisite">
                                                           <tr>
                                                                <td>
                                                                     <xsl:for-each select="n1:ReqType">
                                                                          <xsl:choose>
                                                                               <xsl:when test=".='PREREQ'">
                                                                                    <xsl:text>Prereq</xsl:text>
                                                                               </xsl:when>
                                                                               <xsl:when test=".='COREQ'">
                                                                                    <xsl:text>Coreq</xsl:text>
                                                                               </xsl:when>
                                                                               <xsl:when test=".='MEXCL'">
                                                                                    <xsl:text>M.Excl</xsl:text>
                                                                               </xsl:when>
                                                                          </xsl:choose>
                                                                     </xsl:for-each>
                                                                </td>
                                                                <td>
                                                                     <xsl:for-each select="n1:ReqText">
                                                                          <xsl:apply-templates/>
                                                                     </xsl:for-each>
                                                                </td>
                                                           </tr>
                                                      </xsl:for-each>
                                                 </tbody>
                                            </table>
                                       </xsl:for-each>
                                  </p>
                             </xsl:if>
                             <xsl:if test="string-length( n1:RequiredTexts/n1:RequiredText ) &gt; 0 or string-length( n1:RecommendedTexts/n1:RecommendedText ) &gt; 0">
                                  <p>
                                       <span style="font-weight:bold; ">TEXTS</span>
                                       <xsl:if test="string-length( n1:RequiredTexts/n1:RequiredText ) &gt; 0">
                                            <xsl:for-each select="n1:RequiredTexts">
                                                 <span style="font-weight:bold; ">Required</span>
                                                 <xsl:for-each select="n1:RequiredText">
                                                      <xsl:apply-templates/>
                                                 </xsl:for-each>
                                            </xsl:for-each>
                                       </xsl:if>
                                       <xsl:if test="string-length( n1:RecommendedTexts/n1:RecommendedText ) &gt; 0">
                                            <xsl:for-each select="n1:RecommendedTexts">
                                                 <span style="font-weight:bold; ">Recommended Texts</span>
                                                 <xsl:for-each select="n1:RecommendedText">
                                                      <xsl:apply-templates/>
                                                 </xsl:for-each>
                                            </xsl:for-each>
                                       </xsl:if>
                                  </p>
                             </xsl:if>
                             <xsl:if test="string-length( n1:Staff ) &gt; 0">
                                  <p>
                                       <span style="font-weight:bold; ">STAFF: </span>
                                       <xsl:for-each select="n1:Staff">
                                            <xsl:apply-templates/>
                                       </xsl:for-each>
                                  </p>
                             </xsl:if>
                        </xsl:for-each>
                   </body>
              </html>
         </xsl:template>
         <xsl:template match="n1:Bold">
              <span style="font-weight:bold; ">
                   <xsl:apply-templates/>
              </span>
         </xsl:template>
         <xsl:template match="n1:BulletList">
              <ul style="margin-bottom:0; margin-top:0; " start="1" type="disc">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ul>
         </xsl:template>
         <xsl:template match="n1:BulletedList">
              <ul style="margin-bottom:0; margin-top:0; " start="1" type="disc">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ul>
         </xsl:template>
         <xsl:template match="n1:Course">
         [<a>
                   <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">/pls/portal/url/page/COURSE_UNIT/UTAS_COURSE_DETAIL?P_COURSE_CODE=</xsl:text><xsl:value-of select="."/></xsl:attribute>
                   <xsl:apply-templates/>
              </a>
              <xsl:text disable-output-escaping="yes">] </xsl:text>
         </xsl:template>
         <xsl:template match="n1:Italic">
              <span style="font-style:italic; ">
                   <xsl:apply-templates/>
              </span>
         </xsl:template>
         <xsl:template match="n1:ListBullet">
              <ul style="margin-bottom:0; margin-top:0; " start="1" type="disc">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ul>
         </xsl:template>
         <xsl:template match="n1:ListLetter">
              <ol style="margin-bottom:0; margin-top:0; " start="1" type="a">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ol>
         </xsl:template>
         <xsl:template match="n1:ListNumber">
              <ol style="margin-bottom:0; margin-top:0; " start="1" type="1">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ol>
         </xsl:template>
         <xsl:template match="n1:ListRoman">
              <ol style="margin-bottom:0; margin-top:0; " start="1" type="i">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ol>
         </xsl:template>
         <xsl:template match="n1:NumberedList">
              <ol style="margin-bottom:0; margin-top:0; " start="1" type="1">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ol>
         </xsl:template>
         <xsl:template match="n1:Unit">
              <xsl:if test="string-length(.) &gt; 0">
                   <a>
                        <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">/pls/portal/url/page/COURSE_UNIT/UTAS_UNIT_DETAIL?P_UNIT_CODE=</xsl:text><xsl:value-of select="."/></xsl:attribute>
                        <xsl:apply-templates/>
                   </a>
              </xsl:if>
         </xsl:template>
         <xsl:template match="n1:ol">
              <ol style="margin-bottom:0; margin-top:0; " start="1" type="1">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ol>
         </xsl:template>
         <xsl:template match="n1:para">
              <p style="padding-bottom:0; padding-top:0; ">
                   <xsl:apply-templates/>
              </p>
         </xsl:template>
         <xsl:template match="n1:table">
              <xsl:apply-templates/>
         </xsl:template>
         <xsl:template match="n1:ul">
              <ul style="margin-bottom:0; margin-top:0; " start="1" type="disc">
                   <xsl:for-each select="n1:li">
                        <li>
                             <xsl:apply-templates/>
                        </li>
                   </xsl:for-each>
              </ul>
         </xsl:template>
    </xsl:stylesheet>

  • Issue with XSL transformation in Java Stored Procedure

    Hi,
    Am having issue applying XSL transformation in Java Stored procedure. I have loaded the java class as well as .XSL files through loadjava uility and their status in DB is VALID.
    Below is the code in the java stored procedure:
    public static String tranform(String strInputXML ){
    URL url = ClassLoader.getSystemClassLoader().getResource(first.xsl);
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(new ByteArrayInputStream (strInputXML.getBytes("UTF-8")));
    TransformerFactory tFactory = TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(url.openStream());
    Transformer transformer = tFactory.newTransformer(stylesource);
    When I run this procedure, am getting following errors:
    {color:#ff0000}*ERROR: 'No such file or directory'*
    FATAL ERROR: 'Could not compile stylesheet'{color}
    My first.xsl file has reference to other excel file (Ex: &lt;xsl:include href="second.xsl"/&gt;) which seems to be causing this error. When I remove the reference, procedure is working fine.
    Pls let me know how to resolve this and read the .XSL file with references.
    Thanks,

    Hello,
    Thanks for the reply. Actually I have seen that post before creating this thread. I thought that I could make use of java mail to work around this problem. I created a java class that succesfully sends mail to SSL host. I tried to call this java class from pl-sql through java stored procedure. That did not work
    So, is this not supported in Oracle ? Please note that I have tested this in both 9i and 11g , in both the versions I got the error. You can refer to the code in the above post.
    Thanks
    Srikanth
    Edited by: user12050615 on Jan 16, 2012 12:17 AM

  • LrXML xsl transform cannot match document node on windows

    On windows the xsl library used has a bug which is preventing it from matching the document node (the parent of the root element of the document).
    I reduced this to a test case:
    xml data:
    <first>
      <second />
    </first>
    xsl stylesheet:
    <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method='text'/>
      <xsl:template match='/'>ROOT<xsl:apply-templates/></xsl:template>
      <xsl:template match='first'>FIRST<xsl:apply-templates/></xsl:template>
      <xsl:template match='second'>SECOND<xsl:apply-templates/></xsl:template>
    </xsl:stylesheet>
    The output should be ROOTFIRSTSECOND and this is the observed output if this stylesheet is processed by msxsl or xsltproc. The problem is, when this is processed by LrXML on windows the output is FIRSTSECOND.
    Granted I am not an xsl expert but to the best of my knowledge this looks like a bug. Any chance this can be fixed?
    Cheers.

    I used process explorer and found that in my case Lightroom uses msxml3.dll. I also ran msxml.exe -u 3.0 which selects the same dll for processing and verified that msxml.exe gives different results that Lightroom.
    Here's the code I am running. In Info.lua:
      LrExportMenuItems = {
          title = 'Test XSLT',
          file = 'TestXSLT.lua'
    and in TestXSLT.lua:
    local logger = import('LrLogger')()
    logger:enable('logfile')
    local LrXml = import('LrXml')
    local utils = require('utils')
    local xml_data = [[
    <?xml version='1.0' encoding='UTF-8'?>
    <first>
      <second />
    </first>
    local xslt_data = [[
    <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method='text'/>
      <xsl:template match='/'>ROOT<xsl:apply-templates/></xsl:template>
      <xsl:template match='first'>FIRST<xsl:apply-templates/></xsl:template>
      <xsl:template match='second'>SECOND<xsl:apply-templates/></xsl:template>
    </xsl:stylesheet>
    logger:debug('Parsing xml: ' .. xml_data)
    local xml = LrXml.parseXml(xml_data)
    logger:debug('Applying xslt: ' .. xslt_data)
    local res = xml:transform(xslt_data)
    logger:debug('Result: ' .. res)
    Can you please try and verify that it is broken for you as well?
    Thank you.
    Fixed code formatting. disht

  • Error: "... is not a table ..." XML not correctly interpreted after XSL-transformation. Table row quantity problem.

    Hey guys, this is one of my xml-elements:
    Jaspreet Sohi 12 18 Juliane Lenz 11 17 Sophie Charlotte Stender 10 15 Rosbeh Hamidzadeh Khayyat 12 17 Lion Stoldt 12 17 Mats Lucas Meincke 6 8 Bero Luke Vincent Ernst 6 8 Cedric Roth 6 8 Soner Cantay 6 8 The following XSL Transformation I use once for transforming all "m" tags and once in order to transform all "j" tags. Please imagine the CSL-code below to be duplicated exactly. Only the "jungs"-table-Tag is replaced by "mädchen" and all underscores _j are replace by _m. As well all "select="j[@..." parts are replaced by "select="m[@...". 1 2 3 The code is very easygoing I think and not difficult to understand. As I said, I use it twice - for both transformations. The very, extremely weird thing, my problem, is that one transformation works perfectly in InDesign and a table is created for all "kategorie"-tags (all is set within a for-each loop). But the second script does not work! I simply do not get this I can't understand it. I've tried more than anything. InDesign sais (in German, so translated based on assumption) "jungs is an invalid table element or is displayed in wrong order". The second strange thing is that I can replace my "aid:trows" attribute by any number, e.g. "10" and immediately the script works fine (as there are never more than 6 "j" tags in my XML so that never the table has more than 6 rows"). But it does not want to work correctly with the actual number, my variable "rows_j". These are my variables: They are all defined before the tables for m and j are created. So finally, why (the heck) is one table created and interpreted perfectly whereas the second - immediately following the first in the XSL.script as an EXACT copy of the first - results in an error? As i've already said, I've tried really everything. For example the script works also when one of the parts "" is randomly deleted from the script. Removing one of these parts directly makes the script working. Just one of my attempts to understand the thing but this has only shown that none of these parts "cell to end-for-each" includes an error. I'm really desperate and looking forward to being rescued by one of you geniuses :)

    Hah, No worries. The forum software is, well, different.
    What would be better, though, would be a sample ID file, any XSLT/XLT files you use, and a bit of data exactly as you have it (pre-transform state). ZIP it up, upload to say dropbox.com and feel free to send me a private message for the download link.
    Too many times there is something different between samples pasted into a post and the real thing that it is sometimes less useful time-wise. I'll keep it private, of course. Then we can communicate via PMs or email until we can (hopefully) arrive together at a solution, then post what that solution is in the forum to benefit others.
    Thank you, Mike

Maybe you are looking for

  • App Specific Passwords - What Are The Risks?

    Hi, I'm quite clear on what app specific passwords are, how they are generated and how to use them with my apps but I have a general query re their potential misuse before I actually go live. For instance if I want to use iOS Outlook on my iPhone I n

  • Help not locating printer profile

    2. Re: How to install Epson ICC profiles using Photoshop CC? Mark Goodwin LRPS Aug 28, 2014 4:14 PM I had a problem and needed to upload a HP Printer Profile.I down loaded it from the site then opened and placed in the Mac: Library/ColourSync/Profile

  • How to transfer Acrobat X Pro from dead PC to new PC

    How to transfer Acrobat X Pro from dead PC to new PC

  • Can't get my snaps to work (have tried obvious options)

    I have just done a fresh install of Indesign (CS5.5) and for some reason my snaps are not working. I have gone in and ensured that the correct options in View>Grids & Guides are checked and it is still not working. Is there anything else that could b

  • Please help! -  mail with xml attachment

    hallo, i have posted this problem 2 weeks ago but nobody could give an antwort :( i don't know what is wrong. i try to send a xml file as attachment. but i get this error : javax.activation.UnsupportedDataTypeException: no object DCH for MIME type mu