XSL transformation related point

Hi All,
Morning, need some assistance with this issue we are facing during XSL transformation,
During the XSL transformation we need to access mapping file lets say country-code.txt which has the details as mentioned below:
US=USA
UK=Great Britain
Now when the input data value comes as US we need to map the output tag in the xsl with the value USA at run time & if input is Uk then output tag value should be Great Britain
2.Also in another file say login-details.txt we have maintained the user-name & password like below:
user-name='Test'
password='welcome'
This also we need to get the values in the xsl transformation file within the BPEL process so that at Run Time these could be got from the file ( since if we hard code in the xsl file within the BPEL process whenever the instance login details changes everytime we would have to change in the process and re deploy again)
1.Now in Soa Suite 10g is there a way or method/steps wherein from the xslt mapping file within the BPEL process we could make a call or access these files. Also on the application server/unix directory where do we need to physically put these files at which directory location ..if this is possible.
2.Also could a similar scenario be achieved in SOA Suite 11g
Could someone please help us with this as we are currently stuck with this situation..
with regards as always..

Hi ,
Thanks for your response first...have mentioned the details below
***xsl mapping ****
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:get="http://www.oracle.com/XSL/Transform/java/customclass" version="1.0">
<FinalCountryCode>
<xsl:variable name="countryCode" select="INPUT_COUNTRY_CODE"/>
<xsl:value-of select="get:getCode($countryCode)"/>
</FinalCountryCode>
****class defintion mentioned below****
(this is a custom java class created where we could try accessing the file named country_code.txt and we would try calling the getCode function of this java class from the xsl mapping as above.)
import java.io.FileInputStream;
import java.util.*;
public class customclass
     public static String getCode(String p_str_CountryCode)
          Properties o_countryCode = new Properties();
          String v_countryCode = null;
          FileInputStream o_Code = new FileInputStream("country_code.txt");
          o_countryCode.load(o_Code);
          v_countryCode = o_countryCode.getProperty(p_str_CountryCode);
          return v_countryCode;
country_code.txt file would have details like this:
US=USA
UK=Great Britain
So during the SOA Run time if the value for INPUT_COUNTRY_CODE comes as US the final tag CountryCode3Gid should have the value as USA
1.Now where do we need to physically put the file name country_code.txt (having the country code mappings) on the application server in Soa 11g, so that it could be accessed during Run Time.
2.Also where do we put customclass so that it could be accessed during SOA Run Time
3.Also in Soa 10g & Soa 11g is there a better method or any other way/steps within Jdev and also during SOA run time that this functionality could be achieved (means call an external file which stores the mapping values which need to be referred during xsl mapping within BPEL process)
4.We are not sure whether this would be feasible method and how to make this work in 10g as well as 11g
thanks

Similar Messages

  • No validation of xsl transforms within process

    Hi there,
    I've posted this before with no avail.
    I have process which creates an XML schema from a file adpator.
    The input/output XML validation is turned on, on my BPEL server and is working well.
    I then transform this XML to another 'global schema' which is heavily validated with lots of <restricts>.
    More processing is done on this global schema, then finally it is converted over to a DB schema for output to a DB.
    As meationed above the schemas are validated on input and output (from file, to DB) fine. If i place a <restrict> on any values on these schemas the process fails.
    BUT, is the transformation the takes place within the process (from the file schema to the global schema) suppose to be validated?
    Using the XSLT mapping tool i am able to test the transformation and when i click validate quite rightly it fails. But when in the BPEL server this section does not fail, it just does the tranformation without validation.
    Is this just functionality?
    thanks,

    You want to tell whether the output of an XSL transformation will validate against a schema? I don't see what good looking at the XPath expressions in the XSLT would do -- it might not even have any, or they might be simple ones relative to the context node. And even if you did have any, I can't see how they are relevant to the output of the transformation. Which could be anything.
    And I don't see how you could find out anything about paths in the output document. I doubt you could even tell whether the output was well-formed XML let alone whether it conformed to a schema.
    So: I don't think there's an existing solution for that because (a) it isn't very simple and (b) it isn't a common requirement. Of course I could be wrong in my opinion that it isn't possible to do such a thing. But I don't think I'm wrong about it being extremely difficult.

  • 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

  • XSL Transformation breaks encoding declaration

    The first line in my XML:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    The first line in my XSL:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    Once I do the transformation, I end up with this in my XSL-FO
    file:
    <?xml version="1.0" encoding="ISO8859-1"?> where it
    should be ISO-8859-1.

    You need to watch out for the namespace in the source document:
    You can either specify the namespace and use it when locating paths in the source document (as below) or specify it as the default namespace.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0"
         xmlns:xalan="http://xml.apache.org/xslt"
         xmlns:n="http://sirius/xml/common">
    <xsl:template match="/">          
         <SiebelMessage IntObjectFormat="Siebel Hierarchical" IntObjectName="TBS2 OHS Reply" MessageType="Integration Object">
              <TBS2OHSReply>                    
                   <OrderEntry-Orders>                         
                        <BackOfficeErrorText><xsl:value-of select="n:OrderResponseComplex/n:RejectionReasonCode"/></BackOfficeErrorText>
                        <Status><xsl:value-of select="n:OrderResponseComplex/n:AcceptedIndicator"/></Status>
                   </OrderEntry-Orders>
              </TBS2OHSReply>
         </SiebelMessage>
    </xsl:template>
    </xsl:stylesheet>

  • XSL transformation with xsl:import generates exceptions

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

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

  • XSL Transformation between arrays

    Dear all
    I create to XSD for my variables:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ns="http://www.asre-andishe.com/Inspec/General"
    targetNamespace="http://www.asre-andishe.com/Inspec/General"
    elementFormDefault="qualified">
    <xsd:complexType name="AgentArrayType">
    <xsd:sequence>
    <xsd:element name="Agent" type="ns:AgentType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="AgentType">
    <xsd:sequence>
    <xsd:element name="user" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="Agent" type="ns:AgentType"></xsd:element>
    <xsd:element name="AgentsArray" type="ns:AgentArrayType"></xsd:element>
    </xsd:schema>
    and the other one:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ns="http://www.asre-andishe.com/Inspec/DetermineInspec/retrive/relam"
    targetNamespace="http://www.asre-andishe.com/Inspec/DetermineInspec/retrive/relam"
    elementFormDefault="qualified">
    <xsd:complexType name="RelamAgentType">
    <xsd:sequence>
    <xsd:element name="user" type="xsd:string" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="RelamAgents" type="ns:RelamAgentType"></xsd:element>
    </xsd:schema>
    I create two empty variable and then initialized the second variable
    <RelamAgents>
    <user>john</user>
    <user>david</user>
    <user>jack</user>
    </RelamAgents>
    after that i use a transformation XSL and the second variable has been filled without no problem.
    <AgentsArray>
    <ns0:Agent>
    <ns0:user>john</ns0:user>
    </ns0:Agent>
    <ns0:Agent>
    <ns0:user>david</ns0:user>
    </ns0:Agent>
    <ns0:Agent>
    <ns0:user>jack</ns0:user>
    </ns0:Agent>
    </AgentsArray>
    but when i fill the first variable by receiving the output parameter from a service call, the XSL transformation did not work at all and the second variable remains empty.
    I have checked the first variable and i am sure that it is not null and it has the same vale:
    <RelamAgents>
    <user>john</user>
    <user>david</user>
    <user>jack</user>
    </RelamAgents>
    Would anybody please help me with this problem?
    Thank you very much

    Hi,
    receiving the output parameter from a service call, the XSL transformation did not workNamespaces... Check the namespaces the service call is using and see if they match with the XSL is expecting...
    Cheers,
    Vlad

  • XSL Transformation error source

    I am using MII 12.0 and I am getting the following error in the log file:
    javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException: An attempt to write after the stream had been closed.
    The problem is that I am not using and XSL transforms that I know of. What BLS action might generate this error other than the obvious XSL Transformation Action?
    Thanks.
    ...Sparks

    I found this thread:
    [Re: IDOC error|Re: IDOC error]
    Is your system set up to receive any idocs?
    Edited by: Christian Libich on Feb 8, 2010 10:00 PM

  • XSL Transformation failure

    Here is a sample of my code:
    I initially have one (non-null & valid - checked that !) node (dataNode). I need to do a XSL transformation on this one using an xsl (non-null & valid String). I can do manually the transform using a program such as XMLSpy and everything's fine !!!
    If I pass the initial Node to transform as a String to the following function it works fine:
    * Return the transformation of an XML through an XSL
    public static String getTransformedXML(String xmlSourceString, String xslSourceString) {
    StreamSource xmlSource;
    StreamSource xslSource;
    StreamResult xmlDestination;
    StringWriter sw;
    try {
    xmlSource = new StreamSource(new StringReader(xmlSourceString));
    xslSource = new StreamSource(new StringReader(xslSourceString));
    xmlDestination = new StreamResult(sw = new StringWriter());
    Transformer thisTransformer = tFactory.newTransformer(xslSource);
    thisTransformer.transform(xmlSource, xmlDestination);
    System.out.println("xxxxx = " + sw.getBuffer());
    return sw.getBuffer().toString();
    } catch (TransformerConfigurationException e) {
    System.out.println("TRANSFORMATION CONFIGURATION ERROR:" + e.getMessage());
    return null;
    } catch (TransformerException e) {
    System.out.println("TRANSFORMATION ERROR:" + e.getMessage());
    return null;
    But I CANNOT get working this code (instead of giving a String, I give a Node):
    * Return the transformation of an XML through an XSL
    public static Node getTransformedXML(Node xmlSourceNode, String xslSourceString) {
    DOMSource xmlSource;
    StreamSource xslSource;
    DOMResult xmlDestination;
    try {
    xmlSource = new DOMSource(xmlSourceNode);
    xslSource = new StreamSource(new StringReader(xslSourceString));
    xmlDestination = new DOMResult();
    Transformer thisTransformer = tFactory.newTransformer(xslSource);
    System.out.println("avant");
    thisTransformer.transform(xmlSource, xmlDestination); // HERE IS WHERE IT CRASHES !!!!
    System.out.println("apres");
    return xmlDestination.getNode();
    } catch (TransformerConfigurationException e) {
    System.out.println("TRANSFORMATION CONFIGURATION ERROR:" + e.getMessage());
    return null;
    } catch (TransformerException e) {
    System.out.println("TRANSFORMATION ERROR:" + e.getMessage());
    return null;
    While using this function, I'm receiving the DOM Exception 3
    TRANSFORMATION ERROR:org.apache.crimson.tree.DomEx: HIERARCHY_REQUEST_ERR : This node is not allowed here !
    Also, does someone knows a way to convert a Node in a String ??? I'd like just to be able to println a node in the form "<parentNode><node1>value</node1><node2>value</node2></parentNode>" for example.
    Please help !!!!
    Thanks a lot in advance to any Java/XML Guru for helping.
    Eg\\*

    Come on ... I cannot believe that nobody saw that before. Isn't there any java/dom guru in here ;-) ?
    Could it be a possibly a bug in the API ?
    Thank you very much.
    Eg\\*

  • XSL Transformation enconding problem?

    Hi everybody.
    I have a strange problem with JDev 9.0.2.829 concerning XSL Transformation:
    I just tried to make the step from JDev 3.2.3 to 9i, imported my existing project and set up JDev 9 for use with XalanJ2 and Xerces2. Everything works fine except:
    If I transform XML data to HTML that contains characters with an ASCII code >127 the whole string appears multiple times (2x or 3x) in the generated HTML.
    The data is read from an Oracle DB with UTF8 encoding, all my stylesheets and JSPs are UTF-8 encoded. JDev9 is set to use UTF-8 encoding.
    No compilation errors, no warnings.
    The same code and stylesheets work perfectly in JDev 3.2.3, deployed into Topmcat 4.0.4 and IBM WebSphere 3.5.4.
    What am I missing?
    Thanks in advance!
    Ralf Steppacher

    OK, I found the culprit.
    The JSPWriter is broken and produces the faulty output when fed with UTF-8 encoded character data. The problem disappears when all character data is buffered in a ByteArrayOutputStream first (without a special encodung schema given) and then written as a string through the JSPWriter.
    Ralf

  • XSL Transformation Design View

    Hello together,
    we find an issue with design view of xsl transformation. When we use the design view serveral configurations and mappings where edited and deleted. For example <xsl:stylesheet version="2.0" change to version="1.0" and the call of EBMHeader-Template was deleted.
    Has anybody the same problem? Our are everybody a "h a r d c o r e" coder and use the source view ;-)
    Greetings from Karlsruhe
    Marcel
    PS: It's a little bit tricky to show the design view. We must switch between diffent xslt to see the design.

    when you open the imported xsd in the browser, you do get a xsd shown up ?
    and when you download the xsd locally and validate it, it is valid?

  • XSL transformation with java binding

    Hi everyone!
    I am trying to implement na XSL transformation that uses java code binding.
    My XSL looks as follows:
    <i><xsl:stylesheet xmlns:myobj="java.lang.System"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xf="http://www.sapportals.com/wcm/app/xmlforms">
    <xsl:param name="myobj"/>
    <xsl:value-of select="string(myobj:currentTimeMillis())"/>
    </xsl:stylesheet></i>
    Everything works fine - current time is displayed.
    But when I try to use my custom java class the compiler returns an exception:
    <i>com.sapportals.wcm.WcmException: com.sap.engine.lib.xml.util.NestedException: Could not load class: ep.UmeLookup required for execution of 'UmeLookup.isReady'</i>
    My second xsl stytesheet with a reference to custom class looks as follows:
    <i><xsl:stylesheet xmlns:ume="ep.UmeLookup" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xf="http://www.sapportals.com/wcm/app/xmlforms">
    <xsl:param name="ume"/>
    <xsl:value-of select="string(ume:UmeLookup.isReady())"/>
    </xsl:stylesheet></i>
    I developed java class (ep.UmeLookup), made a .jar from it, included the jar archive in a Library project and deployed the library to the J2EE engine.
    It looks like my class is not 'visible' in J2EE engine, while in my opinion it should be. Does anyone know how to change that??
    BR / marek

    Ask this lady a question. Maybe she could answer your question.
    XSLT Mapping With JAVA Enhancement ( For Beginners)

  • XSL Transformation - cut asx:abap and asx:values

    Hey all,
    I'm using a XSL Transformation to create a XML-File from an internal table.
    My problem is, that the transformation automatically puts the two tags "<asx:abap xmlns:asx="http://www.sap.com/abapxml">" and "<asx:values>" at the beginning of my file (or string):
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <asx:abap xmlns:asx="http://www.sap.com/abapxml">
    <asx:values>
    <ROOT>
    </ROOT>
    </asx:values>
    </asx:abap>
    Does anyone have any idea how I can easily suppress these lines?
    The best course would be of course an XSL statement.
    Thanks and regards,
    Martin.

    Will using a Simple Transformation help your case ?

  • XSL transformation never works on Websphere 5

    I'm doing a xsl transformation on websphere 5 and this xsl never finds the right values. When I run the exact same transformation with the same source, it finds all the values, but on the server it just return empty tags. Why? And how do I fix this?
    Source xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <n:OrderResponseComplex xmlns:n="http://sirius/xml/common">
         <n:AcceptedIndicator>Akseptert</n:AcceptedIndicator>
         <n:RejectionReasonCode>0</n:RejectionReasonCode>
    </n:OrderResponseComplex>XSL transformation:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
         <xsl:template match="/">
              <SiebelMessage IntObjectFormat="Siebel Hierarchical" IntObjectName="TBS2 OHS Reply" MessageType="Integration Object">
                   <TBS2OHSReply>
                        <OrderEntry-Orders>
                             <BackOfficeErrorText><xsl:value-of select="OrderResponseComplex/RejectionReasonCode"/></BackOfficeErrorText>
                             <Status><xsl:value-of select="OrderResponseComplex/AcceptedIndicator"/></Status>
                        </OrderEntry-Orders>
                   </TBS2OHSReply>
              </SiebelMessage>
         </xsl:template>
    </xsl:stylesheet>Result xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <SiebelMessage MessageType="Integration Object" IntObjectName="TBS2 OHS Reply" IntObjectFormat="Siebel Hierarchical">
         <TBS2OHSReply>
              <OrderEntry-Orders>
                   <BackOfficeErrorText/>
                   <Status/>
              </OrderEntry-Orders>
         </TBS2OHSReply>
    </SiebelMessage>

    You need to watch out for the namespace in the source document:
    You can either specify the namespace and use it when locating paths in the source document (as below) or specify it as the default namespace.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0"
         xmlns:xalan="http://xml.apache.org/xslt"
         xmlns:n="http://sirius/xml/common">
    <xsl:template match="/">          
         <SiebelMessage IntObjectFormat="Siebel Hierarchical" IntObjectName="TBS2 OHS Reply" MessageType="Integration Object">
              <TBS2OHSReply>                    
                   <OrderEntry-Orders>                         
                        <BackOfficeErrorText><xsl:value-of select="n:OrderResponseComplex/n:RejectionReasonCode"/></BackOfficeErrorText>
                        <Status><xsl:value-of select="n:OrderResponseComplex/n:AcceptedIndicator"/></Status>
                   </OrderEntry-Orders>
              </TBS2OHSReply>
         </SiebelMessage>
    </xsl:template>
    </xsl:stylesheet>

  • XSL transformation not working

    Hi!
    I am having problems when trying to generate XSL transformation from XML to XML (where XML output is actually XHTML). It always fails executing <xsl:callTemplate name="something", when <xsl:callTemplate /> is executed from another <xsl:template> which is also called with <xsl:callTemplate. Version of database is 10.2.0.4.0, received error is: ORA-00604: invalid character value 'burek' for attribute 'name'.
    Transformation is working in Java and Altova XMLSpy.
    PL/SQL code:
    procedure process_xsl(p_xml in clob, p_xsl in clob, p_result out clob) is
    w_xsl_proc dbms_XSLProcessor.Processor;
    w_xsl_ss dbms_XSLProcessor.Stylesheet;
    w_dom_xsl dbms_xmldom.DOMDocument;
    w_dom_xml dbms_xmldom.DOMDocument;
    w_parser dbms_xmlparser.Parser;
    begin
    --xml in xsl iz cloba v DOMDocument
    w_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(w_parser, p_xml);
    w_dom_xml := dbms_xmlparser.getDocument(w_parser);
    dbms_xmlparser.freeParser(w_parser);
    w_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(w_parser, p_xsl);
    w_dom_xsl := dbms_xmlparser.getDocument(w_parser);
    dbms_xmlparser.freeParser(w_parser);
    --xsl procesiranje
    w_xsl_proc := dbms_XSLProcessor.newProcessor;
    w_xsl_ss := dbms_XSLProcessor.newStylesheet(w_dom_xsl, null); <-- Here error is received
    END;
    Stylesheet:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></xsl:output>
         <xsl:decimal-format name="dec" decimal-separator="," grouping-separator="."/>
         <!-- Predefined constants from einvoice xml schema -->
         <xsl:variable name="einvoiceIssuerCode" select="'II'"></xsl:variable>
         <xsl:variable name="einvoiceRecipientCode" select="'IV'"></xsl:variable>
         <xsl:variable name="einvoiceIssueLocationCode" select="91"></xsl:variable>
         <xsl:variable name="einvoiceIssueDateCode" select="137"></xsl:variable>
         <!-- Constants directly from document which is a part of transformation -->
         <xsl:variable name="einvoiceNumber" select="/IzdaniRacunEnostavni/Racun/GlavaRacuna/StevilkaRacuna/text()"></xsl:variable>
         <!-- Intro template -->
         *<xsl:template name="burek"> <!-- Second template called with xsl:call template -->*
              <xsl:text>TEST</xsl:text>
         </xsl:template>
         <!-- Template in which we create html structure including css -->
         <xsl:template name="einvoice">
              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                   <title>Vizualizacija e-računa št. </title>
                   <xsl:call-template name="burek"></xsl:call-template>
              </head>
              <body>
              </body>
              </html>
         </xsl:template>
         <!-- Intro template -->
         <xsl:template match="/">
    *          <xsl:call-template name="einvoice"></xsl:call-template> <!-- This call is OK -->*
         </xsl:template>
    </xsl:stylesheet>
    XML document
    <?xml version="1.0" encoding="UTF-8"?>
    <IzdaniRacunEnostavni>
    <Racun Id="data">
    <GlavaRacuna>
    <VrstaRacuna>380</VrstaRacuna>
    <StevilkaRacuna>1205019908211</StevilkaRacuna>
    <FunkcijaRacuna>9</FunkcijaRacuna>
    </GlavaRacuna>
    <DatumiRacuna>
    <VrstaDatuma>137</VrstaDatuma>
    <DatumRacuna>2012-05-07T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <DatumiRacuna>
    <VrstaDatuma>263</VrstaDatuma>
    <DatumRacuna>2012-04-28T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <DatumiRacuna>
    <VrstaDatuma>263</VrstaDatuma>
    <DatumRacuna>2012-05-27T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <DatumiRacuna>
    <VrstaDatuma>263</VrstaDatuma>
    <DatumRacuna>2012-03-28T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <DatumiRacuna>
    <VrstaDatuma>263</VrstaDatuma>
    <DatumRacuna>2012-04-26T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <DatumiRacuna>
    <VrstaDatuma>263</VrstaDatuma>
    <DatumRacuna>2012-04-27T00:00:00.0Z</DatumRacuna>
    </DatumiRacuna>
    <Lokacije>
    <VrstaLokacije>91</VrstaLokacije>
    <NazivLokacije>Ljubljana</NazivLokacije>
    </Lokacije>
    </Racun>
    </IzdaniRacunEnostavni>
    Edited by: 938026 on 01-Jun-2012 00:35

    Hi,
    I think your problem lies in the <title>. You are using non UTF-8 characters in the title (š), but you marked your XML as UTF-8. So change the title to have unicode charaters and it will work.
    Herald ten Dam
    http://htendam.wordpress.com

  • XSL Transformation crashes DW CS3

    Whenever I select XSL Transformation from any of the menus,
    it crashes DW CS3 asking the typical, "do you want to tell
    microsoft about this error."
    Anyone have this problem with using XSL Transformations? I'm
    thinking about reinstalling DW to see if it fixes the problem.
    Thanks

    Forgot to mention that this is a Windows XP SP2 machine.

Maybe you are looking for