XSLT Transformation - using variables in title name

Hi,
Is there a way to set the title attribute of a table tab in XSLT dynamically through xslt? I'm trying to display sections of code which have the title hardcoded and are present in the xml being rendered. I need the title of that section determined dynamically while parsing through the object nodes of the xml.
Example:
<table id="Table ID" title="/Object1/attribute1/name" columnCount="3" seqNo="1">
instead of hardcoding the title name in the XSLT can we pull the name and set it from the xml being processed?
Thanks,
Pavan

<section id="CALCULATION" title="Calculation">
               <table id="CALCULATION" title="ClientName Calculation Information" columnCount="3" seqNo="1">
                    <xsl:for-each select="//returnableObjects/IntermediateResultsJB/IntermediateResultJB">
                         <xsl:if test="resultSetName[.='Client Name Calculation Information']">
                              <xsl:variable name="Variable1" select="resultName"/>
                              <xsl:variable name="Variable2" select="resultValue"/>
                              <!--<xsl:variable name="Variable3" select="resultOrder"/>-->
                              <detailRow>
                                   <!-- <cell type="string">
                                        <xsl:value-of select="$Variable3"/>
                                   </cell> -->
                                   <cell type="string">
                                        <xsl:value-of select="$Variable1"/>
                                   </cell>
                                   <cell type="number">
                                        <xsl:value-of select="$Variable2"/>
                                   </cell>
                              </detailRow>
                         </xsl:if>
                    </xsl:for-each>
               </table>
</section>This is the XSLT above being used. "ClientName Calculation Information" is hardcoded in the xml that is being rendered.
XML Fragment is given below:
<IntermediateResultJB>
                  <resultSetName>ResultSetName1</resultSetName>     
     <resultName>Name</resultName>
     <resultValue>Value</resultValue>
     <resultOrder>1</resultOrder>
</IntermediateResultJB>
<IntermediateResultJB>
     <resultSetName>ResultSetName2</resultSetName>
     <resultName>Name</resultName>
     <resultValue>Value</resultValue>
     <resultOrder>2</resultOrder>
</IntermediateResultJB>
<IntermediateResultJB>
     <resultSetName>ResultSetName3</resultSetName>
     <resultName>Name</resultName>
     <resultValue>Value</resultValue>
     <resultOrder>3</resultOrder>
</IntermediateResultJB>I want the XSLT above to use the <resultSetName> value["ClientName Calculation Information" e.g] to be set in the value of the title attribute of the <table> as well as <section>.
Thanks,
Pavan
Edited by: EJP on 23/05/2012 10:08: code tags.

Similar Messages

  • Xslt transformation using SAP BC 47

    Hi,
    I'm trying to do a transformation using the sap transformation package in the SAP BC ( rel 47 )
    I'm transforming an IDOC into a cXML order for example...
    The transformed xml contains some rather odd characters...
    Even a very simple xslt has these odd characters...
    directly after the DOCTYPE
    I'm using MapForce to create the xslt..
    Has anyone else experienced these issues?
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE cXML SYSTEM "....."[
      ]>
    <cXML payloadID="2005081645000002780916170000000000004039" timestamp="2005-08-16T09:16:17+0.00">
      <Header>
        <From>

    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

  • Using variables as table names. Ideas for alternative designs

    Hi,
    I am designing an application which uses synonyms to pull information from 'client' DBs via DB Links. The synonyms are created with a DB_ID in the name (example: CUSTOMER_100, CUSTOMER_200... where 100 and 200 are DB IDs from 2 separate client DBs.
    I have a procedure which selects data from the synonym based on what DB_ID is passed to the procedure. I want to be able to run this one procedure for any DB_ID that is entered. I am now aware I cannot use variable names for table names and using EXECUTE IMMEDIATE doesnt seem to fit for what I am trying to do.
    Does anybody have any suggestions or re-design options I could use to achieve this generic procedure that will select from a certain synonym based on the DB info input parameters? Thanks.
    CREATE OR REPLACE PROCEDURE CUSTOMER_TEST(p_host IN VARCHAR2, p_db_name IN VARCHAR2, p_schema IN VARCHAR)
    IS
       v_hostname     VARCHAR2 (50) := UPPER (p_host);
       v_instance     VARCHAR2 (50) := UPPER (p_db_name);
       v_schema     VARCHAR2 (50) := UPPER (p_schema);
       v_db_id  NUMBER;  
       v_synonym VARCHAR2(50);
       CURSOR insert_customer
       IS
         SELECT 
           c.customer_fname,
           c.customer_lname
         FROM v_synonym_name c;
    BEGIN
    -- GET DB_ID BASED ON INPUT PARAMETERS       
      select d.db_id
      into v_db_id
      from  t_mv_db_accounts ac,
      t_mv_db_instances i,
       t_mv_dbs d,
       t_mv_hosts h
      where ac.db_ID = d.db_ID
      and i.db_ID = d.db_ID
      and i.HOST_ID = h.host_id
      and upper(H.HOST_NAME) = v_hostname
      and upper(D.DB_NAME) = v_instance
      and upper(Ac.ACCOUNT_NAME) = v_schema;
      --APPEND DB_ID TO THE SYNOYNM NAME
      v_synonym := 'CUSTOMER_'||v_db_id;
      FOR cust_rec IN insert_customer
      LOOP
         INSERT INTO CUSTOMER_RESULTS (First_Name, Last_Name)
         VALUES (cust_rec.customer_fname, cust_rec.customer_lname);
      END LOOP;
      COMMIT;
    END;
    Rgs,
    Rob

    Hi
    rules engine style with table that holds the logic or code SQL directly in the procedure and IF THEN ELSE with db_id. Latter is better because SQL is native and objects are checked every time procedure is compiled.
    James showed the simplest way but this rather complex way gives you more flexibility between instances if ever needed.
    CREATE TABLE synonym_dml(db_id number not null primary key, sql_text clob)
    INSERT INTO synonym_dml VALUES (100, 'INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100')
    INSERT INTO synonym_dml VALUES (200, 'INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200')
    set serveroutput on size unlimited
    create or replace
    PROCEDURE Execute_Synonym_Dml(p_host VARCHAR2, p_db_name VARCHAR2, p_schema VARCHAR) IS
    BEGIN
      FOR r IN (
        SELECT sql_text FROM synonym_dml
        --  WHERE db_id IN (
        --    SELECT d.db_id
        --    FROM t_mv_db_accounts ac, t_mv_db_instances i, t_mv_dbs d, t_mv_hosts h
        --    WHERE ac.db_id = d.db_id
        --      AND i.db_id = d.db_id
        --      AND i.host_id = h.host_id
        --      AND upper(h.host_name)      = p_hostname
        --      AND upper(d.db_name)        = p_instance
        --      AND upper(ac.account_name)  = p_schema
      LOOP
        DBMS_OUTPUT.PUT_LINE('-- executing immediately ' || r.sql_text);
        --EXECUTE IMMEDIATE r.sql_text;
      END LOOP;
    END;
    create or replace
    PROCEDURE Execute_Synonym_Dml_Too(p_host VARCHAR2, p_db_name VARCHAR2, p_schema VARCHAR) IS
      PROCEDURE DB_ID_100 IS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('-- executing DB_ID_100');
        --INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100;
      END;
      PROCEDURE DB_ID_200 IS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('-- executing DB_ID_200');
        --INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200;
      END;
    BEGIN
      FOR r IN (
        SELECT 100 db_id FROM dual
        --  SELECT d.db_id
        --  FROM t_mv_db_accounts ac, t_mv_db_instances i, t_mv_dbs d, t_mv_hosts h
        --  WHERE ac.db_id = d.db_id
        --    AND i.db_id = d.db_id
        --    AND i.host_id = h.host_id
        --    AND upper(h.host_name)      = p_hostname
        --    AND upper(d.db_name)        = p_instance
        --    AND upper(ac.account_name)  = p_schema
      LOOP
        IF (r.db_id = 100) THEN
          DB_ID_100;
        ELSIF (r.db_id = 200) THEN
          DB_ID_200;
        ELSE
          RAISE_APPLICATION_ERROR(-20001, 'Unknown DB_ID ' || r.db_id);
        END IF;
      END LOOP;
    END;
    EXECUTE Execute_Synonym_Dml('demo','demo','demo');
    EXECUTE Execute_Synonym_Dml_Too('demo','demo','demo');
    DROP TABLE synonym_dml PURGE
    DROP PROCEDURE Execute_Synonym_Dml
    table SYNONYM_DML created.
    1 rows inserted.
    1 rows inserted.
    PROCEDURE EXECUTE_SYNONYM_DML compiled
    PROCEDURE EXECUTE_SYNONYM_DML_TOO compiled
    anonymous block completed
    -- executing immediately INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100
    -- executing immediately INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200
    anonymous block completed
    -- executing DB_ID_100
    table SYNONYM_DML dropped.
    procedure EXECUTE_SYNONYM_DML dropped.

  • Use variables inside MovieClip names to call them in ASP 3.

    This line of code works fine for me:
    this.helpB1Btns.helpB1B3.alpha = 0.3;
    But I wonder how can I use variables instead of numbers ( 1 and 3 ) above??
    I mean for example:
    var i:int = 1;
    var j:int = 3;
    this["helpB"+i+"Btns.helpB"+i+"B"+j+".alpha"] = 0.3; //Error
    ["helpB"+i+"Btns.helpB"+i+"B"+j+".alpha"] = 0.3; //Error
    this["helpB"+i+"Btns"].["helpB"+i+"B"+j+".alpha"] = 0.3; //Error
    For instance, this code works fine:
    this["helpB"+i+"Btns"].alpha = 0.3;
    (this.helpB1Btns.alpha = 0.3;)
    But I have no idea to code this:
    this.helpB1Btns.helpB1B3.alpha = 0.3;
    I appreciate your help or any refference I could learn this fundamentally?
    yours,
      Ali

    ahhhhhhh......I was only one DOT wrong and trying different methods for HALF AN HOUR!! lol
    I wish Flash was more intelligent to correct such small mistakes!!
    Thank you SO MUCH for your reply

  • 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

  • Using variable as table name in pl/sql query - Is possible?

    I am relatively new to PL/SQL and I am trying to create a function that accepts a table name and a rowid as arguments and returns a comma-delimited record string of the values of the table/rowid being passed. The problem is , I cannot code a select stmt as follows
    SELECT * FROM v_table_name
    WHERE rowid = v_row_id
    in PL/SQL. There must be a easy way to approach this.
    Thanks for any and all advice.
    GC

    I don't understand the use of the concat symbol along with the commas and field namesYou just need (if you really need it) to create variable which contains you column separated by comma:
    Simple example (in the second case separate variables are used to create
    the list of columns):
    SQL> declare
      2   rc sys_refcursor;
      3   cols varchar2(200) := 'ename, empno, sal';
      4   tab varchar2(30) := 'emp';
      5  begin
      6   open rc for 'select ' || cols || ' from ' || tab;
      7   close rc;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2   rc sys_refcursor;
      3 
      4   ename_col varchar2(10) := 'ename';
      5 
      6   empno_col varchar2(10) := 'empno';
      7 
      8   sal_col varchar2(10) := 'sal';
      9 
    10   tab varchar2(30) := 'emp';
    11 
    12  begin
    13 
    14   open rc for 'select ' || ename_col || ',' || empno_col || ',' || sal_col ||
    15   ' from ' || tab;
    16 
    17   close rc;
    18  end;
    19  /
    PL/SQL procedure successfully completed.Rgds.

  • Use variable for symbol name

    I am trying to reference a symbol element that looks like this:
    elementName = variableName + "Menu";
    var menuChoice = sym.getSymbol('printMenu').$(elementName);
    when I console.log ("menuChoice" + menuChoice) I get
    object Object
    How do I accomplish using a variable as a symbol name?

    Yes. I have a function that does a number of things so I am not looking to rewrite the menu Symbol.

  • How can we use variables for instance name?

    I'm using 9 textbox in my stage. Names are similar, only difference is the last character. (s1_0, s1_1, s1_2, ...). I'm trying to use these textbox in a loop. But I couldn't find the right typing... s1_[i], s1_(i) or s1_{i} gives error.
      s1_0.text=0
      s1_1.text=0
      s1_2.text=0
      s1_3.text=0
      s1_4.text=0
      s1_5.text=0
      s1_6.text=0
      s1_7.text=0
    how can make the shortest typing for this issue?

    yes, its working, thank you very much...
    I tried array operator but the word "this"..
    what does it means ? when I delete this word, it gives error. how does flash know that it is a instance name?

  • Any way to limit memory which XSLT processor uses?

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - ProductionWe use the xmltype.transform method to transform XSLT. We got oodles of memory (25Gb assigned to Oracle) but we do use a lot of that......
    Is there a way to limit the amount of memory that the XSLT engine uses so as to avoid out of memory errors?
    Errors in file /ora/oracle/diag/rdbms/prod01/PROD01/trace/PROD01_j001_16149.trc:
    ORA-27102: out of memory
    Linux-x86_64 Error: 12: Cannot allocate memoryThe XML file was just under 20Gb in size. I regularly see 10Gb xslt transformations using around 2Gb ram (via the top command on linux). I have no visibility to what the memory consumption was the time of the failure.

    Probably most of the heavy consumption is PGA related.
    http://docs.oracle.com/cd/B28359_01/server.111/b28274/memory.htm#i49320
    Have a look at the AWR history views concerning memory consumption. ADDM, ASH, AWR etc should give you more insight. See also the awr/addm/ash/-rpt.sql scripts in $ORACLE_HOME/rdbms/admin on the database server. You (officially) would need Diagnostic en Tuning pack licenses though, so be warned (even for "touching" those views). Probably the heavy consumption of memory is or (wrong) storage related or inefficient code...

  • Change Filename using XSLT mapping without variable subtitution

    Hi,
    My scenario is IDOC to file...i am using XSLT mapping, i want to change the filename format to OUT_<Purchase Number>_<DDMMYYYYhhmmss>_KKKK.txt, i cannot use UDF function as i do XSLT mapping i also i cannot use variable substitution as the target structure doesn't have PO and timestamp as tag elements. Can i acheive using writing a adapter module? I appreciate if anyone could help me with this..
    Many thanks

    >
    Ravibabu Adari wrote:
    > Hi,
    > If i go with Option1: what changes i need to do in the file adapter to tell the adapter to pick the filename from XSLT ?
    > If i go with Option2: To which element to the target structure should i map the filename using UDF ? do i have to add additional element to the target structure? what changes i need to do in the file adapter to tell the adapter to pick the filename from Message mapping ?
    >
    > Many thanks
    Hi,
         in both cases you need to enable file adapter specific properties and enable the file name...
    for this you need to use the dynamic configuration properties for the same...
    usage of this option using udf in message mapping is rather easy than to use in XSLT...for this you dont need to change the structure in the message mapping...message mapping is just needed for execution of the udf.. thats it..
    HTH
    Rajesh

  • XSLT-ABAP using Call Transformation

    Hello Friends,
    I am new to this XSLT-ABAP transformation. I went through the blogs and forums and got a fair bit of idea on this. Now, i am trying to create a simple program/ xslt transformation to test the scenario. Once this is successfull i need to implement this in our project.
    I am not sure, where and what i am doing wrong. Kindly check the below given XSLT/ XML/ ABAP Program and correct me.
    My XML File looks as given below:
      <?xml version="1.0" encoding="utf-8" ?>
    - <List>
    - <ITEM>
      <ITEMQUALF>ITEM1</ITEMQUALF>
      <MATERIAL>MAT1</MATERIAL>
      </ITEM>
    - <ITEM>
      <ITEMQUALF>ITEM2</ITEMQUALF>
      <MATERIAL>MAT2</MATERIAL>
      </ITEM>
    - <ITEM>
      <ITEMQUALF>ITEM3</ITEMQUALF>
      <MATERIAL>MAT3</MATERIAL>
      </ITEM>
      </List>
    My XSLT Transformation looks as given below:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="*">
        <List>
          <xsl:for-each select="ITEM">
            <xsl:element name="ITEM">
              <xsl:element name="ITEMQUALF">
                <xsl:value-of select="ITEMQUALF"/>
              </xsl:element>
              <xsl:element name="MATERIAL">
                <xsl:value-of select="MATERIAL"/>
              </xsl:element>
            </xsl:element>
          </xsl:for-each>
        </List>
      </xsl:template>
    </xsl:transform>
    My ABAP program looks as below:
    REPORT  ztest_ram.
    TYPES:
      BEGIN OF ty_test,
        itemqualf TYPE char10,
        material  TYPE char10,
      END OF ty_test,
      ty_t_test TYPE STANDARD TABLE OF ty_test.
    DATA:
      l_xml       TYPE REF TO cl_xml_document,
      t_test      TYPE ty_t_test,
      wa_person   TYPE LINE OF ty_t_test,
      t_xml_out   TYPE string,
      v_retcode   TYPE sy-subrc,
      v_totalsize TYPE i.
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    * Create object
    CREATE OBJECT l_xml.
    * Call method to import data from file
    CALL METHOD l_xml->import_from_file
      EXPORTING
        filename = 'C:\xml\xml_test.xml'
      RECEIVING
        retcode  = v_retcode.
    * Call method to Render into string
    CALL METHOD l_xml->render_2_string
      IMPORTING
        retcode = v_retcode
        stream  = t_xml_out
        size    = v_totalsize.
    * Call Transformation
    TRY.
        CALL TRANSFORMATION (`ZXSLT_RAM`)
                SOURCE XML t_xml_out
                RESULT     outtab = t_test.
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    When i run this ABAP program to fetch the data from XML in to Internal table, i get the error message:
    Incorrect element List for XML-ABAP transformation
    I am really not sure how to proceed further. Could any one help me on this?
    Note: Please do not paste the same links, as i have gone through most of them.
    Thank you.
    Best Regards,
    Ram.

    UPDATE, works now.
    ABAP:
    method IF_HTTP_EXTENSION~HANDLE_REQUEST.
    *THIS METHOD IS AN HTTP INTERFACE FOR A
    *SICF WEB SERVICE HANDLER. IT RECEIVES AN XML PAYLOAD,
    *READS IT INTO AN XSTRING, THEN TRANSFORMS THE
    *XSTRING INTO ABAP DATA USING AN ABAP XSLT
    *TRANSFORMATION PROGRAM
    *Process incoming xml Request
         data: lxs_request TYPE xstring.
         lxs_request = server->request->get_data( ).
    *BUILD DATA TYPES
    TYPES: BEGIN OF ccw_line,
       field11 TYPE STRING,
       field22 TYPE STRING,
       END OF ccw_line.
    TYPES: BEGIN OF ccw_head,
       field1 TYPE STRING,
       field2 TYPE STRING,
       lines TYPE STANDARD TABLE OF ccw_line WITH DEFAULT KEY,
       END OF ccw_head.
    DATA: ccw_heads type STANDARD TABLE OF ccw_head,
           xccw_heads TYPE ccw_head.
    DATA: ccw_lines TYPE STANDARD TABLE OF ccw_line,
           zccw_lines TYPE ccw_line.
    DATA: lr_transformation_error TYPE REF TO cx_transformation_error.
    DATA: err_text TYPE string.
    *CALL TRANSFORMATION
    TRY.
       CALL TRANSFORMATION zccwpayload_prg
       SOURCE XML lxs_request
       RESULT OUTPUT = ccw_heads.   "RESULT PARAMETER ("OUTPUT") NAME MUST EQUAL TRANSFORMED XML ROOT eg <OUTPUT>XML DATA...</OUTPUT>
    * RESULT XML my_xml_result.    "THIS CAN BE USED IF YOU WANT TO RETURN XML INSTEAD OF ABAP DATA
       CATCH cx_xslt_exception INTO lr_transformation_error.
       err_text = lr_transformation_error->get_text( ).
       server->response->set_cdata( err_text ).
    ENDTRY.
    *SAVE TO DATABASE
    *BUILD RESPONSE
    call METHOD server->response->set_cdata
         EXPORTING
             DATA = err_text.
    endmethod.
    XML SOURCE:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <HEADS> <!--MATCH ON THIS IN XSLT!!!-->
          <HEAD><!-- FOR-EACH ON THIS-->
                <headval1>myHeader</headval1>
                <LINES>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                </LINES>
          </HEAD>
          <HEAD>
                <headval1>myHeader</headval1>
                <LINES>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                </LINES>
          </HEAD>
          <HEAD>
                <headval1>myHeader</headval1>
                <LINES>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                      <Line>
                            <lineval1>myLine</lineval1>
                      </Line>
                </LINES>
          </HEAD>
    </HEADS>
    XSLT PROGRAM:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
       <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
       <xsl:template match="/HEADS"><!--This should be the root name of your source XML eg <HEADS>xml data...</HEADS> if you don't have a single root match on "/" -->
         <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
           <asx:values>
             <OUTPUT><!--MUST be all caps, MUST match CALL TRANSFORMATION RESULTS parameter name (RESULTS OUTPUT = myABAPDataStructure), and MUST not contain an underscore!!!-->
               <xsl:for-each select="HEAD">
                 <HEAD>            <!--ALL CAPS!!!-->
                   <FIELD1>
                     <xsl:value-of select="headval1"/>
                   </FIELD1>
                   <FIELD2>
                     <xsl:value-of select="headval1"/>
                   </FIELD2>
                   <LINES>
                     <xsl:for-each select="LINES/Line">
                       <LINE>
                         <FIELD11>
                           <xsl:value-of select="lineval1"/>
                         </FIELD11>
                         <FIELD22>
                           <xsl:value-of select="lineval1"/>
                         </FIELD22>
                       </LINE>
                     </xsl:for-each>
                   </LINES>
                 </HEAD>
               </xsl:for-each>
             </OUTPUT>
           </asx:values>
         </asx:abap>
       </xsl:template>
    </xsl:transform>
    SAMPLE OF TRANSFORMED XML (MATCHES ABAP DATA STRUCTURE):
    IF YOU TEST () YOUR TRANSFORMATION (IN XSLT_TOOL) WITH THE SAMPLE FILE AND IT DOESN'T LOOK LIKE THIS, YOUR TRANSFORMATION WILL FAIL. TAGS MUST BE ALL CAPS!!!!
    <?xml version="1.0" encoding="UTF-8"?>
    <asx:abap version = "1.0" xmlns:asx = "http://www.sap.com/abapxml">
          <asx:values>
                <OUTPUT>
                      <HEAD>
                            <FIELD1>myHeader</FIELD1>
                            <FIELD2>myHeader</FIELD2>
                            <LINES>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                            </LINES>
                      </HEAD>
                      <HEAD>
                            <FIELD1>myHeader</FIELD1>
                            <FIELD2>myHeader</FIELD2>
                            <LINES>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                            </LINES>
                      </HEAD>
                      <HEAD>
                            <FIELD1>myHeader</FIELD1>
                            <FIELD2>myHeader</FIELD2>
                            <LINES>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                                  <LINE>
                                        <FIELD11>myLine</FIELD11>
                                        <FIELD22>myLine</FIELD22>
                                  </LINE>
                            </LINES>
                      </HEAD>
                </OUTPUT>
          </asx:values>
    </asx:abap>

  • XSLT Transformation error:  Non-canonical structure of element name

    Good day experts,
    I have recently started using xslt, and came upon the following demo in the sdn.
    http://wiki.sdn.sap.com/wiki/display/ABAP/XMLXSLTwith+ABAP
    I have retrieved the example xml files from airplus.com, as per the instructions, and implemented the code.
    When I test the xslt transformation in se80, it transforms correctly.
    However, when I run the program, I get the following error.
    CX_XSLT_FORMAT_ERROR
    Transformation error:  Non-canonical structure of element name XML_OUTPUT   
    Is there an error in the example that I am not aware of?
    Thanks in advance,
    Johan Kriek

    Found the solution.
    You rename the tag <XML_OUTPUT> to anything else like <TEST>. And Hurray!!! it works.
    It looks like SAP is using this name internally somewhere so we are getting error when we are using same name.
    Anyways the problem is solved.
    Regards,
    Jai

  • SPSiteDataQuery - filter by file Title - Can I use variable for the filter value?

    I use SPsiteDataQuery to search across multiple lists and filter by file title. I have the file title information in a variable.
    Can I use variable in the filter value?
    string fileName = "Policies.doc"
    SPSiteDataQuery spQry = new SPSiteDataQuery();
    spQry.ViewFields = "<FieldRef Name='Title'/><Value Type='Text'>fileName</Value>"

    If I have understood correctly, you want to search based upon a File title in all the sites. You can include a query to filename in the spQry
    spQry.Query = "<Where>" +
    "<Eq>" +
    "<FieldRef Name=\"FileLeafRef\"/>" +
    "<Value Type=\"Text\">" + fileName + "</Value>" +
    "</Eq>" +
    "</Where>";
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • Using variable with the same name as field name?

    I have a complex proc where I have variables with the same name as field name used on a query. something like this:
    SELECT a.id_table WHERE a.id_table = id_table
    where the last id_table is a parameter sent to the proc:
    declare procedure myproc(id_table int)
    Is there any way or notation to declare the variable inside the query as a variable or I have to use a different name?

    Well, variables are not the only thing you have to change if you want to switch to Oracle.
    Although I don't think it is good practice (to use variable name same as column name), here is one example how you can achieve it using EXECUTE IMMEDIATE and bind variable
    SQL> select deptno, count(1)
      2  from scott.emp
      3  group by deptno;
        DEPTNO   COUNT(1)
            30          6
            20          5
    10 3
    SQL> set serveroutput on
    SQL> declare
      2  deptno varchar2(10);
      3  i number;
      4  begin
      5  deptno:=10;
      6  execute immediate
      7  'select count(1) from scott.emp where deptno=:deptno' into i using deptno;
      8  dbms_output.put_line('OUT ---> '||i);
      9  end;
    10  /
    OUT ---> 3
    PL/SQL procedure successfully completed.
    SQL> Message was edited by:
    tekicora
    Message was edited by:
    tekicora

  • Using variables in the title of the graph

    Hi Gurus,
    I would like to use - for example a presentation- variable in the title of a graph.
    I assign a value for that variable in dashboard prompt.
    Does anybody know the syntax of using variable in the title of a graph
    (Not in a Title view!)
    Thanks in advance .
    Regards
    Laszlo

    You can reference presentation variables in the following areas :
    Title Views
    Narrative Views
    Column Filters
    Column Formulas
    Conditional Formatting conditions
    Chart scale markers.
    Gauge range settings.
    Static text.
    Direct Database Requests
    Dashboard prompts
    iBot Headlines and text

Maybe you are looking for