XSLT help to transform an XML

I need help writing and XSLT to transform an XML in InDesign.  I am new to XML and have no idea how to write an XSLT.
We are trying to bring in data from a database using a query language that is having trouble creating the image tags the way we need it to.  Basically, I need to take this:
<Project href="file://C:\My test phot.jpg">
and transform it into this:
<Project> <image href="file://C:\My test phot.jpg" />
Can anyone help me with this?
Thanks!

Not sure I can help you with this, as my understanding of XSL is very limited.
However, as a matter of trial and error, I find that if I transform this XML:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
     <Project href="file://C:\My test phot1.jpg">The first bit of textual content here</Project>
     <Project href="file://C:\My test phot2.jpg">The second bit of textual content here</Project>
     <Project href="file://C:\My test phot3.jpg">The third bit of textual content here</Project>
     <Project href="file://C:\My test phot4.jpg">The fourth bit of textual content here</Project>
     <Project href="file://C:\My test phot5.jpg">The fifth bit of textual content here</Project>
</Root>
...with this XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/">
     <Root>
         <xsl:for-each select="/Root/Project">
           <Project>
             <image><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute></image>
             <xsl:value-of select="."/>
           </Project>
         </xsl:for-each>
     </Root>
   </xsl:template>
</xsl:stylesheet>
...I end up with this XML:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Project><image href="file://C:\My test phot1.jpg"/>The first bit of textual content here</Project>
<Project><image href="file://C:\My test phot2.jpg"/>The second bit of textual content here</Project>
<Project><image href="file://C:\My test phot3.jpg"/>The third bit of textual content here</Project>
<Project><image href="file://C:\My test phot4.jpg"/>The fourth bit of textual content here</Project>
<Project><image href="file://C:\My test phot5.jpg"/>The fifth bit of textual content here</Project>
</Root>
...which seems what you're looking for.
[I edited the original solution slightly by removing a wildcard.]

Similar Messages

  • 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

  • Default XSLT Stylesheet to transform BW XML Data?

    I'm currently working on a deafult XSLT Stylesheet to convert a BW XML Query Result Set into an html grid.
    [code]
    <!--
    #==========================================================================
    XSL Transformation that displays
    Template Properties, List of Data Providers and List of Items
    #==========================================================================
    -->
    <xml id="xsl_transform_1">
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="header">
    <tr bgcolor="white"> <xsl:for-each select="//RRWS_SX_TUPLE[1]/*">
      <td>
      <xsl:value-of select="local-name()"/>
      </td>
    </xsl:for-each>
    </tr>
    </xsl:variable>
    <xsl:template match="/">
    <table bgcolor="gold" border="1">
    TESTVALUE -
    <tr>
      <xsl:copy-of select="$header" /> <xsl:apply-templates />
    </tr>
    <xsl:for-each select="//RRWS_SX_TUPLE">
          <tr>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
              <xsl:for-each select="//RRWS_S_CELL">           
              <td><xsl:value-of select="CELL_ORDINAL"></td>
              </xsl:for-each>
            <td><xsl:value-of select="TUPLE_ORDINAL"/></td>
            <td><xsl:value-of select="CHANM"/></td>
            <td><xsl:value-of select="CAPTION"/></td>
            <td><xsl:value-of select="CHAVL"/></td>
            <td><xsl:value-of select="CHAVL_EXT"/></td>
            <td><xsl:value-of select="NIOBJNM"/></td>
            <td><xsl:value-of select="TLEVEL"/></td>
            <td><xsl:value-of select="DRILLSTATE"/></td>
            <td><xsl:value-of select="OPT"/></td>
            <td><xsl:value-of select="SIGN"/></td>                    
            <td><xsl:value-of select="ATTRIBUTES"/></td>     
          </tr>
    <xsl:for-each select="//RRWS_S_CELL">
         <tr>     
            <td><xsl:value-of select="CELL_ORDINAL"/></td> 
            <td><xsl:value-of select="VALUE"/></td>            
            <td><xsl:value-of select="FORMATTED_VALUE"/></td> 
            <td><xsl:value-of select="VALUE_TYPE"/></td> 
            <td><xsl:value-of select="CURRENCY"/></td> 
            <td><xsl:value-of select="UNIT"/></td> 
            <td><xsl:value-of select="MWKZ"/></td> 
            <td><xsl:value-of select="NUM_SCALE"/></td> 
            <td><xsl:value-of select="NUM_PREC"/></td> 
            <td><xsl:value-of select="CELL_STATUS"/></td> 
            <td><xsl:value-of select="BACK_COLOR"/></td> 
         </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    <xsl:template match="RRWS_S_CELL/*">
    <td> <xsl:value-of select="." /> </td>
    </xsl:template></xsl:stylesheet>
    </xml>
    [/code]
    I've started this, but I need to join the top tree with the bottom. Right now I'm just flattening the tree. Does anyone know if any work has been done in this area? I'm looking to create these XSLT Transforms. Also, I'd like to create generic javascript functions that I can use as an include, such as
    function join_BW_Table(table1, table2, fieldtojoin, typeofjoin)
    This would allow anyone to generically combine BW Data from multiple sources all on the FrontEnd and render it all as an html table. My ultimate goal would be have all this in includes and available for all BW Reporting. Anyone have any thoughts on:
    1. Has this been done before?
    2. If it hasn't, anyone have comments on how I can combine the 2 tables that I'm rendering with the attached XSLT transform?
    I'm running these transforms via a javscript function on the load of the html page.
    Prakash

    Prakash,
    did you ever compile the Stylesheet?  I am looking for an alternative way to format the pre-compiled XML file from the Report Designer.  The more complex my report is, the less robust the application becomes.
    Your insight would be greatly appreciated.
    Thank you

  • 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 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 1:1 transformation?

    Communication: asynchronous between SPROXY => XI => 3rd Party Webervice.
    I've huge XML response with a lot of tags. I just want to have on SPROXY 1:1 response. I've imported from XSD structure of response. I've created message types and message interfaces. I need now to create message mappings between 3rd_party_response and sproxy_response. As I wrote XML has a huge tags (c.a. different 500 tags). Creating those mapping manually is a madness. How can I do this automatically? I guess I can use for that XSLT transformation. Do you have maybe and example of XSLT 1:1 transformation or maybe there is a simplier solution?
    Helping answers => a lot of points

    Hello ,
    You can go with XSLT....
    follow these links,
    Follow these links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
    Some scenarios
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    *************8Reward points,if found useful

  • XSLT and non-well formed XML file

    All,
    I am getting some "XML" feeds from some old lab equipment, however the XML isn't well formed.  Really it isn't even XML it is just a formatted text file.  So I will get a feed like the following:
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:20 PM" />
    <CarbonAvg Label="Carbon Avg." Value="116 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002301 1" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 11:46 AM" />
    <CarbonAvg Label="Carbon Avg." Value="43.5 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002302 2" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 11:53 AM" />
    <CarbonAvg Label="Carbon Avg." Value="44.4 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002303 3" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:00 PM" />
    <CarbonAvg Label="Carbon Avg." Value="42.6 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002322 1" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:07 PM" />
    <CarbonAvg Label="Carbon Avg." Value="32.3 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002323 2" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:14 PM" />
    <CarbonAvg Label="Carbon Avg." Value="35.8 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="2015002324 3" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:27 PM" />
    <CarbonAvg Label="Carbon Avg." Value="32.4 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:33 PM" />
    <CarbonAvg Label="Carbon Avg." Value="123 ppm" />
    </SampleSet>
    As you can see, this isn't well formed and when I try to process this via XSLT I run into all kinds of problems.  So outside of writting a program to watch for files, picking them up with a c# program, wrapping the XML to make it well formed then pass
    it to the XSLT file, is there a way that I can wrap the file using XSLT instead of having to create a separate program to make it well formed? Any help is appreciated.

    Hello katghoti,
    >>however the XML isn't well formed.  Really it isn't even XML it is just a formatted text file
    Firstly, we should know that a text file actually does not know a XML format, so I suggest that you could save the text file to a XML file. And if you provided XML is the whole content, it is not an invalid XML file because the XML document must have one
    and only one root element. You have to add root element, so a valid XML file with these SampleSet elements should be similar with below:
    <?xml version="1.0"?>
    <SampleSets>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:20 PM" />
    <CarbonAvg Label="Carbon Avg." Value="116 ppm" />
    </SampleSet>
    <SampleSet Label="Sample Set">
    <Name Label="Name" Value="CQS6" />
    <AnalysisDate Label="Analysis Date" Value="3/13/2015 12:33 PM" />
    <CarbonAvg Label="Carbon Avg." Value="123 ppm" />
    </SampleSet>
    </SampleSets>
    I am not sure how you want the XML be formatted, my usual approach to format a XML file is to open the file in Visual Studio and use ctrl K+D keyboard shortcuts to format the XML file.
    >>is there a way that I can wrap the file using XSLT instead of having to create a separate program to make it well formed?
    XSLT is used to process XML file, while you provided file is a text file, it does not recognize it.
    If I misunderstand, please feel free to let me know.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Best way to Transform one XML to another XML using SSIS

    I am using Altova Mapforce tool to transform one XML into another XML, but now we are planning to use any other best way of using XSLT transformation. Could you guys shed me some light on different approaches and which one would be best based on time and
    cost constraint.
    In Altova Map force Tool, due to below reasons we wanted to avoid that,
    Resource cannot work parallely in single XSLT
    Maintanence is very difficult
    Licensed version of tool
    When the XML size grows, new resourse are feeling difficult to edit the XSLT etc.,
    Related to .net approaches would be best.
    Can we create XSLT by using SSIS to transfrom one xml into another xml format.
    In .net code we can do, but feel that it is time consuming due to large size of XML.
    Any other best way for handling XSLT transformation or any tool

    XSLT can be applied to an XML file fed as a source, but it does not resolve #1. I by the way do not understand this point, technically.
    For SSIS to go live in prod you need to deplete a SQL Server license (CPU + CALs).
    The time to transform in SSIS will be equal to doing in .net code as the whole SSIS is coded in .Net, too.
    Here, in this section of the forum we may not have the needed expertise in XSLT or XML transformations.
    In my IT life, XML transformations were done in Java if on a *NIX box. On Windows a C# .net app webservice did it. The most interesting implementation, and if you are a heavy users of XML is to use a dedicated database as Base X, it has an XLSLT transform
    moduleL http://docs.basex.org/wiki/XSLT_Module
    Arthur
    MyBlog
    Twitter

  • Transformation of xml

    hi everybody,
    how to transform one xml file into another xml file
    what should i use
    what tools are their to automate this task
    suggest some materials and examples on the topic
    bye
    advance thanks
    bye
    shekar

    Refer to xslt tutorial
    http://java.sun.com/webservices/docs/ea2/tutorial/doc/JAXPXSLT2.html

  • Simple Transformation for XML created by Excel

    Hello,
    Excel can produce XML files quite easily in this documented format:
    http://msdn.microsoft.com/en-us/library/aa140062(office.10).aspx
    (in excel: file --> save as and choose XML)
    Does someone has an idea of how I can read this XML using a Simple Transformation in ABAP?
    Example: if this is an excel sheet with 3 columns and 3 lines
    ¦----
    ¦
    ¦ PERNR          ¦ BEGDA            ¦ ANZHL ¦
    ¦----
    ¦
    ¦   12346          ¦  20.02.2009          ¦15                    ¦
    ¦----
    ¦
    ¦   2356           ¦  25.02.2009          ¦12                    ¦
    ¦----
    ¦
    this is the XML
    The goal would be to transform this XML into an internal table. Any idea is appreciated.
    Koen Van Loocke

    Hi Keon,
    Please find the below link
    [Help|http://help.sap.com/abapdocu/en/ABAPCALL_TRANSFORMATION.htm]
    [Help|http://help.sap.com/abapdocu/en/ABENABAP_ST.htm]
    Please find the code below
    [Code|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/exportingdatatoExcel-XMLtotherescue]
    Thanks
    Kalyan

  • How to configure XSLT Helper for WPC content

    Hi,
    I'm trying to write my own XSLT Helper and use it when rendering content on WPC web pages. I didn't find any documentation on this topic, so I did mimicked what SAP does with their com.sap.nw.wpc.km.service.linkmanager.XsltHelper:
    1. Wrote my little class that contains static method:
    public class MyXslHelper
         public static String testMethod()
              return "response from MyXslHelper";
    2. Added declaration of namespace and usage in xsl template:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:my_hlp="com.my.xsl.helper.MyXslHelper">
    <xsl:value-of select="my_hlp:testMethod()"/>
    3. Defined helper in Content Management->Web Page Composer->Editor->XSLT Helpers:
    name=my_helper  
    alias=my_hlp  
    implementation=com.my.xsl.helper.MyXslHelper
    description=My helper
    PRT mode=*
    This doesnt' work and when rendered throws exception java.lang.ClassNotFoundException: com.my.xsl.helper.MyXslHelper.
    What are the steps that I'm missing? Does anyone have any documentation on how to configure xslt helpers?
    Thanks in advance
    Ruslan

    Hi
    Did you solve this issue?
    Thanks!
    Christof

  • Loading, processing and transforming Large XML Files

    Hi all,
    I realize this may have been asked before, but searching the history of the forum isn't easy, considering it's not always a safe bet which words to use on the search.
    Here's the situation. We're trying to load and manipulate large XML files of up to 100MB in size.
    The difference from what we have in our hands to other related issues posted is that the XML isn't big because it has a largly branched tree of data, but rather because it includes large base64-encoded files in the xml itself. The size of the 'clean' xml is relatively small (a few hundred bytes to some kilobytes).
    We had to deal with transferring the xml to our application using a webservice, loading the xml to memory in order to read values from it, and now we also need to transform the xml to a different format.
    We solved the webservice issue using XFire.
    We solved the loading of the xml using JAXB. Nevertheless, we use string manipulations to 'cut' the xml before we load it to memory - otherwise we get OutOfMemory errors. We don't need to load the whole XML to memory, but I really hate this solution because of the 'unorthodox' manipulation of the xml (i.e. the cutting of it).
    Now we need to deal with the transofmation of those XMLs, but obviously we can't cut it down this time. We have little experience writing XSL, but no experience on how to use Java to use the XSL files. We're looking for suggestions on how to do it most efficiently.
    The biggest problem we encounter is the OutOfMemory errors.
    So I ask several questions in one post:
    1. Is there a better way to transfer the large files using a webservice?
    2. Is there a better way to load and manipulate the large XML files?
    3. What's the best way for us to transform those large XMLs?
    4. Are we missing something in terms of memory management? Is there a better way to control it? We really are struggling there.
    I assume this is an important piece of information: We currently use JDK 1.4.2, and cannot upgrade to 1.5.
    Thanks for the help.

    I think there may be a way to do it.
    First, for low RAM needs, nothing beats SAX. as the first processor of the data. With SAX, you control the memory use since SAX only processes one "chunk" of the file at a time. You supply a class with methods named startElement, endElement, and characters. It calls the startElement method when it finds a new element. It calls the characters method when it wants to pass you some or all of the text between the start and end tags. It calls endElement to signal that passing characters is over, and to let you get ready for the next element. So, if your characters method did nothing with the base-64 data, you could see the XML go by with low memory needs.
    Since we know in your case that the characters will process large chunks of data, you can expect many calls as SAX calls your code. The only workable solution is to use a StringBuffer to accumulate the data. When the endElement is called, you can decode the base-64 data and keep it somewhere. The most efficient way to do this is to have one StringBuffer for the class handling the SAX calls. Instantiate it with a big enough size to hold the largest of your binary data streams. In the startElement, you can set the length of the StringBuilder to zero and reuse it over and over.
    You did not say what you wanted to do with the XML data once you have processed it. SAX is nice from a memory perspective, but it makes you do all the work of storing the data. Unless you build a structured set of classes "on the fly" nothing is kept. There is a way to pass the output of one SAX pass into a DOM processor (without the binary data, in this case) and then you would wind up with a nice tree object with the rest of your data and a group of binary data objects. I've never done the SAX/DOM combo, but it is called a SAXFilter, and you should be able to google an example.
    So, the bottom line is that is is very possible to do what you want, but it will take some careful design on your part.
    Dave Patterson

  • Please help me transform this C++ code to java code....

    guys...please help me transform this C++ code to java code....please try to explain the code..thanks
    [program]
    #include <stdio.h>
    #define ALIVE 1
    #define DEAD 0
    #define SZ 33
    int stschk (int ,int );
    main()
    int s[SZ][SZ], i, j;
    for (i=0; i<sz; i++ ) s[0] = DEAD;
    for (j=0; j<sz; j++ ) s[0][j] = DEAD;
    s[0][1] = ALIVE;
    for (i=0; i<sz-1; i++) {
    for ( j=1;j<sz;j++ ) {
    s[i][j] = stschk(s[i][j-1],s[i+1][j];
    if(s[i][j-1]==ALIVE) printf("*");
    else printf(" ");
    printf("\n");
    int stschk(int s1,int s2)
    if(((s1==DEAD)&&(s2==ALIVE))||
    ((s1==ALIVE)&&(s2==DEAD))) return ALIVE;
    else return DEAD;

    Being picky, that's not C++, that's C. Standard headers in C++ dont' have .h after them, loop variables are scoped with the for, you use constants rather than #defines, etc..
    C and C++ both don't initialise arrays by default; you'd have to write an initialiser to get it to zero out the array:
        int s[sz][sz] = {};gcc will insert a call to memset to zero the array.
    If the author was assuming that the array was zeroed out, there would be no point zeroing the first row and column.
    The code reads values which haven't been initialised. If you mark such values explicitly undefined, and change the program to report an error when undefined, then you get several cases where the program makes such report.
    So either it' s a primitive random number generator (some random number generators use uninitialised memory as a source of randomness), or it's buggy, or it's processing undefined data and throwing away the result. Either way, it cannot be directly be ported to Java if the undefined values (which are limited to a small area of the ouput) are significant.

  • Problem in transforming the xml in applet

    Hi guys
    I am parsing and transforming an xml in applet. parsing is working fine but transform is giving error. I am using jaxp and jdk1.4 plugin for applet. The error is
    Exception:
    Output method is xml could not load output_xml.properties (check CLASSPATH)
    org.apache.xml.utils.WrappedRuntimeException: Output method is xml could not load output_xml.properties (check CLASSPATH)
         at org.apache.xalan.templates.OutputProperties.getDefaultMethodProperties(OutputProperties.java:364)
         at org.apache.xalan.templates.OutputProperties.<init>(OutputProperties.java:130)
         at org.apache.xalan.transformer.TransformerIdentityImpl.<init>(TransformerIdentityImpl.java:104)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:804)
    Code is
    *********************code***********************************
    TransformerFactory xformFactory = TransformerFactory.newInstance();
    Transformer idTransform = xformFactory.newTransformer();
    //create the Source object from document object
    Source input = new DOMSource(doc);
    StringWriter writer = new StringWriter();
    Result output = new StreamResult(writer);
    idTransform.transform(input, output);
    xmlString = writer.toString();
    *********************code***********************************
    Hope some one get a solution

    Hi
    I am using the parsers & transformers that came with JDK 1.4.
    i.e class org.apache.xalan.processor.TransformerFactoryImp
    Thank you.
    I solved that problem my making my applet signed.
    Now it is working fine.

Maybe you are looking for

  • How do I get my galaxy s4 to work again?

    A Week ago I dropped my galaxy s4 in the toilet on accident. I let it air out and it seemed it work fine and charged that night but since then It hasn't been charging. I couldn't use it for a couple days because once it died it wouldn't charge again.

  • Help! Oracle 8i Personal Too Large to Download - Options?

    The zipped file is WAY too large for me to download at 56k (over half a gigabyte!) Is there another way for me to get an eval copy of this? (I plan to install it on Windows XP Pro) 10-29-2002

  • Querying Hierarchy - Above + Below

    Hi, I have the following situation: I have a table HIERARCHY with the following fields: <PRE> CHILD PARENT           =================== 100                101 100           102 101           103 102           104 105 100           106 105          

  • RFC Query

    Dear SAP Guru's, I need ur help for the following queries: 1. How do I add/ create new roles in RFC user. 2. Where can i find a list on the RFC Users  ---  any Tx:  ? Regards, Amit

  • Prod.hierarchy field in basic data

    hi can anybody please explain me what is a use of prod.hierarchy field in basic data tab page in material master and how to create these hierarchy levels i have gone through field help but not able to understand client is asking about this field plea