XSLT help

I've used XSLT quite a bit to transform one form of XML into another, or into HTML, or into a programming language.
So I'm OK on the basic syntax.
Now I want to do some very simple automated editing of an XML file. I just want to add a few child elements to an element.
Perhaps I'm being dim, but how on earth would I go about that? I just want to select an element with match="method[@name='asp_bk_consmt_io]'" and add a few elements to it, and output the result to the out file.
So the fragment
<method name="asp_bk_consmt_io">
</method>becomes
<method name="asp_bk_consmt_io">
  <param name="p_principal" type="structure" structureName="Asp_bk_party"/>
</method>And the rest is copied unchanged. Can anyone help?

<xsl:template match="method">
<method>
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:if test="method[@name='asp_bk_consmt_io']">
<param name="p_principal" type="structure" structureName="Asp_bk_party"/>
</xsl:if>
</method>
</xsl:template>
I think that will work. There is an excellent XSLT tutorial and reference at www.zvon.org.
- Saish

Similar Messages

  • 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

  • XSLT Help Required

    Hi,
    I am doing XSLT Mapping. Scenario is file to file. From input file depending on some condition I need to place records in Target file. Target File structure is:
    Header_Record (1)
    Data_Record (1..*)
    Trailer_Record (1)
    In Trailer I need to place record count of no of Data_records in this Target file.
    How should I go for this Prob.
    Looking for help.
    -Kavita

    Hi Prasanna ,
    I am not an expert but what about this:
    <SUPPLIERID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
    </SUPPLIERID>
    <BILLTOID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
    </BILLTOID>or
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
        <SUPPLIERID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </SUPPLIERID>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '24'">
        <BILLTOID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </BILLTOID>
      </xsl:when>
    </xsl:choose>Regards Pete

  • Problem with XML and XSLT, help...

    Okay, I have this XML doc (called stocks.xml):
    <?xml:stylesheet type="text/xsl" href="stocks.xsl" version="1.0" encoding="UTF-8"?>
    <portfolio>
    <stock>
    <symbol> SUNW </symbol>
    <name> Sun Microsystem </name>
    <price> 12.95 </price>
    </stock>
    <stock>
    <symbol> HPW </symbol>
    <name> Hewlet Packard </name>
    <price> 53.50 </price>
    </portfolio>
    And I have this XSLT doc (called stocks.xls):
    ?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <head>
    <title> Stocks </title>
    <body bgcolor="#ffffcc">
    <xsl:apply-template />
    </body>
    </head>
    </html>
    </xsl template>
    <xsl:template match="portfolio">
    <table border="2">
    <tr>
    <th> Stock Symbol </th><th> Company Name </th><th> Price </th>
    </tr>
    <xsl:for-each select="stock">
    <tr>
    <td>
    <i><xsl:value-of select="symbol" /></i>
    </td>
    <td>
    <xsl:value-of select="price" />
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl template>
    </stylesheet>
    When I try to retrieve the stocks.xml document with
    IE, the browser said, there is an error on line 2, can not
    recognize xsl:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Reference to undeclared namespace prefix: 'xsl'. Error processing resource 'http://localhost:8080/examples/jsp/stocks/stocks.xsl'. Line 2, Position 71
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    I just follow this from an example of XML tutorial.
    Please help, what is it that I miss? Seems everything
    I have is okay....??
    Thanks,
    Ted.

    Thanks you all!
    You have spotted that mistyped.
    However, turns out Internet Browser that I have does not permit the use of XSL. After I fixed the file, I got this
    message:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Keyword xsl:apply-template may not be used here.
    Oh well...
    Anybody knows, if IE can or can not be used to view the
    XML that reference XSL??
    Thanks,
    Ted.

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

  • XSLT Help Request - Building Hierarchy

    Hi everyone,
    We are receiving a file that has the following structure, where fields that start with H are header fields, and fields that start with D are detail fields (like a header and line items in an FI posting).
    H1, H2, H3, D1, D2, D3, D4, D5
    On the first line of the FI posting, the H and the D fields are populated (i.e. contains the header information, and the first line item information).  Then on the next lines, the H fields are all blank, and the D fields are populated.  So like this:
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    The file can also have more than 1 FI posting (i.e. more than 1 Header):
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    We are trying to map this into a FIDCC1 idoc posting, which looks like this:
    <FIDCCP01>
      <IDOC>
        <Header>
          <H1></H1>
          <H2></H2>
          <H3></H3>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
        </Header>
      </IDOC>
      <IDOC>
        <Header>
          <H1></H1>
          <H2></H2>
          <H3></H3>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
        </Header>
      </IDOC>
    </FIDCCP01>    
    We can't make this work alone in the concent conversion, so was thinking that this could be done in XSLT.  We have created a data type that contains the fill H and D fields and are taking this into XI no problems, but we are having problems putting it into the hierarchy.  Any help is greatly appreciated.
    Thanks
    Peter

    Here is the input file, top line being the field breakdown
    12222333333334444566666666666666667777777777777777
    1FB0104052007ARP 20000000026590.000000000000000.00
    /////////////////20000000098765.000000000000000.00
    1FB0104052007USD 20000000012345.000000000000000.00
    /////////////////20000000054321.000000000000000.00
    Field 1, when it is a "1", is the start of the header line.  Field 5 will always be a "2", and is the start of the detail line.  Also all null fields are populated with a slash.
    My idea was to take this in all on 1 line where the structure contains both the header and the detail fields, because I wasn't sure if content conversion could do what I wanted.  When I do that, here is the result:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:IFS_MT xmlns:ns="http://xx.com/xi/fin/gl/iams/ifs">
         <Detail>
              <STYPE1>1</STYPE1>
              <TCODE>FB01</TCODE>
              <BLDAT>04052007</BLDAT>
              <WAERS>ARP</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000026590.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>/</STYPE1>
              <TCODE>////</TCODE>
              <BLDAT>////////</BLDAT>
              <WAERS>////</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000098765.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>1</STYPE1>
              <TCODE>FB01</TCODE>
              <BLDAT>04052007</BLDAT>
              <WAERS>USD</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000012345.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>/</STYPE1>
              <TCODE>////</TCODE>
              <BLDAT>////////</BLDAT>
              <WAERS>////</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000054321.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>     
    </ns:IFS_MT>
    I am open to changing the file content conversion if there is a better way!
    The desired result is:
    <FIDCCP01>
         <IDOC>
              <E1FIKPF>
                   <TCODE>FB01</TDOCE>
                   <BLDAT>04052007</BLDAT>
                   <WAERS>ARP</WAERS>
                   <E1FISEG>
                        <WRBTR>0000000026590.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
                   <E1FISEG>
                        <WRBTR>0000000098765.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
              </E1FIKPF>
         </IDOC>
         <IDOC>
              <E1FIKPF>
                   <TCODE>FB01</TDOCE>
                   <BLDAT>04052007</BLDAT>
                   <WAERS>USD</WAERS>
                   <E1FISEG>
                        <WRBTR>0000000012345.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
                   <E1FISEG>
                        <WRBTR>0000000054321.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
              </E1FIKPF>
         </IDOC>
    </FIDCCP01>
    Thanks again!
    Peter

  • SOS beginner needs XSLT help

    Hello,
    I have an XML document that does not have any space between brackets as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <root><One><a>toto</a><a>titi</a></One><One><a>tata</a><a>tutu</a></One></root>I have been looking for an XSLT script that would give me that:
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
        <One>
            <a>toto</a>
            <a>titi</a>
        </One>
        <One>
            <a>tata</a>
            <a>tutu</a>
        </One>
    </root>or something more human-readable that the first example. Is that possible?
    I have been working on that all day long without much success as I am a beginner in xslt. Any help or clue immensely welcome!!
    Julien.

    Hello DrClap,
    Thanks a lot!! It works partially insomuch as it puts a carriage return and gives me that:
    <root>
    <One>
    <a>toto</a>
    <a>titi</a>
    </One>
    <One>
    <a>tata</a>
    <a>tutu</a>
    </One>
    </root>Has anyone got any clue as to how to configure xalan on NB so that it indents the xml properly??
    Julien.

  • XSLT help needed namespaces

    Hello all
    I am trying to get rid of namespaces in the XML document. The document XI is producing looks liek this
    <com:ID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="N/A">0018000562</com:ID>                                                                               
    <com:IssueDate xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">2008-10-02</com:IssueDate>                                                                               
    <com:TypeCode xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">PIE</com:TypeCode>                                                                               
    <main:InvoiceCurrencyCode xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/">USD</main:InvoiceCurrencyCode>                                                                
    <com:BuyersReferenceID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="EAN">5790001330217</com:BuyersReferenceID>                                               <com:ReferencedOrder xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:BuyerParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:DestinationParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:SellerParty xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:TaxTotal xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:LegalTotals xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">                                                                               
    <com:InvoiceLine xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/">
    And I would like the document to look like this
    <com:ID schemeID="N/A">0018000562</com:ID>
    <com:IssueDate>2008-10-02</com:IssueDate>
    <com:TypeCode>PIE</com:TypeCode>
    <main:InvoiceCurrencyCode>USD</main:InvoiceCurrencyCode>
    <com:BuyersReferenceID schemeID="EAN">5790001330217</com:BuyersReferenceID>
    <com:ReferencedOrder>
    <com:BuyerParty>
    <com:DestinationParty>
    <com:SellerParty>
    <com:TaxTotal>
    <com:LegalTotals>
    <com:InvoiceLine>
    Simply put , XI is including a namespcae for every node  <com:ID xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" schemeID="N/A">0018000562</com:ID>
    But i would liek just the node  <com:ID schemeID="N/A">0018000562</com:ID>  
    How can we achieve this , XSLT code plz , or could we do this with mapping , adaopter modules etc ..
    Thanks a lot
    Sudheer

    HI Igor
    Looks liek this could be an answer for my problem , I am doing all this to get rid of ns0: prefix which XI adds to its messages . I need to replace this 'ns0' with 'com'
    My message after mapping is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Invoice xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:ns0="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance">
    +     <ns0:ID schemeID="N/A">0018000562</ns0:ID>+
    +     <ns0:IssueDate>2008-10-02</ns0:IssueDate>+
    +     <ns0:TypeCode>PIE</ns0:TypeCode>+
    +     <ns0:InvoiceCurrencyCode>USD</ns0:InvoiceCurrencyCode>+
    +     <ns0:BuyersReferenceID schemeID="EAN">5790001330217</ns0:BuyersReferenceID>+
    +     <ns0:ReferencedOrder>+
    +          <ns0:BuyersOrderID>sdfsdfsd</ns0:BuyersOrderID>+
    +          <ns0:IssueDate>2008-09-30</ns0:IssueDate>+
    +     </ns0:ReferencedOrder>+
    +     <ns0:BuyerParty>+
    +          <ns0:ID schemeID="EAN">5790001330217</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>Fred the sold to party</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:BuyerContact>+
    +               <ns0:ID>contact person from ARLA</ns0:ID>+
    +               <ns0:Name>contact person from ARLA</ns0:Name>+
    +          </ns0:BuyerContact>+
    +     </ns0:BuyerParty>+
    +     <ns0:DestinationParty>+
    +          <ns0:ID schemeID="EAN">5790001330217</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>Fred the sold to party</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:Contact>+
    +               <ns0:ID>ARLA contact person</ns0:ID>+
    +               <ns0:Name>ARLA contact person</ns0:Name>+
    +          </ns0:Contact>+
    +          <ns0:Address>+
    +               <ns0:ID>Levering</ns0:ID>+
    +               <ns0:Street>14 Easy street</ns0:Street>+
    +               <ns0:CityName>north Andover</ns0:CityName>+
    +               <ns0:PostalZone>0184500</ns0:PostalZone>+
    +               <ns0:Country>+
    +                    <ns0:Code>NL</ns0:Code>+
    +               </ns0:Country>+
    +          </ns0:Address>+
    +     </ns0:DestinationParty>+
    +     <ns0:SellerParty>+
    +          <ns0:ID schemeID="EAN">Vendor&apos;s EAN number not implemented</ns0:ID>+
    +          <ns0:PartyName>+
    +               <ns0:Name>APV SYSTEMS US COMMERCIAL</ns0:Name>+
    +          </ns0:PartyName>+
    +          <ns0:PartyTaxScheme>+
    +               <ns0:CompanyTaxID schemeID="CVR">24730018</ns0:CompanyTaxID>+
    +          </ns0:PartyTaxScheme>+
    +     </ns0:SellerParty>+
    +     <ns0:TaxTotal>+
    +          <ns0:TaxTypeCode>VAT</ns0:TaxTypeCode>+
    +          <ns0:TaxAmounts>+
    +               <ns0:TaxableAmount currencyID="USD">101.53</ns0:TaxableAmount>+
    +               <ns0:TaxAmount currencyID="DKK">60.00</ns0:TaxAmount>+
    +          </ns0:TaxAmounts>+
    +          <ns0:CategoryTotal>+
    +               <ns0:RateCategoryCodeID>VAT</ns0:RateCategoryCodeID>+
    +               <ns0:RatePercentNumeric>25</ns0:RatePercentNumeric>+
    +               <ns0:TaxAmounts>+
    +                    <ns0:TaxableAmount currencyID="USD">101.53</ns0:TaxableAmount>+
    +                    <ns0:TaxAmount currencyID="DKK">60.00</ns0:TaxAmount>+
    +               </ns0:TaxAmounts>+
    +          </ns0:CategoryTotal>+
    +     </ns0:TaxTotal>+
    +     <ns0:LegalTotals>+
    +          <ns0:LineExtensionTotalAmount currencyID="USD">101.53</ns0:LineExtensionTotalAmount>+
    +          <ns0:ToBePaidTotalAmount currencyID="USD">101.53</ns0:ToBePaidTotalAmount>+
    +     </ns0:LegalTotals>+
    +     <ns0:InvoiceLine>+
    +          <ns0:ID>000010</ns0:ID>+
    +          <ns0:InvoicedQuantity unitCode="ST" unitCodeListAgencyID="n/a">1.000</ns0:InvoicedQuantity>+
    +          <ns0:LineExtensionAmount currencyID="DKK">1000.00</ns0:LineExtensionAmount>+
    +          <ns0:Item>+
    +               <ns0:ID schemeID="n/a">DS1234</ns0:ID>+
    +               <ns0:Description>Test material for STO</ns0:Description>+
    +               <ns0:BasePrice>+
    +                    <ns0:PriceAmount currencyID="DKK">1000.00</ns0:PriceAmount>+
    +               </ns0:BasePrice>+
    +          </ns0:Item>+
    +          <ns0:BasePrice>+
    +               <ns0:PriceAmount currencyID="DKK">1000.00</ns0:PriceAmount>+
    +               <ns0:BaseQuantity unitCode="ST" unitCodeListAgencyID="n/a">1.000</ns0:BaseQuantity>+
    +          </ns0:BasePrice>+
    +     </ns0:InvoiceLine>+
    </ns0:Invoice>
    I want to replace ns0: with com:
    Is there a simpler way to achieve this other than cosntructing the whole file with XSLT .
    Thanks a lot
    Sudheer

  • XSLT Help On Loop

    I have an array of 2 stops that I am looping over. Each element can have multiple orders. When I map to the target there is only 1 place to put orders per stop. So I want to loop over all of the orders and concatenate them with a "|" in 1 field on the target. So the input looks like this.
    <ns1:stops>
         <ns1:plannedArrival>2012-04-09T14:18:28.0000000</ns1:plannedArrival>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S2O1</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S2O2</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S2O3</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:removeFlag>false</ns1:removeFlag>
    </ns1:stops>
    <ns1:stops>
         <ns1:plannedArrival>2012-04-09T15:19:39.0000000</ns1:plannedArrival>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S3O1</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S3O2</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:orders>
              <ns1:orderIdentity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:OrderIdentity">
                   <ns1:orderNumber>S3O3</ns1:orderNumber>
              </ns1:orderIdentity>
         </ns1:orders>
         <ns1:removeFlag>false</ns1:removeFlag>
    </ns1:stops>
    The target is coming out like this. With an element for each one in the loop
    <ns0:Detail>
    <ns0:OrderNumber>S1O1</ns0:OrderNumber>
    <ns0:OrderNumber>S1O2</ns0:OrderNumber>
    <ns0:OrderNumber>S1O3</ns0:OrderNumber>
    <ns0:OrderNumber>S1O4</ns0:OrderNumber>
    <ns0:OrderNumber>S1O5</ns0:OrderNumber>
    </ns0:Detail>
    I want it to look like this
    <ns0:Detail>
    <ns0:OrderNumber>S1O1|S1O2|S1O3|S1O4|S1O5</ns0:OrderNumber>
    </ns0:Detail>
    Here is the XSLT that gives the bad one.
    <xsl:for-each select="ns1:orders">
    <ns0:OrderNumber>
    <xsl:value-of select="ns1:orderIdentity/ns1:orderNumber"/>
    </ns0:OrderNumber>
    </xsl:for-each>
    How do I change this?

    >
    begin
    2 loop
    3 revoke select on SCHEMA.TABLENAME1 from USER
    4 revoke select on SCHEMA.TABLENAME2 from USER
    5 end loop;
    6 end;
    >
    I will give you a very simple example how to grant select on an object owned by my schema to another schema.
    SQL> show user
    USER is "SCOTT"
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> set serveroutput on
    SQL> l
      1  begin
      2     For i in (select table_name from user_tables)
      3     Loop
      4         dbms_output.put_line('grant select on ' || i.table_name || ' to test_user; ');
      5     End Loop;
      6* End;
    SQL> /
    grant select on DEPT to test_user;
    grant select on EMP to test_user;
    grant select on BONUS to test_user;
    grant select on SALGRADE to test_user;
    PL/SQL procedure successfully completed.I will try to do something like this and once I am happy with the statements been generated i will replace dbms_output.put_line with execute immediate.
    Until then atleast I won't use execute immediate directly on a DDL statement.
    Regards
    Raj
    P.S : Please post like I did rather than saying it's not working which carries no value.

  • Create XML with XSLT help

    Hi,
    I would like to create an XML which map to XSLT.
    The data that I have to produce XML is just a very small data, for example ArrayList<Integer> myList.
    So I need to create an XML from myList.
    I'm not sure what technology solution I should choose.
    But it'll be great if I can produce my XML map with my xslt.
    Should I use SAX? Xerces? Digester? or ....
    Could someone give me a right direction or an example.
    I'm really appreciate all your input.
    Thanks,

    Explain why you want to use XSLT. From what you've said so far I don't see the need.
    There are a variety of ways to produce XML from data. You'll need to decide how exactly you want a list of numbers to map to XML -- there's a lot of data missing here.

  • XSLT Help please

    Hi gurus, I am brand new in XSLT. I am testing the example given in the book by Ben Chang and Jinyu Wang of Oracle, p. 479 (Oracle Database 10g XML & SQL: Design, Build & Manage XML Applications in Java, C, C++ & PL/SQL, Oracle Press 2004).
    select xmltype('<Txn>
         <Data value="18.75"/>
         <Data value="17.32"/>
         <Data value="16.45"/>
         <Data value="15.82"/>
         </Txn>').transform(XMLType('
              <xsl:stylesheet version="2.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                   <xsl:template match="/">
                        xsl:value-of select="sum(Txn//Data/@value)"/>
                   </xsl:template>
              </xsl:stylesheet>'))
    as sum
    from dual
    But I don't get the sum result. Instead I get this,
    xsl:value-of select=&quot;sum(Txn//Data/@value)&quot;/&gt;
    Am I supposed to get the sum result or this line?
    Thanks a lot.
    Ben

    I am not very convenient with XSLT yet (pinpointing on DBA stuff, didn't have time for XSLT), but guess what my problem was...
    I almost had created two files containing both statements, so I could compare them in UltraEdit...
    Two funny things here...
    1) It gave an output: the text of the line where the statement was wrong, missed the "<" (good to know for the next time, easy starting point debugging)
    2) The "correct output" that is returned has a 0000000000003 at the end...??? !!!
    I tried the following to see where it made the rounding error, but it is at the same level...
    SQL> col RESULT for 99999999999999999999999999.99999999999999999999999999999999
    SQL> r
      1  Select XMLType('<Txn>
      2  <Data value="18.75"/>
      3  <Data value="17.32"/>
      4  <Data value="16.45"/>
      5  <Data value="15.82"/>
      6  </Txn>').transform(XMLType('<xsl:stylesheet version="2.0"
      7                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      8  <xsl:template match="/">
      9  <xsl:value-of select="sum(Txn//Data/@value)"/>
    10  </xsl:template>
    11* </xsl:stylesheet>')) as result from dual
    RESULT
    68.340000000000003
    1 row selected.
    Execution Plan
    Plan hash value: 1388734953
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |     2   (0)| 00:00:01 |
    |   1 |  FAST DUAL       |      |     1 |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------I thought for a small time that I couldn't check this way for a rounding error because it looked like the statement didn't react on column formatting.
    but the following did work
    SQL> col  result head "Result"
    SQL> r
      1  Select XMLType('<Txn>
      2  <Data value="18.75"/>
      3  <Data value="17.32"/>
      4  <Data value="16.45"/>
      5  <Data value="15.82"/>
      6  </Txn>').transform(XMLType('<xsl:stylesheet version="2.0"
      7                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      8  <xsl:template match="/">
      9  <xsl:value-of select="sum(Txn//Data/@value)"/>
    10  </xsl:template>
    11* </xsl:stylesheet>')) as result from dual
    Result
    68.340000000000003Message was edited by:
    mgralike

  • WPC - XSLT helpers

    Hi
    Is there anyone who has got experience in creating an own xslt helper?
    I created an own xslt helper (just took the standard XsltHelperRuntimeLight and uploaded it under an own package).
    I did the mapping in config. (System admin - System Config - KM - CM - WPC - editor - XSLT Helpers)
    Now I'm getting the following error when I execute. Did I forget something?
    Cannot render container :
    com.sap.engine.lib.xml.util.NestedException:
    Could not load class: com.company.nw.wpc.km.service.editor.xslt.XsltHelperRuntimeLight required for extension library.
    -> java.lang.ClassNotFoundException: com.company.nw.wpc.km.service.editor.xslt.XsltHelperRuntimeLight
    ------------------------- Loader Info -------------------------
    ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@18d88c3]
    Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@10e631f]
    References: not registered! Resources: D:\usr\sap\NWD\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.nw.wpc.core\private\lib\com.sap.nw.wpc.core_core.jar
    It seems my class isn't loaded..
    I used this code to import my class in the xsl file
    <xsl:stylesheet version="1.0"  
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:test_wpc="com.company.nw.wpc.km.service.editor.xslt.XsltHelperRuntimeLight">
    And this one to use it
    <span class="wpcnew"><xsl:value-of disable-output-escaping="yes" select="test_wpc:getString('xsl.xmsg.new', string(document/@locale))"/></span>
    When I use a standard class in stead of mine, it works perfectly. So I assume it's a class mapping issue or my class isn't loaded at all.
    Thanks for any help, thoughts or information about this topic!
    Christof

    Hello
    I found finally the solution..
    http://help.sap.com/saphelp_nw04s/helpdata/en/26/227402890aa140ac967fe6000d93a1/frameset.htm
    <xsl:script implements-prefix="chh" language="java" src="java:com.company.nw.wpc.km.service.editor.xslt.XsltHelperRuntimeLight"/>
    Christof

  • Unable to refer to custom resource bundle in WPC content rendered with xslt

    Hi,
    I need to use the resource bundle messages inside WPC content.
    When rendered by standard xsl templates the  call to XSLTHelper class is done to retrieve message from the standard SAP resource bundle com.sap.nw.wpc.bundles.core.properties, like this:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                         xmlns:wpc="com.sap.nw.wpc.km.service.editor.hslt.XsltHelperCore">
    <xsl:value-of select="wpc:getString([key defined in sap bundle], string(/document/@locale))"/>
    The problem is that helper class doesn't provide any API to use custom bundles.
    I tried to create xslt helper (including config in KM), but that didn't succeed neither. It would return with error NoClassDefFound.
    Could you please help on configuring xslt helper and registering it with xslt rendering engine for Web Page Composer? I could not find any how-to guides on xslt helpers for WPC.
    Thanks in advance.
    Ruslan

    Hi
    Did you find a solution?
    Christof

  • WPC: Access Java beans from XSL

    Hi,
    How can we access custom Java beans from within the XSLs used to render WPC webforms? Do we have to implement a custom XSLT Helper? I am able to access standard Java classes using the <xmlns> tag but when I try to reference our custom classes the WPC editor throws a ClassNotFound exception. Any help will be appreciated.
    Thanks and Regards,
    Shibendra

    Hi,
    How can we access custom Java beans from within the XSLs used to render WPC webforms? Do we have to implement a custom XSLT Helper? I am able to access standard Java classes using the <xmlns> tag but when I try to reference our custom classes the WPC editor throws a ClassNotFound exception. Any help will be appreciated.
    Thanks and Regards,
    Shibendra

  • Web Page Composer : RSS

    Hello
    I can't use RSS with Web Page Composer, always the same message :
    Cannot render container : com.sap.engine.lib.xml.util.NestedException: Function with name 'wpc:getRssContent' not found in context library.
    I can add a RSS iView and it's work, but I'd like to add RSS directly with WPC.
    Is there sommething that I have to configure for RSS ? Do I have to wait SP16 ?
    Thanks !
    Damien

    Hello Emiliya
    Thanks for the answer !
    The RSS link list does not display correctly in the design time...
    For the error message, I've made a xslt helper such as describe in sap note 1133788, I don't get the error message, but still nothing is displayed. I use the same RSS feed in an XML iView and it's displaying with no problem...
    I tried this SAP test : by entering this url http://<name of the mashine>:<server
    port>/irj/go/km/docs/webdynamic/www.google.com should lead to the
    external site... and it's not working... I'll go and see if it's a proxy problem.

Maybe you are looking for

  • TIP:  Photoshop Workflow that WORKS (for me)

    Been thinking about this for a while and have figured out a workflow that integrates photoshop(PS) editing quite well with Lightroom (LR). My goals. *Export to PS in TIF PSD or jpg. *Autoimport back to library for stacking with original once edited *

  • Regarding Link to URL UI Element in a table

    Hi All, I am using "link to url" UI Element in a table column. I have mapped the column (i mean the "reference" property of "link to url" UI to a bapi node). Now, when I am populating the table, for some rows the bapi is not returning the url links.

  • Smartforms command to next page without balnk area in main area

    Hi all, i have created a smart form for Notification printing. i have one page called page1 page1 ->Text page from 1 to 8. -> text reported by : Tark ->MainWindow. ->Table itab1 into itab1 ->loop1 itab into itab. where adrnar = itab1-adrnar. ->loop2

  • Add XControl Properties in LV2010 is not working correctly

    Could someone verify this, on my end only the properties folder is created without any templates vi's inside. Am I doing something wrong?  It seems to work in LV2009

  • Error when using Home Sharing in iTunes 9

    I'm constantly getting the following error when trying to add songs using the new Home Sharing in iTunes 9. "There was a problem dowloading [song name]. The length received from the server did not match the expected length." Any ideas on why this is