Matching namespace qualified xpaths vis JAXP xsl transforms

I am having problems getting template
matches to work when matching against
namespace qualified tags. I am passing
the source xml and xsl into a JAXP transformer.
The xsl templates sucessfully match against non namespace
qualified tags but not namespace qualified tags.
I have set the DocumentBuilderFactory to be namespace aware. The xml source and the xsl source are loaded
from the file system i.e. the DOM's are not
built programmatically.
Peter.

Similar Messages

  • Error using custom xpath function with XSL transformations in BPM

    Hi,
    We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
    We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
    I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
    Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
    13801175
    14406487 (11.1.1.6.4 SOA Bundle)
    13896993
    13088538
    Regards Dave
    Edited by: DavidGaskell on Mar 14, 2013 10:08 PM

    Hi All,
    I am also facing the same issue...Experts can you please help us.
    hi DavidGaskell, did you find any resolution, if so can you share it with me.....
    Thanks,
    RR

  • Xsl transformation from version1 to version2, problem with namespaces

    Guys!
    In my current project we need to have an interface in Oracle ESB which is build on lets say a wsdl version1 and an interface build on wsdl version2.
    In esb i need to define a transformation which will transform the request on version1 to version2. Because the xsd for the operation is really huge (+1000 items) i made some templates in xsl to do most of the work, works great..only i'm having a few issues now.
    To re-order items from source to target i do the next in a template
    <nameGroep>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    </nameGroep>The only problem from the xsl:copy-of is, it also copies the namespace along. So if my target document uses an other namespace, it fails.
    To correct this i hoped i could make use of <xsl:namespace-alias> but this doesn't work on a literal/text tag (hope i explain this correct).
    Other option is, for every element do something like
    [code[
    <elementname>
    <xsl:value-of select=""/>
    </elementname>
    but this will create the <elementname> always in the target whether or not it's in the source. You could do a check to see if it's in the source, but this isn't a solution because then i need to check for every 1000+ item in the source document, so..we skip this idea.
    So i reach a point where im still searching for a good solution and hoped you guys could help me a bit with it.
    If the problem isn't explain well please say so, and i will add extra info.

    Guys!
    In my current project we need to have an interface in Oracle ESB which is build on lets say a wsdl version1 and an interface build on wsdl version2.
    In esb i need to define a transformation which will transform the request on version1 to version2. Because the xsd for the operation is really huge (+1000 items) i made some templates in xsl to do most of the work, works great..only i'm having a few issues now.
    To re-order items from source to target i do the next in a template
    <nameGroep>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    </nameGroep>The only problem from the xsl:copy-of is, it also copies the namespace along. So if my target document uses an other namespace, it fails.
    To correct this i hoped i could make use of <xsl:namespace-alias> but this doesn't work on a literal/text tag (hope i explain this correct).
    Other option is, for every element do something like
    [code[
    <elementname>
    <xsl:value-of select=""/>
    </elementname>
    but this will create the <elementname> always in the target whether or not it's in the source. You could do a check to see if it's in the source, but this isn't a solution because then i need to check for every 1000+ item in the source document, so..we skip this idea.
    So i reach a point where im still searching for a good solution and hoped you guys could help me a bit with it.
    If the problem isn't explain well please say so, and i will add extra info.

  • 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

  • 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 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 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 won't run in Web Start

    Hello,
    I am using the javax.xml.transform.Transformer implementation built into Java 1.5.x to transform an XML document into HTML using an XSLT transformation source. This code works perfectly if I run the app outside of Java Web Start. However, if I run the app in web start, the output is partial. More specifically, the XML and the XSLT load just fine in web start (I've confirmed this), but the end result of the Transformation is a properly formatted HTML document with only part of the data -- a bunch of data is missing.
    I have some loops in the XSLT that print out rows in an HTML table with the data I want to see. These loops don't seem to run when I'm in web start, but the rest of the transformation does run.
    I've confirmed this is not working on both Mac OS and Windows, version 1.5.0_06 and 1.5.0_09. So I don't think it is a bug on any particular platform. I am totally stumped by this. The XSL transformation process is doing something different in web start than it does when run from the command line (either different jars are in play, or system properties are different, etc).
    Has anyone else experienced this?
    Thank You,
    Eric

    One thing I'd like to mention...
    My XML document has no namespace defined, and neither does my XSLT transform document. I am just referencing plain old string element names that simply match between the XML and XSLT. This all works fine when the Transform is run from a java app that is started on the command line. Things break down when the app is run via Java Web Start. Could the namespace issue be the problem, however? I don't see how that could be as the code works from a 'normal' java app, but maybe I'm missing something.

  • Problems with xsl transformation

    Hi,
    I have an XSL to transform an XML to HTML code.
    I want my HTML to be ACCESSIBLE.
    All is working ok, but the <html> tag have two or three attributtes that make de code no ACCESSIBLE.
    This is a part of the XSL code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
         <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="yes" standalone="no"/>
    <xsl:include href="barraSuperior.xsl"/>
         <xsl:include href="cabecera.xsl"/>
         <xsl:include href="menu.xsl"/>
         <xsl:include href="enllacosDestacats.xsl"/>
         <xsl:include href="contenido.xsl"/>
         <xsl:include href="barraBanners.xsl"/>
         <xsl:include href="pie.xsl"/>
         <xsl:variable name="homeWeb">http://172.16.67.119:8080/Biblioteques/xslt/V53CapSetmana</xsl:variable>
         <xsl:variable name="idioma"><xsl:value-of select="xmlData/config/idioma"/></xsl:variable>
         <xsl:variable name="literals" select="document(concat($homeWeb,'/traduccions/',$idioma,'.xml'))"/>
         <xsl:template match="/">
              <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$idioma}" lang="{$idioma}">
                   <head>
                        <title>
    <body>
                        <xsl:call-template name="barraSuperior"/>
                        <xsl:call-template name="cabecera"/>
                        <div id="wrapper">                         
                             <div id="columna0">
                                  <xsl:apply-templates select="xmlData/menuLateral/contingutVignette/contingut/llista"/>
                             </div>     
                             <xsl:call-template name="contenido"/>
                        </div>
                        <xsl:call-template name="pie"/>
                   </body>
              </html>
         </xsl:template>
    </xsl:stylesheet>
    This is a part of the HTML result:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="ca" lang="ca">
         <head>
              <title>B cap de setmana</title>
    </head>
    <body>
    </body>
    I want the <html> to be like this:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ca" lang="ca">

    Use the exclude-result-prefixes attribute in your xsl:stylesheet element.

  • Xsl transformation from html to text.

    Hi, i want to tranform an html source and produce a output as text. All i want to do is to output values from my input fields in my html source. Any ideas on how i would construct my xsl file.
    example :
    HTML:
    <html>
    <body>
    <input name="od" type="text" value="123">
    <input name="id" type="text" value="456">
    </body>
    </html>
    would simply give :
    123
    456
    Thanks for your help !!!

    Here is what I came up with. I changed the regular HTML into XHTML then created a stylesheet that would use XPath to find and display the values or the value fields:
    test.xml (XHTML version of the HTML you posted)
    ======================================
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    <html>
    <body>
    <input name="od" type="text" value="123"/>
    <input name="id" type="text" value="456"/>
    </body>
    </html>
    test.xsl
    ======
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <html>
    <head>
    <title>Input values</title>
    </head>
    <body>
    <xsl:for-each select="html/body/input">
    <xsl:value-of select="@value"/>
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    this gives the desired result.

  • 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 Action Parameters

    Does anyone know how, or even if it's possible, to pass parameters to an XSLT stylesheet using the XSL Transformation action in a Business Logic Transaction?

    Som,
    The parameter I was referring to is not an action parameter, but a parameter in the XSLT itself. E.G. the following extracts a column from an xMII document and creates a new doc with that one column. But I want to name the column at run time, so I can use the same XSLT in various places.
    [code]
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="ColumnToExtract" select="ProductAshDry"></xsl:param> <xsl:template match="/">
        <Rowsets DateCreated="2007-05-31T10:58:25" EndDate="2007-05-31T10:58:25" StartDate="2007-05-31T10:58:25" Version="11.5.2">
          <Rowset>
            <Columns>
              <Column Description="Item" MaxRange="0" MinRange="0" Name="Data" SQLDataType="1" SourceColumn="Data"/>
            </Columns>
            <xsl:for-each select="/Rowsets/Rowset/Row">
              <Row>
                <Data>
                  <xsl:value-of select="$ColumnToExtract"/>
                </Data>
              </Row>
            </xsl:for-each>
          </Rowset>
        </Rowsets>
      </xsl:template>
    </xsl:stylesheet>
    [/code]
    ColumnToExtract is a parameter for the XSLT, which can be set at runtime with various other transform engines. I just can't see a way to set it using the xMII XSL Transformation action.
    Regards,
    Bill

  • XSL Transformation to Oracle Canonical Format

    XSL Transformation to Oracle Canonical Format
    Posted: Aug 6, 2007 9:31 AM Reply
    I am having issues with transforming XML into Oracle Canonical Format. Can someone, please tell me what am doing wrong?
    The source XML:
    <transform>
    <key old="driver" new="3" transform1="specified">
    <value old="-1" new="-1" description="NA" />
    <value old="0" new="0" description="no" />
    <value old="1" new="1" description="yes" />
    </key>
    </transform>
    I must transform it with XSL into Oracle Canonical format:
    <ROWSET>
    <ROW>
    <column_name_1 />
    <column_name_2 />
    <column_name_3 />
    </ROW>
    <ROW>
    <column_name_1 />
    <column_name_2 />
    <column_name_3 />
    </ROW>
    </ROWSET>
    So, I came up with this stylesheet.
    <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <ROWSET table = "table4xml">
    <ROW num ="1">
    <KEY_OLD>
    <xsl:value-of select="@old" />
    </KEY_OLD>
    <KEY_NEW>
    <xsl:value-of select="@new" />
    </KEY_NEW> <TRANSFORM1>
    <xsl:value-of select="@transform1" />
    </TRANSFORM1>
    <VALUEOLD>
    <xsl:value-of select="@valueold" />
    </VALUEOLD>
    <VALUENEW>
    <xsl:value-of select="@valuenew" />
    </VALUENEW>
    <DESCRIPTION>
    <xsl:value-of select="@description" />
    </DESCRIPTION>
    </ROW>
    </ROWSET>
    </xsl:template>
    </xsl:stylesheet>
    Table TABLE4XML
    KEY
    KEY_OLD
    KEY_NEW
    TRANSFORM1
    VALUEOLD
    VALUENEW
    DESCRIPTION
    I must have made a mistake within the XSL code, because the PL/SQL procedure that am using inserts a row of NULLs into the table.
    Am I correct that the given XML file should look in canonical format as this??
    <ROWSET>
    <ROW>
    <key>
    <old>driver</old>
    <new>3</new>
    <transform1>specified</transform1>
    <value>
    <old>-1</old>
    <new>-1</new>
    <description>NA</description>
    </value>
    </key>
    </ROW>
    </ROWSET>

    There is a misunderstanding in your question. Oracle canonical format has a root node named <rowset> and its children have the name of <row>. And its grandchildren have the name of <column>. This is all of canonical family, no other grand-grand-children :)
    Also here is an example for null values in canonical format. They are not presented in XML.
    SQL> set serveroutput on
    SQL> select null "col1", 'data' "col2" from dual;
    c col2
    data
    SQL> DECLARE
    2 ctx dbms_xmlgen.ctxHandle;
    3 xml CLOB;
    4 BEGIN
    5 ctx := dbms_xmlgen.newContext('select null "col1", ''data'' "col2" from dual');
    6 dbms_output.put_line(ctx);
    7
    8 xml := dbms_xmlgen.getXML(ctx);
    9 dbms_output.put_line(xml);
    10
    11 dbms_xmlgen.closeContext(ctx);
    12 END;
    13 /
    8
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <col2>data</col2>
    </ROW>
    </ROWSET>
    PL/SQL procedure successfully completed.
    Best Regards
    Erturk

  • 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

Maybe you are looking for

  • Is this legal?

    Hi I am wondering if it is legal to rip music off of a friend's ipod. An example: Using ipod rip to transfer his music to my itunes library for personal use. Thanks for any help!

  • Asset property refresh?

    If I generate an H264 file that is VBR and import it into an Encore Project and later decide to re-render the H264 file as CBR from Premiere, Encore appears to retain properties from the VBR file because it will build an unusable ISO image that is ha

  • Obsolete Process Exception - what does it mean?

    Following the documentation, I've added a process exception to the technical description in the component interface of my Web Dynpro application, in addition to the inbound and outbound parameters.  However, when I check the callable object, I get a

  • Outlook 2013 not connect with Exchange server 2013 in internal network

    Hello All, I Have two Exchange server 2013 in our environment. Both server install mailbox and CAS role. After configure exchange server 2013, Outlook 2013 not connect in internal network. I have configure outlook manually. i tried by using the sugge

  • Can't activate 3G I get usim9997 error

    I can't activate my iPad 3G. It's an at &t iPad. It was set up from someone else and I bought it from them. Keeps telling me to try again later and gives code usim9997