XSLT transformation for Single XML Output

I want to save a book to a single XML document. Is it correct that I can do this by adding an xslt to merge the standard framemaker entity type output ? Can I easily reconfigure the standard Save As XML to acheive this? or do I need to add a new menu item and call the XSLT dialogue...
any advice appreciated.
Thanks!

Tracey,
   A related discussion appeared in the FrameSGML Yahoo group recently. Much of what follows is what I wrote there.
   Your XML application (defined in structapps.fm or another application definition file) can specify an XSLT post-process. No need to change Save as XML or define a new menu item. Depending on what you want, the XSLT transform can be as simple as the following:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/ | node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>
</xsl:transform>
This is an identity transform that simply copies the interpreted input to the output. I've used the word "interpreted" here because XSLT does not distinguish among some variations of how content is entered. In particular, it does not distinguish between content in referenced general entities (which is what you want) or between attribute values that happen to be the same as the attribute default value and attributes that are not explicitly specified and hence use the default value.
There are a few things to watch out for involving use of general entities.
First, if you are using entity attributes for graphics, you'll need to modify the above slightly. It's probably easier to replace the entity attributes with file attributes, but if you want to keep the entities, the above needs to be extended to declare the entities.
Second, if you are using and want to preserve entity references for special characters or variables, you'll need to account for them as well. See $FMHOME\Structure\xml\PreserveEntity\readme.pdf.
    --Lynne

Similar Messages

  • XSLT transformation for deep structure .....

    Hello,
            I am trying to do an XSLT transformation for a deep structure HAP_S_PDF_DOCUMENT (see it in SE11), I have managed to achieve this. but not with perfection. i still get some redundant data and data have been experiencing Data duplication. I was hoping if you people point out the what is wrong in the transfromation. The data repeats for every once under node DATA and then under node of the refered structure name. Besides it also create a blank row even if the record is 0. I am mostly facing problem with nodes T_ELEMENTS. T_COL_CELL and T_FIELD. These are the nested structures, Can anybody help / guide me to achieve these transforamtion?
    <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="HAP_DOCUMENT">
    <xsl:element name="HAP_DOCUMENT" namespace="">
    <xsl:apply-templates select="MAIN_HEADER"/>
    <xsl:apply-templates select="T_ELEMENTS"/>
    <xsl:apply-templates select="T_STAT_CHG_BUTTONS"/>
    <xsl:apply-templates select="S_APPRAISAL_ID"/>
    <xsl:apply-templates select="S_HEADER"/>
    <xsl:apply-templates select="POSITIONS"/>
    <xsl:element name="STAT_CHG_BUTTON">
    <xsl:value-of select="../STAT_CHG_BUTTON"/>
    </xsl:element>
    <xsl:element name="OFFLINE_ID">
    <xsl:value-of select="OFFLINE_ID"/>
    </xsl:element>
    <xsl:element name="BSP_FLAG">
    <xsl:value-of select="BSP_FLAG"/>
    </xsl:element>
    <xsl:element name="ROLE">
    <xsl:value-of select="ROLE"/>
    </xsl:element>
    <xsl:element name="APPRAISAL_YEAR">
    <xsl:value-of select="APPRAISAL_YEAR"/>
    </xsl:element>
    </xsl:element>
    </xsl:template>
    <xsl:template match="MAIN_HEADER">
    <xsl:element name="MAIN_HEADER">
    <xsl:for-each select="ZBGAPR_FORM_HEADER">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_ELEMENTS">
    <xsl:element name="T_ELEMENTS">
    <xsl:for-each select="ZHAP_S_PDF_ELEMENTS">
    <xsl:element name="DATA">
    <xsl:apply-templates select="T_COL_CELL"/>
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_COL_CELL">
    <xsl:element name="T_COL_CELL">
    <xsl:for-each select="ZHAP_S_PDF_COL_CELL">
    <xsl:element name="DATA">
    <xsl:apply-templates select="T_FIELD"/>
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_FIELD">
    <xsl:element name="T_FIELD">
    <xsl:for-each select="ZHAP_S_PDF_FIELD">
    <xsl:element name="DATA">
    <xsl:apply-templates select="T_VAL_VALUES"/>
    <xsl:apply-templates select="T_VAL_RANGES"/>
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_VAL_VALUES">
    <xsl:element name="T_VAL_VALUES">
    <xsl:for-each select="HAP_S_BODY_CELL_VAL_VALUES">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_VAL_RANGES">
    <xsl:element name="T_VAL_RANGES">
    <xsl:for-each select="HAP_S_BODY_CELL_VAL_RANGES">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_STAT_CHG_BUTTONS">
    <xsl:element name="T_STAT_CHG_BUTTONS">
    <xsl:for-each select="HAP_S_BODY_CELL_VAL_RANGES">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_APPRAISAL_ID">
    <xsl:element name="S_APPRAISAL_ID">
    <xsl:copy-of select="node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_HEADER">
    <xsl:element name="S_HEADER">
    <xsl:apply-templates select="S_TEXTS"/>
    <xsl:apply-templates select="T_APPRAISER"/>
    <xsl:apply-templates select="T_APPRAISEE"/>
    <xsl:apply-templates select="T_PART_APPRAISER"/>
    <xsl:apply-templates select="T_OTHERS"/>
    <xsl:apply-templates select="S_STATUS"/>
    <xsl:apply-templates select="S_DATES"/>
    <xsl:apply-templates select="S_DISPLAY"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="POSITIONS">
    <xsl:element name="POSITION">
    <xsl:for-each select="ZBGHR_APR_POSITION_DET">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_TEXTS">
    <xsl:element name="S_TEXTS">
    <xsl:copy-of select="node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_APPRAISER">
    <xsl:element name="T_APPRAISER">
    <xsl:for-each select="HAP_S_PDF_APPRAISER">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_APPRAISEE">
    <xsl:element name="T_APPRAISEE">
    <xsl:for-each select="HAP_S_PDF_APPRAISEE">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_OTHERS">
    <xsl:element name="T_OTHERS">
    <xsl:for-each select="HAP_S_PDF_OTHERS">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_PART_APPRAISER">
    <xsl:element name="T_PART_APPRAISER">
    <xsl:for-each select="HAP_S_PDF_PART_APPRAISERS">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="T_PART_APPRAISER">
    <xsl:element name="T_PART_APPRAISER">
    <xsl:for-each select="HAP_S_PDF_PART_APPRAISERS">
    <xsl:element name="DATA">
    <xsl:copy-of select="child::node()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_STATUS">
    <xsl:element name="S_STATUS">
    <xsl:copy-of select="node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_DATES">
    <xsl:element name="S_DATES">
    <xsl:copy-of select="node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="S_DISPLAY">
    <xsl:element name="S_DISPLAY">
    <xsl:copy-of select="node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="STAT_CHG_BUTTON">
    </xsl:template>
      <xsl:template match="OFFLINE_ID">
    </xsl:template>
      <xsl:template match="BSP_FLAG">
    </xsl:template>
      <xsl:template match="ROLE">
    </xsl:template>
      <xsl:template match="APPRAISAL_YEAR">
    </xsl:template>
    </xsl:transform>
    Regards,
    Shishir.P

    "XSLT transformation for a deep structure"
    which way abap to xml or xml to abap?
    you may want to check this thread
    Re: Problem converting XML back to structure using XSLT

  • BI Admin Tool and XSLT transformation for XML data source - How it works ?

    Hello,
    There is a possibility to import data from XML data source using BI Admin Tool.
    In the import window we can point XSLT file. What is the purpose of that XSLT field?
    Why I am asking ?
    I thought it is smth like XSLT processor, but simply it doesnt work.
    What I did:
    - I pointed XML data source file
    - I pointed XSLT transformation file
    - Click OK, and still get the message that the XML file structure is not supported
    After that I transformed that XML file with some desktop XSLT processor using the same XSLT file, and I tried to connect that file directly using BI Admin tool.Then it works. So it means that the transformation is ok.
    So basically one question comes to my mind in that situation:
    What is the purpose of XSLT field in BI Admin Tool when it comes to XML data source ?
    (it doesnt look like XSLT processor)
    Greetings
    /Michal

    Hi Mariano
    Why you need to use XSLT for transforming XML file into ABAP table
    Code is a part of some ABAP report. Looks like it is reading a file from file system and updating table after transformation
    If you have requirement like you need to read XML file and then insert the data into a SAP table
    You can use
    File to RFC
    File to Proxy scenario using SAP PI.
    Please provide more inputs on requirement to help
    Thanks
    Gaurav

  • XSLT transformation for XML to ABAP internal table

    Hi, can anyone please tell me how it should be the xslt tranformation to conver this xml
    <Embargos_ARBA_DOC>
         <ns:Embargos_ARBA_MT
              xmlns:ns="un:swissmedical:sap:proxy:embargos_arba:file">
              <Embargos_ARBA_MT>
                   <FECHA>20081101</FECHA>
                   <CUIT>50000002124</CUIT>
                   <MONTO>0000013794090</MONTO>
                   <RAZON_SOCIAL>RAUL ARMANDO CUNQUEIRO S.A.C.I.</RAZON_SOCIAL>
              </Embargos_ARBA_MT>
              <Embargos_ARBA_MT>
                   <FECHA>20081101</FECHA>
                   <CUIT>55000001456</CUIT>
                   <MONTO>0000001144410</MONTO>
                   <RAZON_SOCIAL>PARODI ESTEBAN ARMANDO</RAZON_SOCIAL>
              </Embargos_ARBA_MT>
         </ns:Embargos_ARBA_MT>
    </Embargos_ARBA_DOC>
    to this abap Table....
      DATA: BEGIN OF i_embargos_arba_doc occurs 0,
              fecha TYPE d,
              cuit TYPE char11,
              monto TYPE char13,
              razon_social(120),
            END OF i_embargos_arba_mt.
    so i can transform it with this sentence
          CALL TRANSFORMATION ('embargos_transformation')
            SOURCE XML source
            RESULT Embargos_ARBA_DOC = embargos.
    pls i need help because i am unable to create this xslt transformation...
    I will give the highest rewards points to the one who can help me.
    thanks!
    mariano

    Hi Mariano
    Why you need to use XSLT for transforming XML file into ABAP table
    Code is a part of some ABAP report. Looks like it is reading a file from file system and updating table after transformation
    If you have requirement like you need to read XML file and then insert the data into a SAP table
    You can use
    File to RFC
    File to Proxy scenario using SAP PI.
    Please provide more inputs on requirement to help
    Thanks
    Gaurav

  • Error in Java Mapping for Single XML conversion

    We are working on ABAP Proxy --> SAP PI 7.1 --> SOAP (Synchronous Scenario).
    (ECC -> PI -> Legacy CRM)
    Client has provided a WSDL with Single Node of XML and asking us to pass the whole structure as an single string along with all the nodes of data structure. To perform mapping we are using Java Mapping.
    Message which we are getting after Java Mapping:
    Input
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject">
       <ITEM>
          <sSlsOrderCode>1001</sSlsOrderCode>
          <sDlrCode>A250</sDlrCode>
          <sRejectReason>Z2</sRejectReason>
          <nCircleCode>2</nCircleCode>
       </ITEM>
    </ns0:MT_SOReject_Sender>
    Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"&gt;&lt;ITEM&gt;&lt;sSlsOrderCode&gt;1001&lt;/sSlsOrderCode&gt;&lt;sDlrCode&gt;A250&lt;/sDlrCode&gt;&lt;sRejectReason&gt;Insufficient Stock Balance&lt;/sRejectReason&gt;&lt;nCircleCode&gt;2&lt;/nCircleCode&gt;&lt;/ITEM&gt;&lt;/ns0:MT_SOReject_Sender&gt;</stringinp></MT_Trg>
    Is ther any way from which we can convert &gt; as u201C>u201D and &lt; as u201C<u201D.  Required result is as follows
    Required Output
    <?xml version="1.0" encoding="UTF-8"?><MT_Trg xmlns:ns="urn:Test_File_to_File"><stringinp><?xml version="1.0" encoding="UTF-8"?><ns0:MT_SOReject_Sender xmlns:ns0="http://MTSINDIA/TC/SalesOrderReject"><ITEM><sSlsOrderCode>1001</sSlsOrderCode><sDlrCode>A250</sDlrCode><sRejectReason>Insufficient Stock Balance</sRejectReason><nCircleCode>2</nCircleCode></ITEM></ns0:MT_SOReject_Sender></stringinp></MT_Trg>
    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
          * @author user
          * To change the template for this generated type comment go to
          * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
                    public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 //************************Code To Generate The XML Parsing Objects*****************************//    
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

    We are using following Java Code for the same.
    import java.io.BufferedReader;
              import java.io.FileInputStream;
              import java.io.FileOutputStream;
              import java.io.InputStream;
              import java.io.InputStreamReader;
              import java.io.OutputStream;
              import java.util.Map;
              import javax.xml.parsers.DocumentBuilder;
              import javax.xml.parsers.DocumentBuilderFactory;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.dom.DOMSource;
              import javax.xml.transform.stream.StreamResult;
              import org.w3c.dom.Element;
              import org.w3c.dom.Document;
              import org.w3c.dom.Text;
              import com.sap.aii.mapping.api.*;
              import com.sap.aii.mapping.api.StreamTransformation;
    public class SingleStr implements StreamTransformation{
               public static void main(String args[]) throws Exception {
                FileInputStream inFile =
                 new FileInputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Input.XML");
                FileOutputStream outFile =
                 new FileOutputStream("C:/Documents and Settings/user.HR0102WILT00033/Desktop/Output.XML");
                 SingleStr xml = new SingleStr();
                xml.execute(inFile, outFile);
                System.out.println("Success");
               public void setParameter(Map param) {
                Map map = param;
               public void execute(InputStream in, OutputStream out)
                throws com.sap.aii.mapping.api.StreamTransformationException {
                try {
                 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 TransformerFactory tf = TransformerFactory.newInstance();
                 Transformer transform = tf.newTransformer();
                 //Document doc = db.parse(in);
                 Document docout = db.newDocument();
                 Element root = docout.createElement("MT_Trg");
                 root.setAttribute("xmlns:ns","urn:Test_File_to_File");
                 docout.appendChild(root);
                 Element stringinp = docout.createElement("stringinp");
                 root.appendChild(stringinp);
                 BufferedReader inpxml = new BufferedReader(new InputStreamReader(in));
                 StringBuffer buffer = new StringBuffer();
                 String line="";
                 while ((line = inpxml.readLine()) != null)
                 buffer.append(line);
                 String inptxml=buffer.toString();
                 Text srcxml = docout.createTextNode(inptxml);
                 stringinp.appendChild(srcxml);
                 DOMSource domS = new DOMSource(docout);
                 transform.transform((domS), new StreamResult(out));
                 } catch (Exception e) {
                   System.out.print("Problem parsing the file: " + e.getMessage());
                   e.printStackTrace();
    Please help!!

  • Transform LiveCycle form xml output using xsl

    I've completed my first form but now want to format the xml that's generated.
    Whilst I work for a big Company, I don't think they'll stretch to purchasing the Reader Extensions Module so I can output as PDF. Also there will be more than 500 users completing the form, so I can't just extend the rights using Adobe Acrobat.
    Therefore, I'd like to transform the xml created using xsl (as I have knowledge in this area) - I'd like the transformation to occur when the form is submitted via email so that a 'friendly' attachment is added to the email and not the xml output.
    Any ideas on this one?

    First thing is, the fonts did not work in my system.. So I can not really understand where the email address fields are..
    Few things:
    1) You have used an Email submit button and tried to place the code in the MouseDown event.
        You need to change this button to "Regular Type Button". and place the code in the Click event to work.
    2) I placed a sample button and put in my code for your reference.. This is working fine..You can check the below sample.
    https://acrobat.com/#d=tQa4E*8aA*mJq6aijSHuDQ
    3) You can do the same way for your form..
    4) If you have Acrobat software, you can enable JavaScript debugger which can give you the specific error message rather than Submit cancelled. If you do not, then you need to put some messageBox statements and check..
    Thanks
    Srini

  • Easiest and/or best methods for generating XML output (not with a report)

    Hi, several of our EBS customers (11.5.10) are converting their PDF reports to use XML/BI publisher to produce output. The data stream comes from a report that generates the XML output, and then the XML template is applied. This works great ... no problems, etc. From what I have read, however, Oracle intends to treat the traditional Forms and Reports Developers as legacy tools (although still supporting them, of course).
    My question is if I wanted to ditch using Reports to generate XML output, what, in your opinion or in your current usage, is the easiest way of getting this data? In Reports, the data modeler is excellent in providing a method to write your queries, split them into different repeating groups, write formula and summary columns, link multiple queries, etc, etc. If one were to become Reports Developer free, what comparable tools are available to take its place? I would expect this tool to handle a mix of GUI and coding like the Reports data modeler. Please note that I'm not looking for an EBS-specific solution -- say for a custom application using regular Oracle 10g DB and iAS, with BI Publisher for reporting.
    Thanks for your feedback,
    Ryan

    What I'm looking for is to not use Oracle Reports to generate the XML data output since Oracle's statement of direction is pushing BI Publisher rather than Oracle Reports as the preferred tool for reporting. That said, the data modeler in Reports provides a very flexible tool to construct and link multiple queries and to manipulate the queries into several levels of a master/detail relationship. Further, the mix of GUI and coding makes setting up the data model a lot more efficient. What I'm looking for (and I don't know if anything exists) is something comparable that can be used to generate XML output from the DB -- the idea being that I wouldn't use legacy tools, like Reports, for this task. I hope that is clearer.
    Really, another way of answering my question is, aside from Reports and the APIs mentioned so far, what are my fellow developers using, if anything, to extract XML data in a way that handles the features i list above?

  • Creating Simple transformation for an XML data having deep structure

    Hi
    I have the following XML structure..
    <REQUESTS>
      <REQUESTNAME>REQ123</REQUESTNAME>
      <REQUESTID>1234</REQUESTID>
      <CITY>NEWYORK</CITY>
      <ZIPCODE>123456</ZIPCODE>
    <COMPETENCIES>
       <LANGUAGES>
         <COMPETENCY>
            <SKILL>SAP</SKILL>
            <PROFICIENCY>TEST</PROFICIENCY>
            <SKILL>JAVA</SKILL>
            <PROFICIENCY>TEST123</PROFICIENCY>
    (here we may have any number of records for SKILL&PROFICIENCY...)*
    </COMPETENCIES>
       </LANGUAGES>
         </COMPETENCY>
    </REQUESTS>
    My requirement is to read the above data from an URL and push it into an internal table.
    For this I'm trying to use Simple transformations but I'm facing difficulty in doing this.
    Can you pl. guide me how to create the transformation and the corresponding code for this.
    Best Regards
    Anil

    Hi
    Here is the actual XML structure..
    - <REQUEST>
      <COUNTRY />
      <ADDRESS />
      <CITY />
      <ASSIGNTYPE>IP</ASSIGNTYPE>
      <CHARGETYPE>CH</CHARGETYPE>
      <REMOTEALLOWED>Y</REMOTEALLOWED>
      <SALESRATE>EUR</SALESRATE>
      <SECURITY>NO</SECURITY>
      <TRAVELEXP>Y</TRAVELEXP>
      <MAXDAILYRATE />
      <CREDENTIALS />
      <EXPENDDATE />
      <NEWENDDATE />
      <NEWEXPENDDATE />
      <REPLYBEFORE>2010-11-30</REPLYBEFORE>
      <STARTDATE>2010-01-01</STARTDATE>
      <ENDDATE>2010-12-31</ENDDATE>
      <GCMTYPE>PM</GCMTYPE>
      <GCMLEVELFROM>02</GCMLEVELFROM>
      <GCMLEVELTO>08</GCMLEVELTO>
      <LOCATION>FR43</LOCATION>
      <MOBILITY>04</MOBILITY>
      <ZIPCODE />
    - <COMPETENCIES>
    - <LANGUAGES>
    - <COMPETENCY>
      <SKILL>01106034</SKILL>
      <PROFICIENCY>005103</PROFICIENCY>
      </COMPETENCY>
      </LANGUAGES>
    - <ACTIVITIES>
    - <COMPETENCY>
      <SKILL>01105500</SKILL>                            
      <PROFICIENCY>004507</PROFICIENCY>
      </COMPETENCY>
      </ACTIVITIES>
    - <BUSINESS>
    - <COMPETENCY>
      <SKILL>01105729</SKILL>
      <PROFICIENCY>004605</PROFICIENCY>
      </COMPETENCY>
      </BUSINESS>
    - <INDUSTRIES>
    - <COMPETENCY>
      <SKILL>01105491</SKILL>
      <PROFICIENCY>004901</PROFICIENCY>
      </COMPETENCY>
      </INDUSTRIES>
    - <METHODS>
    - <COMPETENCY>
      <SKILL>01105591</SKILL>
      <PROFICIENCY>004805</PROFICIENCY>
      </COMPETENCY>
      </METHODS>
    - <OFFERINGS>
    - <COMPETENCY>
      <SKILL>01105840</SKILL>
      <PROFICIENCY>005002</PROFICIENCY>
      </COMPETENCY>
      </OFFERINGS>
    - <PRODUCTS>
    - <COMPETENCY>
      <SKILL>01107304</SKILL>
      <PROFICIENCY>004703</PROFICIENCY>
      </COMPETENCY>
      </PRODUCTS>
      </COMPETENCIES>
      <CANDIDATES />
      </REQUEST>
    Here..... <SKILL></SKILL>   <PROFICIENCY></PROFICIENCY>  can be more than 1 entry...
    For this I have created a simple transformation like below..
    I have used the tcode 'XSLT_TOOL '..
    In SE11 I have created a Table type 'ZCOMPETENCIES' which is having  a line type 'ZLANGS'.
    ZLANGS is a structure which has another structure called 'ZCOMPETENCY' and this 'ZCOMPETENCY' is having fields
    SKILL & PROFICIENCY.
    I have used the wizard button which u can find  'XSLT_TOOL '.. and provided the table type ZCOMPETENCIES'  and it has automatically created the following transformation...
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
      <tt:root name="ROOT" type="?"/>
      <tt:root name="COMPETENCIES" type="ddic:ZCOMPETENCIES"/>
      <tt:template>
        <COMPETENCIES>
          <tt:loop ref=".COMPETENCIES">
            <ZLANGS>
              <COMPETENCY>
                <SKILL tt:value-ref="COMPETENCY.SKILL"/>
                <PROF tt:value-ref="COMPETENCY.PROF"/>
              </COMPETENCY>
            </ZLANGS>
          </tt:loop>
        </COMPETENCIES>
      </tt:template>
    </tt:transform>
    I have written following code to get the data
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    GET REFERENCE OF gt_person INTO gs_result_xml-value.
    gs_result_xml-name = 'COMPETENCIES'.
    APPEND gs_result_xml TO gt_result_xml.
    TRY.
        CALL TRANSFORMATION ZTEST_TRAN
        SOURCE XML gt_itab
        RESULT (gt_result_xml).
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    Please let me know if you need any further details..
    Best Regards
    Anil

  • XSLT Transformation ABAP to XML speacial treatment of empty elements

    Dear All,
    I have created a deep abap structure which basically reflects the structure of my XML file which I would like to generate later. I have created a transformation via transaction SE80->create XSLT Program. I am also using the ABAP command call transformation...
    I have made a few ammendments to my XSLT program where required.
    I am outputting data in a loop.
    But I got a problem with one field. I must check if this date field is initial.
    Which I did by using statement:
    <xsl:if test="ENDDATE='0000-00-00'">
    But if this field is initial I have to output the following tag:
    <ENDDATE ReasonForNull="9"></ENDDATE>
    Hence I defined an attribute below in my element as follows:
       <xsl:for-each select="INSTANCE/_-PIQGB_-INSTANCE_XML">
    <xsl:if test="ENDDATE='0000-00-00'">
       <xsl:element name="ENDDATE">
           <xsl:attribute name="ReasonForNull"/>  
        </xsl:element>
    </xsl:if>
       </xsl:for-each>
    Which generates now the output as follows and is quitwe close to the desired output:
    <ENDDATE ReasonForNull=""></ENDDATE>
    Can anybody make a suggestion how I can generate the desired output.
    I assume that I would have to assign a value to the attribute to get the right output. But I got no idea how I could this in the loop.
    Many thanks in advance.
    Rainer

    Hello Rainer
    The solution is quite simple. See the example below.
    " Sample XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="../tmp_EDI_ZZ_tests/Untitled2.xsl"?>
    <INVOIC02>
        <INSTANCE>
            <ENDDATE>2008-07-31</ENDDATE>
        </INSTANCE>
        <INSTANCE>
            <ENDDATE>0000-00-00</ENDDATE>
        </INSTANCE>
    </INVOIC02>
    " Stylesheet:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:output encoding="ISO-8859-1" method="xml" indent="yes"/>
        <xsl:template match="/*">
            <xsl:for-each select="INSTANCE">
                <xsl:choose>
                    <xsl:when test="ENDDATE='0000-00-00' ">
                        <xsl:element name="ENDDATE">
                            <xsl:attribute name="ReasonForNull">
                                <xsl:value-of select=" '9' "/>   " Set value for attribute !!!
                            </xsl:attribute>
                        </xsl:element>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:copy-of select="node()"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
        </xsl:template>
    </xsl:stylesheet>
    " Result of transformation:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ENDDATE>2008-07-31</ENDDATE>
    <ENDDATE ReasonForNull="9"/>
    Regards
      Uwe

  • How to perform an xslt transformation on an xml document dynamically ?

    Hi all,
    I'd like to perform an xslt tranformation on a dynamically generated xml code. I'm looking for a tag which can by useful for it. The tag should take both xml code and xslt code, passed as String arguments (not as names of xml and xslt files). I tried to use xtags library and jstl:transform tag but it did not work. It worked only with plain xml code passed to x-tag. When I try to perform a transformation on a tag body containing an output text tag, the transformation formats only this tag, not its content.
    For example:
    <xtags:style xslt="xslName.xsl">
    <h:outputText value="#{beanName.stringPropertyName}"/>
    </xtags:style>
    Thanks in advance
    Message was edited by:
    opad

    The issue is in the logic f your XSL mapping.
    Use the same source XML and use it with XML Spy to debug why it is not working as you want it to.
    Regards
    Bhavesh

  • Dynamic XSLT Transformation for ABAP

    Hi Team,
    I have a simple requirement, but could not get it to work. Tried different posts but need some help.
    I have an input XML file as follows:
    <ITEM>
       <ITEMQUALF>
       <MATERIAL>
       <UPC>
       <VENDORMATERIAL>
    <ITEM>
    I created my internal table with the exact fields as above and created a transformation which works fine. The problem is, there are scenario's where only one tag "MATERIAL", "UPC", OR "VENDORMATERIAL" is passed in the input XML. Empty tags are not passed. For E.G.
    <ITEM>
      <ITEMQUALF>
      <UPC>
    <ITEM>
    My transformation fails in this scenario because it does not finds the MATERIAL and VENDORMATERIAL tags. I tried using the <tt:cond/> tag, but no luck. I have some specific questions:
    1) How to take care of this scenario where empty tags are not passed? (I have the Superset of all the Tags available in an XSD). A quick Sample would help me a lot because I have spent weeks breaking my head with this.
    2) Is there any other method or Option to parse a very larger input file (~40 MB) as above? I have seen the iXML ABAP methods but don't know if we should use XSLT or iXML or is there any other method. We don't have XI in our landscape. Our system is ECC 6.0, ABAP 7.0 - SP 17, Enhancement Pack 3.
    Any pointers would help a lot. Thanks for your time.
    Regards
    Sanjay

    Hello Sanjay
    In such a scenario I usually make pre-transformation filling the missing elements before the main mapping.
    Input:
    <?xml version="1.0" encoding="utf-8"?>
    <List>
      <ITEM>
        <ITEMQUALF/>
        <MATERIAL/>
        <UPC/>
        <VENDORMATERIAL/>
      </ITEM>
      <ITEM>
        <ITEMQUALF/>
        <UPC/>
      </ITEM>
      <ITEM>
        <MATERIAL/>
      </ITEM>
    </List>
    XSLT Mapping (XML to XML):
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <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 name="UPC">
                            <xsl:value-of select="UPC"/>   
                        </xsl:element>
                        <xsl:element name="VENDORMATERIAL">
                            <xsl:value-of select="VENDORMATERIAL"/>   
                        </xsl:element>
                    </xsl:element>
                </xsl:for-each>
            </List>
        </xsl:template>
    </xsl:stylesheet>
    Resulting XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <List>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
        <ITEM>
            <ITEMQUALF/>
            <MATERIAL/>
            <UPC/>
            <VENDORMATERIAL/>
        </ITEM>
    </List>
    Regards
      Uwe

  • Exception in creating XSLT transform for ESB Routing Service

    Hi,
    I am trying to create a Routing service in an ESB project. When I try to create the XSLT in a routing rule I get this error "Error while reading wsdl file esb:///ESB_projects/...../ship.wsdl ... Failed to read WSDL file at location esb:///ESB_projects/...../ship.wsdl . java.net.Socket Exception.
    I am able to create and register other adapter/soap services on the ESB server but not able to create this transform.Could anybody guide me as to how to resolve this?
    Regards,
    Sri

    The file doesn't physically exist on the server. If you explore the subfolders of the %OH%\integration\esb\oraesb folder, you'll see how ESB projects are deployed.

  • XSLT and XML - Splitting out address data for a single XML item?

    Hi,
    I am currently having to change my XSLT code for processing XML feeds from the NHS because the technolgy has been moved from SOAP-based to RESTful (both of which mean very little to me!).  While most of the XML feeds display correctly I have been unable to resolve the following:
    The address data seems to be located under a single item <s.addressLine> rather than <address1>, <address2> <address3> <address4> as in the previous setup.  As a consequence of this I am unable to split out my address data into seperate address fields (in column 2 below).  The code below ....
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s="http://syndication.nhschoices.nhs.uk/services">
    <xsl:output method="html" encoding="UTF-8"/>
    <xsl:template match="/">
    <table class="xslt_table">
      <tr>
        <th>1</th>
        <th>2</th>
        <th>3</th>
      </tr>
      <xsl:for-each select="atom:feed/atom:entry">
        <tr>
          <td><xsl:value-of select="atom:content/s:organisationSummary/s:name"/></td>
          <td><xsl:value-of select="atom:content/s:organisationSummary/s:address"/></td>
          <td><xsl:value-of select="atom:content/s:organisationSummary/s:address/s:addressLine"/></td>
        </tr>
      </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>
    ....generates the following result:
    1
    2
    3
    Royal Eye Infirmary
    Apsley RoadPlymouthDevonPL4 6PL
    Apsley Road
    Mount Gould Hospital
    Mount Gould RoadPlymouthDevonPL4 7QD
    Mount Gould Road
    Scott Hospital
    Beacon Park RoadPlymouthDevonPL2 2PQ
    Beacon Park Road
    Peninsula NHS Treatment Centre
    20 Brest RoadPlymouthDevonPL6 5XP
    20 Brest Road
    Derriford Hospital
    Derriford RoadCrownhillPlymouthDevonPL6 8DH
    Derriford Road
    Nuffield Health, Plymouth Hospital
    Derriford RoadPlymouthDevonPL6 8BG
    Derriford Road
    Plympton Hospital
    Market RoadPlymouthDevonPL7 1QR
    Market Road
    St Barnabas Hospital
    Higher Port ViewSaltashCornwallPL12 4BU
    Higher Port View
    Liskeard Community Hospital
    Clemo RoadLiskeardCornwallPL14 3XD
    Clemo Road
    I would be very, very grateful for any thoughts and suggestions on what I might be able to do to resolve this.
    Best wishes
    Simon

    Thanks dvohra
    But in my servlet, I already have the transformer factory defined as follows
    public class JDOMServlet extends HttpServlet {
         private TransformerFactory tFactory = TransformerFactory.newInstance();
         private ResultSet rs = null;
         private StreamSource xsltSource;
         private Templates template;
         public void init(ServletConfig config) throws ServletException {
              super.init(config);
              ServletContext ctx = config.getServletContext();
              try {
                   //Want to cache the stylesheet for future resuse
                   //then it doesnt have to be loaded constantly
                   URL xslURL = ctx.getResource("/WEB-INF/viewStudentDetails.xsl");
                   System.out.println(xslURL);
                   xsltSource = new StreamSource(new java.net.URL(xslURL.toString()).openStream());
                   //xsltSource = new StreamSource(ctx.getResourceAsStream("/Web-inf/viewStudentDetails.xsl"));
                   template = tFactory.newTemplates(xsltSource);
              catch (Exception e) {
                   e.printStackTrace();
    I think the key point is that, this transformation servlet worked fine, when all it was outputting was the xml data, styled in a table. As soon as I enter more table info, (i.e. for the banner and navigation bar), the null pointer exception pops up.
    ....a lost and puzzled jase....
    Thanks again.
    JS

  • UTF-8 encoding in XSLT transformation

    Hello,
    I have a problem with a transformation of an ABAP structure into XML. I use the XSLT transformation for this.
    My XSLT starts like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:strip-space elements="*"/>
      <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
        <asx:values>
    I tried many settings I could find posted on the internet, but I did not find one that would allow encoding to UTF-8.
    It always encodes to iso-8859-1 which my interface partner cannot read.
    Does anyone know a way to force encoding to UTF-8?
    Adding a command like <xsl:output encoding="utf-8"/> did not help.
    Thanks a lot!
           J. Euler

    Hello!
    I think I just solved the problem taking a different approach.
    In a note here on SDN, a guy from SAP wrote, that the SAP XSLT processor is not able to code anything but the system's default to a string, BUT that it is able to code it to an xstring.
    All I did now is add the tag  
    <xsl:output encoding="utf-8" indent="yes" method="xml"/>
    to my xslt program and change the coding in the program accordingly.
    The program code is now:
      DATA: tempxstring TYPE xstring,
            temp_length TYPE i,
            conv      TYPE REF TO cl_abap_conv_in_ce.
      CLEAR tempxstring.
      TRY.
          CALL TRANSFORMATION
              zxxje_tst_xslt
            SOURCE omsregdatawebservice = wa_data
            RESULT XML tempxstring.
        CATCH cx_sy_conversion_base64.
        CATCH cx_sy_conv_illegal_date_time.
      ENDTRY.
      IF tempxstring IS NOT INITIAL.
        CLEAR: conv, temp_length, string_xml_result.
        conv = cl_abap_conv_in_ce=>create( input = tempxstring ).
        conv->read( IMPORTING data = string_xml_result len = temp_length ).
      ENDIF.
    Thanks anyways for all your help!
    regards,
          Johannes Euler

  • Xml output/input

    Can anyone recommend an xliff editor i can use for the xml output from adobe captivate?

    Hello,
    Do you want to edit XML files exported from Adobe Captivate and import them again ?
    Any specific reason for which  you want to edit exported XML files from Adobe Captivate ?
    Thanks,
    Vikram

Maybe you are looking for

  • Customer Aging Report

    Hi all, Our client requires aging report for a customer in the following format Customer Code,Name,0-30 Days,31-60 days,61-90 days, 91-120 days,121-150 days,151-180 days,180 + above days,Row Total (all days). Condition:  By Aging date Thanks Jeyakant

  • How to get Inventory -Finished Goods Values Plant wise in Balance Sheet

    Hi, 1. Customer is using same finsihed goods material for plant 1100 and plant 1900 2. But the want to see 2 differant lines in balance sheet for inventory finished product. 3. For this can i create 2 diffferant valuation classes and 2 differant GL a

  • Retrieve all class in a package

    Hi, Is there a method to retrieve all name of the class in a package, to recreate the tree of the class use in my prog I can just retrieve all the packages with Package.getPackages() and a sorting function. the Next step is : Package package = Packag

  • V_T7XSSSERRES view does not exist

    Hi gurus, I had a problem on the page links in the Job&Career section on our portal system after the ess configuration. I wrote it to OSS and in the reply he sent me the solution. In the solution he tells me update a field in the view called  V_T7XSS

  • How to define a customized MessageFactory.java?

    Hello, I want create my own MessageFactory.java class instead of using the existing JSF one. Is there anyway I could define this class somewhere in configuration file (like struts-config.xml for MessageResourcesFactory) and use it directly? Thank you