XSLT Transformation from XML to CVS format

I am using the following xsl sheet in conjunction with the XSLSample.java application delivered with xdk and cannot get the output I desire. Does Orcales xsl processor output text documents?
XSL:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="ROWSET/ROWS[1]/*" mode="elementNames"/>
<xsl:apply-templates select="ROWSET/ROWS"/>
</xsl:template>
<xsl:template match="*" mode="elementNames">
<xsl:value-of select="name()"/>
<xsl:choose>
<xsl:when test="position() != last()">,</xsl:when>
<xsl:otherwise>
<xsl:text>&#xa;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ROW">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*">
<xsl:if test="contains(.,' ')">"</xsl:if>
<xsl:value-of select="."/>
<xsl:if test="contains(.,' ')">"</xsl:if>
<xsl:choose>
<xsl:when test="position() != last()">,</xsl:when>
<xsl:otherwise>
<xsl:text>&#xa;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
XML:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<CUST_ID>1000000009</CUST_ID>
<NAME1>Pineview Preschool</NAME1>
<ITEM>0000000007</ITEM>
<POST_DATE>01/02/2001</POST_DATE>
<ENTRY_TYPE>PY</ENTRY_TYPE>
<DOCUMENT> </DOCUMENT>
</ROW>
<ROW num="2">
<CUST_ID>1000000006</CUST_ID>
<NAME1>Cellular One</NAME1>
<ITEM>0000000008</ITEM>
<POST_DATE>01/02/2001</POST_DATE>
<ENTRY_TYPE>PY</ENTRY_TYPE>
<DOCUMENT> </DOCUMENT>
</ROW>
</ROWSET>
Any help for this xsl beginner would be greatly appreciated.
null

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
The problem is likely that you are incorrectly using:
[b]DocumentFragment processXSL(xsl,xml)
instead of the other API:
void processXSL(xsl,xml,PrintWriter)
the latter allows the XSLT engine to do its <xsl:output> serialization behavior. The former does not.<HR></BLOCKQUOTE>
Thanks Steve,
I am now doing that. How can I get rid of the top level xml tag that prints out after applying the xsl sheet. I need a simple text file with just the data.
Thanks,
Jeff
null

Similar Messages

  • XSLT Transformation from XML to ABAP  field

    Hi all,
    How can I retrieve my XML node's value (EMPLOYEE) XML to an ABAP variable (W_KUNNR)
      DATA w_kunnr TYPE string.
      CONCATENATE
        '<services>'
        '<Myservice>'
        '<APPLICATION>APPLI1</APPLICATION>'
        '<SERVICE>SERV1</SERVICE>'
        '<TOSAP>'
        '<EMPLOYEE>00000036</EMPLOYEE>'
        '</TOSAP>'
        '</Myservice>'
        '</services>'
      INTO request.
      CALL TRANSFORMATION z_trans
      SOURCE XML request
      RESULT kunnr = w_kunnr.
    thanks.
    Edited by: Noureddine MOUTAA on Oct 28, 2008 2:25 PM

    I did like this:
    <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>
            <KUNNR>
              <xsl:value-of select="//services/Myservice/TOSAP/EMPLOYEE"/>
            </KUNNR>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>

  • 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

  • XSLT transformation in XML to ABAP: special characters issue

    Hi,
    I am parsing well-formed XML file that has the following data (:
    <projects><project><name>Wallis &amp; Futuna</name></project></projects>
    I use XSLT transformation:
    <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="projects">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
            <PROJECTS>
              <xsl:for-each select="project">
                <PROJECT>
                  <NAME>
                    <xsl:value-of select="name"/>
                  </NAME>
                </PROJECT>
              </xsl:for-each>
            </PROJECTS>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    If I use the above example without &amp;amp; everything works fine, but the original XML fails with exception CX_XSLT_DESERIALIZATION_ERROR and message "Error during deserialization". Googling around did not give an answer.
    Any words of wisdom?
    Edited by: Alexei Isaev on Apr 26, 2011 5:04 AM
    Edited by: Alexei Isaev on Apr 26, 2011 5:05 AM

    Hi,
    Please visit the following link for reference.
    http://help.sap.com/abapdocu_70/en/ABAPCALL_TRANSFORMATION.htm
    Thanks & Regards,
    Harish

  • Writing XSLT to perform transformation from XML to ABAP

    Hi,
    I've been struggling quite a bit with XSLT. I read several old discussions regarding transformations using ST and XSLT but I haven't been able to solve my problem.
    I have a requirement to build a program to convert XML to an internal table.
    I've been able to do it for smaller XMLs, but whenever I try to apply the same logic to a bigger XML it simply just doesn't work. I'm almost certain it has something to do with the way I wrote the XSLT but I haven't been able to figure out what.
    The XML I have to read from goes something like this:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    -<AuditFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
         -<Header xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
              <AuditFileVersion>1.02_01</AuditFileVersion>
                   <CompanyID>50002</CompanyID>
                   <TaxRegistrationNumber>5000</TaxRegistrationNumber>
                   <TaxAccountingBasis>F</TaxAccountingBasis>
                   <CompanyName>Company</CompanyName>
                   <BusinessName>Business</BusinessName>
                   -<CompanyAddress>
                        <AddressDetail>Address</AddressDetail>
                        <City>city</City>
                        <PostalCode>333333</PostalCode>
                        <Country>PT</Country>
                   </CompanyAddress>
                   <FiscalYear>2013</FiscalYear>
                   <StartDate>2013-07-01</StartDate>
                   <EndDate>2013-07-31</EndDate>
                   <CurrencyCode>EUR</CurrencyCode>
                   <DateCreated>2013-08-02</DateCreated>
                   <TaxEntity>Global</TaxEntity>
                   <ProductCompanyTaxID>00</ProductCompanyTaxID>
                   <SoftwareCertificateNumber>00</SoftwareCertificateNumber>
                   <ProductID>product</ProductID>
                   <ProductVersion>00</ProductVersion>
                  <Email>email@com</Email>
                   <Website>www.s.pt</Website>
         </Header>
         -<MasterFiles xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
              -<Customer>
                   <CustomerID>1</CustomerID>
                   <AccountID>ID</AccountID>
                   <CustomerTaxID>999999990</CustomerTaxID>
                   <CompanyName>Desconhecido</CompanyName>
                   -<BillingAddress>
                        <AddressDetail>Desconhecido</AddressDetail>
                        <City>Desconhecido</City>
                        <PostalCode>0000-000</PostalCode>
                        <Country>PT</Country>
                   </BillingAddress>
                   <SelfBillingIndicator>0</SelfBillingIndicator>
              </Customer>
              -<Customer>
                   <CustomerID>2</CustomerID>
                   <AccountID>Desconhecido</AccountID>
                   <CustomerTaxID>571</CustomerTaxID>
                   <CompanyName>Company</CompanyName>
                   -<BillingAddress>
                        <AddressDetail>detail</AddressDetail>
                        <City>city</City>
                        <PostalCode>0000-000</PostalCode>
                       <Country>PT</Country>
               </BillingAddress>
              <SelfBillingIndicator>0</SelfBillingIndicator>
         </Customer>
    ...and so on
    And the XSLT I've written so far is something like this:
    <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>
             <ICUSTOMER>
               <xsl:apply-templates select="//Customer"/>
             </ICUSTOMER>
           </asx:values>
         </asx:abap>
       </xsl:template>
       <xsl:template match="Customer">
         <item>
           <CUSTOMER_ID>
             <xsl:value-of select="CustomerID"/>
           </CUSTOMER_ID>
           <ACCOUNT_ID>
             <xsl:value-of select="AccountID"/>
           </ACCOUNT_ID>
           <CUSTOMERTAX_ID>
             <xsl:value-of select="CustomerTaxID"/>
           </CUSTOMERTAX_ID>
           <COMPANYNAME>
             <xsl:value-of select="CompanyName"/>
           </COMPANYNAME>
           <ADDRESSDETAIL>
             <xsl:value-of select="BillingAddress/AddressDetail"/>
           </ADDRESSDETAIL>
           <CITY>
             <xsl:value-of select="BillingAddress/City"/>
           </CITY>
            <POSTALCODE>
             <xsl:value-of select="BillingAddress/PostalCode"/>
           </POSTALCODE>
            <COUNTRY>
             <xsl:value-of select="BillingAddress/Country"/>
           </COUNTRY>
           <SELFBILLINGINDICATOR>
             <xsl:value-of select="SelfBillingIndicator"/>
           </SELFBILLINGINDICATOR>
         </item>
       </xsl:template>
    </xsl:transform>
    Like I said, I'm almost certain that the problem is with the XSLT, as it returns an empty table / ALV. I've used this method before and it worked...
    Any thoughts?
    Thank you

    Hello Goncalo,
    I think, there are two problems:
    1) The xmlns declaration within your xml is a problem for the SAP XSLT Processor.
    2) I have written a similar XSLT-report, which performs directly with your data. Perhaps this is not necessary if 1) is solved:
    <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="AuditFile">
         <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
           <asx:values>
              <xsl:apply-templates select="MasterFiles"/>
           </asx:values>
         </asx:abap>
       </xsl:template>
       <xsl:template match="MasterFiles">
             <ICUSTOMER>
               <xsl:apply-templates select="./Customer"/>
             </ICUSTOMER>
       </xsl:template>
       <xsl:template match="Customer">
           <CUSTOMER_ID>
             <xsl:value-of select="CustomerID"/>
           </CUSTOMER_ID>
           <ACCOUNT_ID>
             <xsl:value-of select="AccountID"/>
           </ACCOUNT_ID>
           <CUSTOMERTAX_ID>
             <xsl:value-of select="CustomerTaxID"/>
           </CUSTOMERTAX_ID>
       </xsl:template>
    </xsl:transform>
    Kind regards,
    Hendrik

  • Problem writing a XSLT to convert XML in desired format from a table having self join

    Hello,
    I have to write a style sheet to convert XML generated from XSQL into a different format. The query that I have is as follows.
    select LEVEL depth,
    'H' || hierarchy_id id,
    name,
    nvl2(parent_id, 'H' || parent_id, 0) parent_id,
    CURSOR(select LEVEL depth,
    'H' || hierarchy_id hid,
    name hname,
    nvl2(parent_id, 'H' || parent_id, 0) hparent_id,
    decode(system_id, NULL, '0', 'S' || system_id) formatted_system_id,
    system_id
    from hierarchy
    where parent_id = h.hierarchy_id
    and system_id is not null
    ) as systems
    from hierarchy h
    where system_id is null
    start with parent_id is null
    connect by prior hierarchy_id = parent_id
    The hierarchy table has a self join to itself. The selfjoin is on the hierarchyid and the parentid fields which is evident from the query.
    Here the hierarchy table contains the parent system and also the child systems underneath. The problem is that the no. of levels that it can go deep is not fixed. The output of this in sqlplus is as follows.
    Depth Hierarchyid, name parentid
    1 h1 xxx <null>
    2 h2 bbb h1
    3 h3 ccc h2
    <Cursor for systems>
    hid hname hparentid formatted_system_id systemid
    h4 ccc h2 s1 1
    h5 ccc h2 s2 2
    <Back to original data>
    Depth Hierarchyid, name parentid
    2 h6 ddd h1
    2 h7 eee h1
    The desired output required from the stylesheet is as follows
    <h id=h1 name=xxx>
    <h id=h2 name=bbb parentid=h1>
    <h id=h3 name=ccc parentid=h2>
    <h id=h4 name=fff parentid=h3 systemid=s1>
    <h id=h5 name=ggg parentid=h3 systemid=s2>
    </h>
    </h>
    <h id=h6 name=ddd parentid=h1/>
    <h id=h7 name=eee parentid=h1/>
    </h>
    Could some one guide me as to how to get this. I did write a stylesheet which gives me the following output.
    <h id=h1 name=xxx>
    <h id=h2 name=bbb parentid=h1/>
    <h id=h3 name=ccc parentid=h2/>
    <h id=h4 name=fff parentid=h3 systemid=s1>
    <h id=h5 name=ggg parentid=h3 systemid=s2>
    </h>
    <h id=h6 name=ddd parentid=h1/>
    <h id=h7 name=eee parentid=h1/>
    </h>
    As you can see I am missing the closing of the tag on the 7th line in the desired format. I have written the following stylesheet.
    <!-- Hierarchy.xsl: Transform ROWSET/ROW format to the required Hierarchy format. -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="node()|@*">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <!-- Template for matching the rowset..... -->
    <xsl:template match="HIERARCHY">
    <HIERARCHY><xsl:apply-templates/></HIERARCHY>
    </xsl:template>
    <!-- Template for matching the row .... -->
    <xsl:template match="HELEMENT">
    <xsl:choose>
    <xsl:when test="PARENT_ID=0">
    <helement id="{ID}" name="{NAME}" parentid="{PARENT_ID}"/>
    </xsl:when>
    <xsl:when test="PARENT_ID!='0'">
    <helement2 id="{ID}" name="{NAME}" parentid="{PARENT_ID}">
    <xsl:for-each select="SYSTEMS/SYSTEMS_ROW">
    <helement3 id="{HID}" name="{HNAME}" parentid="{HPARENT_ID}" systemid="{FORMATTED_SYSTEM_ID}">
    </helement3>
    </xsl:for-each>
    </helement2>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Is there any way of achieving this. Any help would be appreciated. I am using XSQL to generate first the basic XML output and then applying stylesheet to achieve the desired output.
    Sincerely,
    D

    Hello,
    I have to write a style sheet to convert XML generated from XSQL into a different format. The query that I have is as follows.
    select LEVEL depth,
    'H' || hierarchy_id id,
    name,
    nvl2(parent_id, 'H' || parent_id, 0) parent_id,
    CURSOR(select LEVEL depth,
    'H' || hierarchy_id hid,
    name hname,
    nvl2(parent_id, 'H' || parent_id, 0) hparent_id,
    decode(system_id, NULL, '0', 'S' || system_id) formatted_system_id,
    system_id
    from hierarchy
    where parent_id = h.hierarchy_id
    and system_id is not null
    ) as systems
    from hierarchy h
    where system_id is null
    start with parent_id is null
    connect by prior hierarchy_id = parent_id
    The hierarchy table has a self join to itself. The selfjoin is on the hierarchyid and the parentid fields which is evident from the query.
    Here the hierarchy table contains the parent system and also the child systems underneath. The problem is that the no. of levels that it can go deep is not fixed. The output of this in sqlplus is as follows.
    Depth Hierarchyid, name parentid
    1 h1 xxx <null>
    2 h2 bbb h1
    3 h3 ccc h2
    <Cursor for systems>
    hid hname hparentid formatted_system_id systemid
    h4 ccc h2 s1 1
    h5 ccc h2 s2 2
    <Back to original data>
    Depth Hierarchyid, name parentid
    2 h6 ddd h1
    2 h7 eee h1
    The desired output required from the stylesheet is as follows
    <h id=h1 name=xxx>
    <h id=h2 name=bbb parentid=h1>
    <h id=h3 name=ccc parentid=h2>
    <h id=h4 name=fff parentid=h3 systemid=s1>
    <h id=h5 name=ggg parentid=h3 systemid=s2>
    </h>
    </h>
    <h id=h6 name=ddd parentid=h1/>
    <h id=h7 name=eee parentid=h1/>
    </h>
    Could some one guide me as to how to get this. I did write a stylesheet which gives me the following output.
    <h id=h1 name=xxx>
    <h id=h2 name=bbb parentid=h1/>
    <h id=h3 name=ccc parentid=h2/>
    <h id=h4 name=fff parentid=h3 systemid=s1>
    <h id=h5 name=ggg parentid=h3 systemid=s2>
    </h>
    <h id=h6 name=ddd parentid=h1/>
    <h id=h7 name=eee parentid=h1/>
    </h>
    As you can see I am missing the closing of the tag on the 7th line in the desired format. I have written the following stylesheet.
    <!-- Hierarchy.xsl: Transform ROWSET/ROW format to the required Hierarchy format. -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="node()|@*">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <!-- Template for matching the rowset..... -->
    <xsl:template match="HIERARCHY">
    <HIERARCHY><xsl:apply-templates/></HIERARCHY>
    </xsl:template>
    <!-- Template for matching the row .... -->
    <xsl:template match="HELEMENT">
    <xsl:choose>
    <xsl:when test="PARENT_ID=0">
    <helement id="{ID}" name="{NAME}" parentid="{PARENT_ID}"/>
    </xsl:when>
    <xsl:when test="PARENT_ID!='0'">
    <helement2 id="{ID}" name="{NAME}" parentid="{PARENT_ID}">
    <xsl:for-each select="SYSTEMS/SYSTEMS_ROW">
    <helement3 id="{HID}" name="{HNAME}" parentid="{HPARENT_ID}" systemid="{FORMATTED_SYSTEM_ID}">
    </helement3>
    </xsl:for-each>
    </helement2>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Is there any way of achieving this. Any help would be appreciated. I am using XSQL to generate first the basic XML output and then applying stylesheet to achieve the desired output.
    Sincerely,
    D

  • How to use an .xsl file to transform input XML to re-formatted output XML?

    Hello,
    I have a .xml file from a report that I want to use a stylesheet to transform into a different .xml format.
    I am reading that I can create a .xsl file to read my input and then transform it to a new output .xml file.
    How do I load this into the Apps?
    I tried creating a template definition and loading the .xsl in as type 'XSL-TEXT' and also, I added
    <?xml-stylesheet type="text/xsl" href="Transform.xsl"?> to my xml data source. The output looked the same as the input.
    Has anyone done this before? Any suggestions would be great!
    Thanks
    -CC

    This is how I use e4x with HTTPService:
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var claimsXLC:XMLListCollection;
    private function claimsHandler(evt:ResultEvent):void{
        claimsXLC = new XMLListCollection(evt.result..claim as XMLList);
    XML data is being returned, but I use XMLList to create the XMLListCollection.
    If this post answers your question or helps, please mark it as such.

  • About transformation from xml to html

    Hello all, I have just learnt xml for a week.
    I am preparing to use servlet and Jsp to convert xml to html,
    but I wonder how to make the convertion.
    Since the xml source is not in well design,
    I would like to ask what does the suitable way to do.
    The xml source is about the typesetting in a page.
    <book> element indicate a book
    <page> - element indicate a page
    attribute:
    id - id of the page
    height - height of the page
    width - width of the page
    <area> element indicate a area
    attribute:
    pos - in the form of "x1, y1, x2, y2",
    (x-coordindate starting from left side of the page)
    (y coordinate starting form top side oft the page)
    <line> element indicate a line
    attribute:
    start - the x-coordinate, starting from left
    width - the width of the line
    <words> element indicate a word
    attribute:
    top - the y-coordinate, starting from top
    height - the height of the words
    all of them are defined as empty tag, except <book>
    example:
    <book>
         <page id=1 height=100, width=200/>
         <area pos"10,10,20,20"/>
         <line start=11 width=5/>
         <words top=11, height=5>
         word1
         <words top=16, height=2/>
         word2
         <page id=2 height=100, width=250/>
    </book>
    I would like to transfer page, area, line+words into 3 different of layer in html.
    I have try to use xslt style sheet (xsl),
    but I find difficulty getting information from element to form a layer and building up the template.
    For example, how can I get attributes info from two elements and generate a layer(html).
    Or, does it better to do the transformation in servlet and read the xml as a DOM tree?
    Furthermore, I would like to ask does it need much time to convert source to html,
    as there is nearly 4 thousand line in a xml file?
    Thanks!!

    Steve tks for Your suggestions, but my problem is a little different from the one You illustrate (or I didn't understand well Yur suggestion).
    1 - I don't use BC4J in this project
    2 - I don't need to insert data in the DB but only receive the data from an HTML form as a XML Document.
    I understand the idea You gave me would be a good basis for the solution but I don't understand how I can apply it.
    TIA
    Tullio

  • XSLT Transform in XML Signature: Exception

    Hello,
    I have following problem with an XSLT tranform in my XML signature. Here is the code I use to add XSLT to signature:
    main() {
    DOMStructure stylesheet = new DOMStructure( getStylesheet() );
    XSLTTransformParameterSpec spec = new XSLTTransformParameterSpec( stylesheet );
    transforms.add( fac.newTransform( Transform.XSLT, spec ) );
    private Element getStylesheet() throws Exception {
         String stylesheet = //"<?xml version=\"1.0\"?>" +
                        "<xslt:stylesheet version=\"1.0\" xmlns:xslt=\"http://www.w3.org/1999/XSL/Transform\">\n" +
                        " <xsl:include href=\"http://extern XSLT\" />\n" +
                        " <xslt:template match=\"/\">" +
                        " <xsl:apply-imports />" +
                        " </xslt:template>" +
                        "</xslt:stylesheet>\n";
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         //dbf.setValidating( true );
         return dbf.newDocumentBuilder().parse( new ByteArrayInputStream( stylesheet.getBytes() ) ).getDocumentElement();
    I get following exception:
    javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: com.sun.org.apache.xml.internal.security.transforms.TransformationException: Cannot find xslt:stylesheet in Transform
    Original Exception was com.sun.org.apache.xml.internal.security.transforms.TransformationException: Cannot find xslt:stylesheet in Transform
         at org.jcp.xml.dsig.internal.dom.DOMReference.transform(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown Source)
    In google I cannot find any details what can be wrong.
    Any suggestions?
    Thanks in advance,
    errno

    Thanks for your response. Sorry - I tried both versions with xslt and xsl - doesn't worked -> the error in my post is actually caused through the multiple changes of this part of code. Here once again:
    private Element getStylesheet() throws Exception {
              String stylesheet = //"<?xml version=\"1.0\"?>" +
                                       "<xslt:stylesheet version=\"1.0\" xmlns:xslt=\"http://www.w3.org/1999/XSL/Transform\">\n" +
                                       " <xslt:include href=\"external XSLTl\" />\n" +
                                       " <xslt:template match=\"/\">" +
                                       " <xslt:apply-imports />" +
                                       " </xslt:template>" +
                                       "</xslt:stylesheet>\n";
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              //dbf.setValidating( true );
              return dbf.newDocumentBuilder().parse( new ByteArrayInputStream( stylesheet.getBytes() ) ).getDocumentElement();
    Thanks,
    errno

  • XSLT transformation of XML string

    Hello Everyone,
    This is my first endeavor to use XSLT and XML in our newly upgraded system.  I can't for the life of me figure out what is wrong with my code and would appreciate someone just glancing over it and pointing out what is likely a realy dumb problem.
    I have a program that reads a PEXR2002 IDoc. For testing purposes, I've hardcoded that IDoc number. It runs fine, creates the XML fine, the xslt in STRANS tests fine as well...but in the end my ls_table is blank.  I've been fuddling with this for a while and would really appreciate another pair of eyes taking a look at it.
    THANKS!!
    Greg
    My program. (xslt is below...really simple, but it's my first time).
    TYPES: BEGIN OF ty_table,
            sndprn LIKE edidc-sndprn,
            bgmref TYPE edif1004_r,
            moabetr TYPE edif5004_a,
            credat TYPE edidat8,
            datum TYPE edidat8,
          END OF ty_table.
    DATA: o_idoc TYPE REF TO cl_idoc_xml1, str type string, ls_table type ty_table. 
    CREATE OBJECT o_idoc
      EXPORTING
        docnum = '0000000000211014'.
    CALL METHOD o_idoc->get_xmldata_as_string
      IMPORTING
        data_string = str.
    CALL TRANSFORMATION ZUSL_PEXR2002_V1
    SOURCE XML str
    RESULT HEADER_DATA = ls_table.
    My XSLT....
    <xsl:transform
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:asx="http://www.sap.com/abapxml"
        xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap version="1.0">
          <asx:values>
            <HEADER_DATA>
              <SNDPRN>
                <xsl:value-of select="PEXR2002/IDOC/EDI_DC40/SNDPRN"/>
              </SNDPRN>
              <BGMREF>
                <xsl:value-of select="PEXR2002/IDOC/E1IDKU1/BGMREF"/>
              </BGMREF>
              <MOABETR>
                <xsl:value-of select="PEXR2002/IDOC/E1IDKU5/MOABETR"/>
              </MOABETR>
              <CREDAT>
                <xsl:value-of select="PEXR2002/IDOC/EDI_DC40/CREDAT"/>
              </CREDAT>
              <DATUM>
                <xsl:value-of select="PEXR2002/IDOC/E1EDK03/DATUM"/>
              </DATUM>
            </HEADER_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>

    Hi Greg,
    please try it with the following (just slightly) modified transformation (works fine for me):
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:asx="http://www.sap.com/abapxml"
                   xmlns:sap="http://www.sap.com/sapxsl"
                   version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/PEXR2002/IDOC">
        <asx:abap version="1.0">
          <asx:values>
            <HEADER_DATA>
              <SNDPRN>
                <xsl:value-of select="EDI_DC40/SNDPRN"/>
              </SNDPRN>
              <BGMREF>
                <xsl:value-of select="E1IDKU1/BGMREF"/>
              </BGMREF>
              <MOABETR>
                <xsl:value-of select="E1IDKU5/MOABETR"/>
              </MOABETR>
              <CREDAT>
                <xsl:value-of select="EDI_DC40/CREDAT"/>
              </CREDAT>
              <DATUM>
                <xsl:value-of select="E1EDK03/DATUM"/>
              </DATUM>
            </HEADER_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    I recommend to test all transformations that you define on a sample source and check the output. If you apply your original transformation you would see that it basically doesn't select anything and therefore you just get an XML document with the field names but no values.
    Cheers, harald

  • Tuxedo Response Transformation from XML to FML

    Request flow :Tuxedo -> OSB Proxy Service > OSB Business Serivice >Target Web Service.
    Response flow : Target Web Service send response to -> Business Service ->OSB Proxy serivice (Transforma the Complex XML to FML) ->send to Tuxedo Client.
    i have following response form webserive call
    <StudentList>
    <Student universitytype="AU " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="AU " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="MIT" accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="AO " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <StudentList/>
    can i transform above complexity form of XML to FML using XmlFmlCnv Class and send it to Tuxedo
    Since FML is flat strucured, i am not sure how the Complex ty

    Hello,
    It depends on the release of WebLogic and the field table definitions used by WTC (and Tuxedo).
    I believe embedded/nested FML32 fields were added to XmlFmlCnv in WLS 9.0 (but the doc needs to be updated).
    Have you tried this yet?
    Regards,
    Bob Finan

  • How can i dynamically generate an xslt based an XML?

    i have an XML file,i've designed the displaying style.
    now,i wanna generate an xslt file from XML files that have different nodeNames.
    what to do?
    is there any JAVA API who can implement the idea?
    thanks to whom giving any hint:)

    ooooh, I see!
    you can achieve this with one single universal XSL:<?xml version="1.0" encoding="UTF-8"?>
    <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="text"/>
         <xsl:template match="query">
              <xsl:apply-templates select="result[1]/@*" mode="heading"/>
              <xsl:text disable-output-escaping="yes">&#13;</xsl:text>
              <xsl:apply-templates select="result" mode="value"/>
         </xsl:template>
         <xsl:template match="@*" mode="heading">
              <xsl:value-of select="local-name(.)"/>
              <xsl:text> </xsl:text>
         </xsl:template>
         <xsl:template match="result" mode="value">
              <xsl:apply-templates select="@*" mode="value"/>
              <xsl:text disable-output-escaping="yes">&#13;</xsl:text>
         </xsl:template>
         <xsl:template match="@*" mode="value">
              <xsl:value-of select="."/>
              <xsl:text> </xsl:text>
         </xsl:template>
    </xsl:stylesheet>fun stuff, nope?

  • Automatic insert of xmlns:xsl during XSLT transformation

    I am using the xmlparserv2.jar of dated "12/10/00" to perform a XSLT transformation. I need to insert a xml:space="preserve" attribute to a generated tag. However, there is an addition attribute added : xmlns:xml="http://www.w3/org/XML/1998/namespace". How can I suppress the generation of this attribute ?
    Here is my XML :
    <?xml version = '1.0' standalone = 'no'?>
    <COLDdoc>
    <Page template="bkgnd1" num="1">
    <Line num="1"> CN011A021C 1A021</Line>
    <Line num="2"> 1954.90 7713.36</Line>
    </Page>
    </COLDdoc>
    My XSL is :
    <?xml version = '1.0' standalone = 'yes'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="no" doctype-system="svg-20000303-stylable.dtd"/>
    <xsl:template match="Line">
    <text>
    <xsl:attribute name="x">0</xsl:attribute>
    <xsl:attribute name="y">
    <xsl:value-of select="@num*10"/>
    </xsl:attribute>
    <xsl:attribute name="xml:space">preserve</xsl:attribute>
    <xsl:value-of select="."/>
    </text>
    </xsl:template>
    </xsl:stylesheet>
    The result XSLT Transformation :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE text SYSTEM "svg-20000303-stylable.dtd">
    <text x="0" y="10" xmlns:xml="http://www.w3/org/XML/1998/namespace" xml:space="preserve"> CN011A021C 1A021</text>
    <text x="0" y="20" xmlns:xml="http://www.w3/org/XML/1998/namespace" xml:space="preserve"> "> 1954.90 7713.36</text>
    Regards.
    Jeffrey
    null

    Hi Greg,
    please try it with the following (just slightly) modified transformation (works fine for me):
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:asx="http://www.sap.com/abapxml"
                   xmlns:sap="http://www.sap.com/sapxsl"
                   version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/PEXR2002/IDOC">
        <asx:abap version="1.0">
          <asx:values>
            <HEADER_DATA>
              <SNDPRN>
                <xsl:value-of select="EDI_DC40/SNDPRN"/>
              </SNDPRN>
              <BGMREF>
                <xsl:value-of select="E1IDKU1/BGMREF"/>
              </BGMREF>
              <MOABETR>
                <xsl:value-of select="E1IDKU5/MOABETR"/>
              </MOABETR>
              <CREDAT>
                <xsl:value-of select="EDI_DC40/CREDAT"/>
              </CREDAT>
              <DATUM>
                <xsl:value-of select="E1EDK03/DATUM"/>
              </DATUM>
            </HEADER_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    I recommend to test all transformations that you define on a sample source and check the output. If you apply your original transformation you would see that it basically doesn't select anything and therefore you just get an XML document with the field names but no values.
    Cheers, harald

  • Where is XSLT Transformation located

    I am trying to do an XSLT Transformation, but I have no idea where to look for this - the only area with a note about where to find this tool is to select Foundation - XSLT Transformation, but I don't have that option - I found File, New, Process, Category = Foundation, but I never find any reference to XSLT Transformation.  Any suggestions would be helpful.

    XSLT Transformation is a service under the category of Foundation.  You can drag it from the Services panel onto your process OR drag on an Activity and type XSLT in the find field.   Choose the XSLT-Transformation from the Foundation category

Maybe you are looking for

  • DB Monitoring

    Hi all, We are looking to buy a software to monitor the database, I'm aware of the Quest Foglight and Grid Control. Are there any other db monitoring tools that you can suggest we shoud try? Thanks a lot.

  • Fusion Middlewar Enterprise Manager & RDBMS Security Store

    Hello, when using a weblogic soa domain configured with the realm to use RDBMS Security Store or adding a new SQLAuthProvider into the realm, the Fusion Middleware Enterprise manager does not show status of servers and deployed components anymore. Ev

  • Send from Color back to FCP

    At the point of sending color corrected files back to FCP from Color a window entitled "Send To Sequence Option" come up with the message: "Change graded Final Cut Pro sequence to match the Quicktime export codec?" I'm using Apple Intermediate Codec

  • Importing  UI java classes in model project

    Dear All, Am using Jdeveloper 11.1.1.3 , I have a java class under UI and am trying to call this java class from the implementation class for an entity ... can i do that or this is not supported ? Thanks for all,

  • PPM Mass deletion

    Hi Guys, When i run /SAPAPO/PPM_DEL - Mass Deletion of Plans and PPMs  i am getting the result PPM number and name usage ,order and locked status ,system it is not deleting the PPM . Pl help me to delete the PPM in mass through background job. Regard