XSL transformations - choice element

Hi all,
Need inputs in doing xslt transformations on a choice element. Please provide helpful urls/inputs.
My xsd(similar one):-
<xs:element name="Root">
                    <xs:complexType>
                         <xs:choice minOccurs="0" maxOccurs="1">
                              <xs:element name="field1" type="xs:string"></xs:element>
                              <xs:element name="field2" type="xs:string"></xs:element>
                              <xs:element name="field3" type="xs:string"></xs:element>
                              <xs:element name="field4" type="xs:string"></xs:element>
                         </xs:choice>
                    </xs:complexType>
Required output:-
<Root>
<field1>message</field1>
</Root>
or
<Root>
<field2>message</field2>
</Root>
or
<Root>
<field3>message</field3>
</Root>
But when i do transformations the output is shown below. How could I get the above input?
<Root>
<field1>message</field1>
<field2/>
<field3/>
<field4/>
</Root>
Please let me know

Hi,
Do you use the "transformation" activity of the BPEL ?
If yes then you can check two things :
- That the option of the XSL map doesn't generate empty node for all unmapped nodes
- That you have an if condition checking if the node exist before mapping it.
regards,
mathieu

Similar Messages

  • Copying attribute values in xsl transformation

    Hi
    Does anyone know how to copy attribute values in a transfomation generated in a routing rule of a ESB routing service.
    When I inspect the generated xsl (after mapping elements), I can see that the xsl:value-of is used and therefore the element attributes of the original message are lost.
    Specifically when an element contains the xsi:nil attribute, I want to copy it to the target message.
    Suggestions would be greatly appreciated,
    Ruud

    Hi Nathalie,
    Thanks for your reply.
    I would like to elaborate a bit on our problem because I feel that we haven't reached a satisfactory solution yet.
    We are using ESB database adapters to perform DML operations on the database. However we expose these adapters using routing services to allow us to use filters, content based routing etc.
    Consider this example:
    I want to perform an update on a row in the database. If my soap call contains an empty element, this element will be ignored. If I want this the corresponding attribute in the database set to NULL then I have to add the xsi:nill="true" attribute to the element in my message. This works great when invoking the database adapter directly but when you place a routing service in front of it, the transformation will wipe out the xsi:nill="true" attribute on the element causing the database adapter to ignore the element instead of updating to NULL.
    We have found two workarounds:
    detectommissions="false" setting in the wsdl of the database adapter. All empty elements in the message will cause an update to NULL in the database. This means that for every update you always have to have all values in your message to prevent unwanted updates to NULL.
    Add a choose / when / otherwise construction in the transformation of the routing service. If the source element is empty we add an empty element in the destination message containing an xsi:nill="true" attribute, otherwise we just copy the value.
    This construction should be added for each attribute that must be updateable to null.
    Both of these solutions are not satisfactory because they eliminate the choice whether an empty element in the invoking soap call should be ignored or used to trigger an update to null.
    We would like to be able to detect the xsi:nill="attribute" on the invoking call and propagate this attribute to the call to the database adapter.
    Kind regards,
    Ruud

  • 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

  • ABAP XSLT Transformation using element include

    Hi there,
    I am trying to convert data from SAP-DATA -> DOM over XSLT to a Stream.
    For achieving this I have to use certain modularized XSL-Files which will later be accessible over http. At the moment however, those files are on my local hard drive (client) only. I tried to access these files using:
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    *<xsl:include href="D:\XSL\include.xsl"/>*
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
    </xsl:template>
    </xsl:transform>
    I get the message "D:\XSL\include.xsl doesn't exist" when checking the syntax. When I test this in my OS however, it works perfectly. Being an SAP- and XML-Newbie my question is the following: Does SAP not know my hard drive mappings while I'm in a transformation or can i only access directories over al11/http. Or is it complete nonsense at all? 
    Regards, Lukas
    Edited by: Lukas Weigelt on Jun 9, 2010 4:18 PM

    Hi,
    according to:
    >
    Michal_Krawczyk_PIXI wrote:
    > as per:
    > http://help.sap.com/saphelp_470/helpdata/EN/84/2e4d3ce624b800e10000000a114084/frameset.htm
    > "The href attribute no longer applies in this case."
    it appears the include element only works with the repository.... I tried
    <xsl:include sap:name="<Name_of_the_Transformation_in_Repository>"/>
    and it works.
    However this would mean, all includes i have to make have to be imported to the repository. If that's really the case, it'll be a huge problem, because the xsl-files i want to include are outside of my reference
    Regards, Lukas

  • 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 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.

  • 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

  • Xquery ora:processXQuery() in XSL transformation

    Can we use Xquery ora:processXQuery() in XSL transformation?
    Thanks,
    Vivek

    <assign>
    <copy>
    <from expression="ora:processXQuery(query.xq',
    bpws:getVariableData('EmployeeTravelStatusRequest',
    'employee'))"/>
    <to variable="EmployeeTravelStatusResponse" part="employee"/>
    </copy>
    </assign>
    query.xq = the query code itself
    bpws:getVariableData('EmployeeTravelStatusRequest','employee') = the root element for the source payload
    EmployeeTravelStatusResponse" part="employee" = target root element.
    cheers
    James

  • Question about XSL transformation

    Hi All,
      I have a requirment where I need to convert internal table entries to a xml string. But i can't use the default XSL transformation 'ID' here because of some other requirements. Let me explain what I want to achieve with a simple example.
      I do have an internal table based on the structure as given below,
                  person
                       name
                       age
                       address
                  person
    Let us say now in runtime internal table 'lt_person' will hold few entries for this. Now I want convert this to a xml string in such a way that for the <person> element in the result xml string, concatenation of 'name' and 'age' field should come as an attribute with name let us say  'persondesc'.
              <person persondesc="Name1 25">
                       <name>Name1</name>
                       <age>25</age>
              </person>
    Could you please tell me how to define XML transformation using txn code STRANS inorder to achieve this.
    Thanks&Regards,
    Prajesh

    I believe by default xml validation is set to false for a BPEL Domain. I am not sure whether setting this to true will cause your process to error out after the transformation or if it only validates inbound and outbound messages.

  • Creating an XML From a Deep Structure  using XSL Transformation

    Hi ABAPers,
    I have a requirement to use XSL Transformations on an ABAP deep type structure.
    Currently i have an API that fills in this deep structure and by using CALL TRANSFORMATION ID.... i will get the BIG XML having having 100s of nodes . But actualy form the deep structure i need only some NODES (say 50)... So i tried writing an XSLT
    in the transaction STRANS.. but on using this TRANSFORMATION which i wrote i am getting an error messgae like INVALID XML...
    Am i going in right track or is there a good solution...
    My sample transformation is as below...
    <xsl:transform version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
    <xsl:value-of select="DATA/NODE_ELEMENTS/UUID_KEY/UUID"/>
    <xsl:value-of select="DATA/NODE_ELEMENTS/SEMANTICAL_NAME"/>
    <xsl:value-of select="DATA/NODE_ELEMENTS/STRUCT_CAT"/>
    <xsl:value-of select="DATA/NODE_ELEMENTS/USAGE_CAT"/>
    <xsl:value-of select="DATA/NODE_ELEMENTS/RESTRICTED_IND"/>
    <xsl:value-of select="VALUES/DATA/NODE_ID"/>.
    </xsl:template>
    </xsl:transform>
    Please help me in solving this issue....
    Thanks,
    Linda.

    Hi Linda,
        I am replying based on your sample code.
       Try the below following suggestions.
       here 'GRPHDR' is the node where I am selecting the data.
               IGRPHDR is the name of the reference.
    First calling the transformation in you program.
    TYPES: BEGIN OF tl_hdr,
               msgid(20)    TYPE c,
                 END OF tl_hdr.
    DATA : t_hdr           TYPE STANDARD TABLE OF tl_hdr.
      GET REFERENCE OF t_hdr INTO l_result_xml-value.
        l_result_xml-name = 'IGRPHDR'.
        APPEND l_result_xml TO t_result_xml.
       TRY.
            CALL TRANSFORMATION yfi_xml_read
            SOURCE XML it_xml_data
            RESULT (t_result_xml).
          CATCH cx_root INTO l_rif_ex.
            l_var_text = l_rif_ex->get_text( ).
            l_bapiret-type = 'E'.
            l_bapiret-message = l_var_text.
            APPEND l_bapiret TO errormsgs.
            EXIT.
        ENDTRY.
    in XSL transformation
       First write a block of statement to specify from which node you are taking the data.
       No matter it is a node or sub-node.
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
    <xsl:template match="/">
          <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <IGRPHDR>  " reference name of internal table
              <xsl:apply-templates select="//GrpHdr"/>
            </IGRPHDR>
      </asx:values>
        </asx:abap>
    </xsl:template>
    Next select the data from the nodes under the nodes specified in the transformation.
    here msgid is the field i am selecting for value.
    <xsl:template match="GrpHdr">
        <item>
          <MSGID>  " field in the internal table t_hdr where data has to go
            <xsl:value-of select="MsgId"/>
          </MSGID>
        </item>
      </xsl:template>
    reply back if further clarification is needed.
    Thanks and regards,
    Kannan N

  • Row to Column XSL Transform in BLS

    I have 11.5, sr3.
    I was going to use the XSLTransformation action to swap rows and columns of a data set using /Illuminator/stylesheets/RowToColumnTransform.xsl. I cannot get anything but the following as an output:
    <?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-12-12T13:27:29" EndDate="2007-12-03T08:09:17" StartDate="2007-12-03T08:09:17" Version="11.5.3"><Rowset><Columns/><Row/></Rowset></Rowsets>
    There are no errors, I just don't get the result. The input data set is as follows:
    <?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2007-12-12T13:27:29" EndDate="2007-12-03T08:09:17" StartDate="2007-12-03T08:09:17" Version="11.5.3"><Rowset><Columns><Column Description="" MaxRange="1" MinRange="0" Name="User_ID" SQLDataType="1" SourceColumn="User_ID"/><Column Description="" MaxRange="1" MinRange="0" Name="User_Name" SQLDataType="1" SourceColumn="User_Name"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_Number" SQLDataType="4" SourceColumn="Sample_Number"/><Column Description="User Name" MaxRange="1" MinRange="0" Name="Login_By" SQLDataType="1" SourceColumn="Login_By"/><Column Description="Examination Type" MaxRange="1" MinRange="0" Name="Examination" SQLDataType="1" SourceColumn="Examination"/><Column Description="" MaxRange="1" MinRange="0" Name="Examination_Title" SQLDataType="1" SourceColumn="Examination_Title"/><Column Description="" MaxRange="1" MinRange="0" Name="Examination_Desc" SQLDataType="1" SourceColumn="Examination_Desc"/><Column Description="" MaxRange="1" MinRange="0" Name="Test_Number" SQLDataType="4" SourceColumn="Test_Number"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_Time" SQLDataType="93" SourceColumn="Sample_Time"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_Status" SQLDataType="1" SourceColumn="Sample_Status"/><Column Description="" MaxRange="1" MinRange="0" Name="Authorize" SQLDataType="1" SourceColumn="Authorize"/><Column Description="" MaxRange="1" MinRange="0" Name="Total_Defects" SQLDataType="4" SourceColumn="Total_Defects"/><Column Description="" MaxRange="1" MinRange="0" Name="Carton_Code_Date" SQLDataType="1" SourceColumn="Carton_Code_Date"/><Column Description="" MaxRange="1" MinRange="0" Name="Package_Code_Date" SQLDataType="1" SourceColumn="Package_Code_Date"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_1_Container" SQLDataType="1" SourceColumn="Sample_1_Container"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_2_Container" SQLDataType="1" SourceColumn="Sample_2_Container"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_1_Container_Get" SQLDataType="1" SourceColumn="Sample_1_Container_Get"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_2_Container_Get" SQLDataType="1" SourceColumn="Sample_2_Container_Get"/><Column Description="" MaxRange="1" MinRange="0" Name="Machine_Scanned" SQLDataType="1" SourceColumn="Machine_Scanned"/><Column Description="" MaxRange="1" MinRange="0" Name="Machine_Shift_Flag" SQLDataType="4" SourceColumn="Machine_Shift_Flag"/><Column Description="" MaxRange="1" MinRange="0" Name="Maker_Name" SQLDataType="1" SourceColumn="Maker_Name"/><Column Description="" MaxRange="1" MinRange="0" Name="Packer_Name" SQLDataType="1" SourceColumn="Packer_Name"/><Column Description="" MaxRange="1" MinRange="0" Name="Sample_Size" SQLDataType="4" SourceColumn="Sample_Size"/><Column Description="SAP Product Code of the associated Cigarette Audit if Linked" MaxRange="1" MinRange="0" Name="Associated_Cig_Audit_SAP_Code" SQLDataType="1" SourceColumn="Associated_Cig_Audit_SAP_Code"/><Column Description="SAP Product Code of the associated Pack Audit if Linked" MaxRange="1" MinRange="0" Name="Associated_Pack_Audit_SAP_Code" SQLDataType="1" SourceColumn="Associated_Pack_Audit_SAP_Code"/><Column Description="Sample Number of the associated CIg Audit if Linked" MaxRange="1" MinRange="0" Name="Associated_Cig_Audit_Sample_Number" SQLDataType="1" SourceColumn="Associated_Cig_Audit_Sample_Number"/><Column Description="Sample Number of the associated Pack Audit if Linked" MaxRange="1" MinRange="0" Name="Associated_Pack_Audit_Sample_Number" SQLDataType="1" SourceColumn="Associated_Pack_Audit_Sample_Number"/><Column Description="" MaxRange="1" MinRange="0" Name="Machine_SAP_Code" SQLDataType="1" SourceColumn="Machine_SAP_Code"/><Column Description="" MaxRange="1" MinRange="0" Name="Machine_SAP_Desc" SQLDataType="1" SourceColumn="Machine_SAP_Desc"/><Column Description="" MaxRange="1" MinRange="0" Name="Maker_SAP_Code" SQLDataType="1" SourceColumn="Maker_SAP_Code"/><Column Description="" MaxRange="1" MinRange="0" Name="Maker_SAP_Desc" SQLDataType="1" SourceColumn="Maker_SAP_Desc"/><Column Description="" MaxRange="1" MinRange="0" Name="Packer_SAP_Code" SQLDataType="1" SourceColumn="Packer_SAP_Code"/><Column Description="" MaxRange="1" MinRange="0" Name="Packer_SAP_Desc" SQLDataType="1" SourceColumn="Packer_SAP_Desc"/><Column Description="" MaxRange="1" MinRange="0" Name="Action" SQLDataType="1" SourceColumn="Action"/></Columns><Row><Sample_Number>46</Sample_Number><Examination>MKNG_PQC_PACK</Examination><Examination_Title>PQC Pack Audit</Examination_Title><Examination_Desc>Making &amp; Packing PQC Pack Audit Sample Template</Examination_Desc><User_ID>clmf90</User_ID><User_Name></User_Name><Login_By>SYSTEM</Login_By><Test_Number>63</Test_Number><Sample_Time>2007-12-12T13:46:52</Sample_Time><Sample_Status>Complete</Sample_Status><Authorize>No</Authorize><Total_Defects>1</Total_Defects><Carton_Code_Date>-</Carton_Code_Date><Package_Code_Date>7T28D205 11:30</Package_Code_Date><Sample_1_Container>01-01</Sample_1_Container><Sample_2_Container>-</Sample_2_Container><Sample_1_Container_Get>01-01</Sample_1_Container_Get><Sample_2_Container_Get>-</Sample_2_Container_Get><Machine_Scanned>U-MAKER-205</Machine_Scanned><Maker_Name>0205</Maker_Name><Machine_Shift_Flag>1</Machine_Shift_Flag><Packer_Name>0205</Packer_Name><Sample_Size>2</Sample_Size><Associated_Cig_Audit_SAP_Code>2001155</Associated_Cig_Audit_SAP_Code><Associated_Pack_Audit_SAP_Code>-</Associated_Pack_Audit_SAP_Code><Associated_Cig_Audit_Sample_Number>MKNG-PQC-CIG-20071128-0004</Associated_Cig_Audit_Sample_Number><Associated_Pack_Audit_Sample_Number>---</Associated_Pack_Audit_Sample_Number><Machine_SAP_Code></Machine_SAP_Code><Machine_SAP_Desc>MAVERICK LT MENT 100</Machine_SAP_Desc><Maker_SAP_Code>2001155</Maker_SAP_Code><Maker_SAP_Desc>MAVERICK LT MENT 100</Maker_SAP_Desc><Packer_SAP_Desc>MAVERICK LT MENT 100</Packer_SAP_Desc><Packer_SAP_Code></Packer_SAP_Code></Row></Rowset></Rowsets>
    What am I missing?

    Sparks,
    Any reason you are not using the VerticalGrid Applet?
    Did you specify any of the parameters required by the XSL, such as ColumnID and ValueID?
    The XSL appears to only translate a single row node to a column....
    Try using this XSL:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan java">
         <xsl:output encoding="UTF-8" method="xml" media-type="text/xml"/>
         <xsl:template match="/">
              <Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
                   <xsl:for-each select="Rowsets">
                        <xsl:copy-of select="FatalError"/>
                        <xsl:copy-of select="Messages"/>
                        <xsl:copy-of select="HyperLinks"/>
                        <xsl:if test="count(/Rowsets/FatalError) = '0'">
                             <Rowset>
                                  <Columns>
                                       <Column Name="Name" SourceColumn="Name" Description="Name" SQLDataType="1" MinRange="0.0" MaxRange="1.0"/>
                                       <Column Name="Value" SourceColumn="Value" Description="Value" SQLDataType="1" MinRange="0.0" MaxRange="1.0"/>
                                  </Columns>
                                  <xsl:for-each select="/Rowsets/Rowset/Row/*[name()]">
                                       <Row>
                                            <xsl:element name="Name">
                                                 <xsl:value-of select="name(.)"/>
                                            </xsl:element>
                                            <xsl:element name="Value">
                                                 <xsl:value-of select="."/>
                                            </xsl:element>
                                       </Row>
                                  </xsl:for-each>
                             </Rowset>
                        </xsl:if>
                   </xsl:for-each>
              </Rowsets>
         </xsl:template>
    </xsl:stylesheet>
    Sam

  • 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.

  • CPO XSL Transform for CPSC Form data with Grid

    Does anyone have an XSL Transform worked out that conveniently parses the CPSC Form output from Service Link when it has a grid in it?
    For example the data from CPSC Service Link might look like:
    <root>
       <Common>
          <Action ClassID="">Some Action</Action>
          <RequisitionID>123</RequisitionID>
       </Common>
       <Attributes/>
       <FormData>
          <Dictionary.Field>Some Data</Dictionary.Field>
          <DictionaryWithGrid-1.Field1>somevalue</DictionaryWithGrid-1.Field1>
          <DictionaryWithGrid-1.Field2>someothervalue</DictionaryWithGrid-1.Field2>
          <DictionaryWithGrid-1.Field3>yetanothervalue</DictionaryWithGrid-1.Field3>
          <DictionaryWithGrid-2.Field1>somevalue2</DictionaryWithGrid-2.Field1>
          <DictionaryWithGrid-2.Field2>someothervalue2</DictionaryWithGrid-2.Field2>
          <DictionaryWithGrid-2.Field3>yetanothervalue2</DictionaryWithGrid-2.Field3>
       </FormData>
    </root>
    So the desired output would be
    <Row>
       <Field1>somevalue</Field1>
       <Field2>someothervalue</Field2>
       <Field3>yetanothervalue</Field3>
    </Row>
    <Row>
       <Field1>somevalue2</Field1>
       <Field2>someothervalue2</Field2>
       <Field3>yetanothervalue2</Field3>
    </Row>
    I'm having difficulty getting the right XSL select when the tag is something like 'DictionaryWithGrid-#.Field'.
    Thanks!

    That worked great, Svetlana!  Thank you very much for the help.
    I made some slight mods to make it even more portable and intuitive for XSL/XML beginners.
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:msxsl="urn:schemas-microsoft-com:xslt">
    <!-- Replace CHANGEME below with the name of the CPSC Form Dictionary to transform -->
    <xsl:variable name="Dictionary">CHANGEME</xsl:variable>
    <xsl:template match="root">
      <Table>
          <xsl:call-template name="ProcessOne">
            <xsl:with-param name="pos" select="1" />
          </xsl:call-template>
      </Table>
    </xsl:template>
      <xsl:template name="ProcessOne">
        <xsl:param name="pos" />
        <xsl:variable name="RowName" select="concat($Dictionary, '-', $pos)" />
        <xsl:if test="FormData/*[starts-with(name(), $RowName)] != ''">
          <Row>
            <xsl:for-each select="FormData/*[starts-with(name(), $RowName)]">
              <xsl:if test="starts-with(name(.), $RowName)">
                <xsl:variable name="FieldName" select="substring-after(name(.), '.')"/>
                <xsl:element name="{$FieldName}">
                  <xsl:value-of select="."/>
                </xsl:element>
              </xsl:if>
            </xsl:for-each>
          </Row>
          <xsl:call-template name="ProcessOne">
            <xsl:with-param name="pos" select="number($pos+1)" />
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

  • How to get xsql page-param on xsl transform?

    On the xsql file a page-param is set. If param does not exist then have do insert new record into master table, then requery for the value to set-page-param.
    How do call the page-param on xsl transform file used in xsql:insert-request?
    <xsql:set-page-param bind-params="cwMedRecNo" name="org_client_id">
    select client_id from org_client
    where chart_number = ?
    and active_ind = 'Y'
    and provider_organization_id = 71
    </xsql:set-page-param>
    <xsql:if-param name="org_client_id" exists="no">
    <!-- Client_Id doesn't exist, get next sequence number value-->
    <xsql:set-page-param name="org_client_id">
    select client_id_s.nextval from dual
    </xsql:set-page-param>
    <!--insert patient into org_client table-->
    <xsql:dml bind-params="org_client_id cwMedRecNo" commit="yes">
    insert into client (organization_id, client_id, chart_number, active_ind, last_updated_date, administered_ind)
    values
    (000, ?, ?, 'Y', sysdate, 'Y')
    </xsql:dml>
    </xsql:if-param>
    <xsql:set-page-param name="s_org_client_id" value="{@org_client_id}" />
    <xsql:insert-request
    table="immunization"
    columns="client_id organization_id site_id vaccination_date last_updated_date entered_by_org_id vaccine_id source_id contraindication_code refused_code elsewhere_code active_record HISTORICAL_IND"
    transform="dme_data_entry_immunization.xsl"
    commit-batch-size = "1" />
    In the dme_data_entry_immunization.xsl file. The element client_id comes back null.
    <rowset xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="/request/parameters/*">
    <row>
    <xsl:element name="client_id"><xsl:value-of select="//s_org_client_id"/></xsl:element>
    <xsl:element name="vaccine_group_code">
    <xsl:choose>
    <xsl:when test="item_no = 145">PNEU</xsl:when>
    <xsl:when test="item_no = 144">FLU</xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    </xsl:element>
    </row>
    </rowset>

    Hi J
    Have you added the <<Page()>> and <<PageCount()>> functions on the reports?
    FR does not (or certainly did not) add page numbers to the reports in books unless you manually add them. I always used to add a text box in the footer of the report and insert functions like this. It has been a while since I did it (I haven't on 11.1.2.1 for example) but I think that if you do this the page number corresponds to the page within the book and not the page of the report (if a multi-page report). It may not take account of a TOC page though.
    Hope this helps
    Stuart

  • 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

Maybe you are looking for

  • Firefox will only open websites via url link, does not even attempt to connect through the address bar.

    I can only open Firefox websites by using a url link. If I try to type something in the address bar it will not even attempt to load the page, no loading circle, no error or no connection message. I'm at youtube.com and I type in google.com and slap

  • Delivery Times on 24" iMacs

    Can't believe the responsiveness. Ordered CTO with 500GB drive and 2GB RAM on late Thursday, September 14. Shipping was estimated at Sep 20 with arrival on the 25th. Actual shipment was the 16th - arrived on the 19th! Went from Shanghai to Phillippin

  • HELP: need to re-do APEX 3.2 upgrade

    hi -- You've probably seen my recent posts regarding confirming that we're actually in a 3.2 development environment after the upgrade. I (developer) found out today from the DBA who did the install that he only ran apxrtin.sql (runtime installation)

  • Need to export owb mapping documentation..How ?

    HI , I have 500 mappings and i want details document of these mappings. Is there any way By which i can export the mapping document and which contains source table, target table , and all transformation exists in it. It should be like a ETL specs. @w

  • About File Name Issue by Robocopy

    Please kindly help as follows: Due to I need to migrate the Data from Novell to Windows 2008 R2, I have some issue about robocopy. My existing file include some long file / folder name and long file path. (More than 256 / 260 characters) When I try t