Add XML header?

Hi Experts ,
I need to add this extra 2nd line in my generated xml output of graphical mapping.
<?xml version="1.0" encoding="UTF-8"?>
<?Siebel-Property-Set EscapeNames="false"?>
Is there any smart way to add this 2nd line? I have already created a graphical mapping for the message with complex lookups and do not wish change it much.
Thanks
Shamly.

Hi Shamly,
You are on right path.
Use your graphical mapping (for complex lookup and other logic) after that use another Java Mapping ( to add <?  ?> line) in Operational Mapping.
Use this bolg to develop Java Mapping /people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
Hope this code will help you
import java.io.*;
import java.util.*;
import com.sap.aii.mapping.api.*;
public class DynamicMapping implements StreamTransformation {
    private Map param;
    public void setParameter(Map param) {
        this.param = param;
    public void execute(InputStream in, OutputStream out) throws StreamTransformationException {
        try {
          byte[] b = new byte [in. available ()]; //  in.available() is in square brackets
                        in.read(b);
          StringBuffer input = new StringBuffer( new String(b));
                        /*note         "   '  '   "       in double Quotes  we can have single Quotes.
                        /Here we are inserting <?Siebel-Property-Set EscapeNames='false'?>  after <?xml version="1.0" encoding="UTF-8"?> i.e after ?> */
          input.insert(input.indexOf("?>")+2, "<?Siebel-Property-Set EscapeNames='false'?>");
                       out.write(b.toString().getBytes()); 
        } catch (IOException ex) {
           ex.printStackTrace();
Edited by: Raghu Vamsee on Jan 13, 2010 7:22 PM

Similar Messages

  • How to add XML Header tag to XML output from XI?

    Hi ,
    My requirement is I need to genarate the XML according to client requirements.
    I am able to genareate the XML with  <?xml version="1.0" encoding="UTF-8" ?>  as Header but client requiremetn is like this
    <?xml version="1.0" encoding="UTF-8" ?>
    <?Label MEXICO|PROFILE|2033169|SUCCESS?>
    and hear MEXICO and 2033169 will change dynamically for every xml genaration. How it make as dynamical and how can I achive this.?
    Plz guid me...
    Thanks
    Krishna

    You can refer to the code provided in this thread XML Tag Issue: Need extra Line with Xml RooTag and Convert the IDOC XML file into single string? . Java mapping would do these steps -
    a) Convert the incoming xml into string.
    b) Modify it with some string function as per requirement.
    c) Convert the string back to xml.
    For more understanding about Java mapping, go through links provided in the thread java mapping .
    Regards,
    Sunil Chandra

  • Adding additional XML Header in Target XML structure

    Hi all,
    I have a requirement that i need add one additional XML header to target XML messages. At the moment i can see default XML header as ,
    <?xml version="1.0" encoding="UTF-8" ?>
    <Test>
    <Add>Test Mesage</Add>
    </Test>
    But i would like to have one more additional header like below,
    <?xml version="1.0" encoding="UTF-8" ?>
    <?Siebel-Property-Set EscapeNames="false"?>
    <Test>
    <Add>Test Mesage</Add>
    </Test>
    Can some one help me to find a way to adding this additional header?
    Thanks in advance.
    Prasad Babu.

    Hi Prasad,
    Yes it is possible by Java Mapping. Please check my response for similar thread
    Re: Add XML header?

  • How can i add a header like this?

    I am using the XMLFilter class to create an XML document using SAX as shown here:
    http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
    However i want to add a header like this to my xml document:
    <?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
    How can i do this? I cant use startElement() etc. since they create a standard tag. Apart from manually appending it to the

    Show us the part of your code that actually does the output. If it's a Transformer, you'll need to put in the code that I posted in this forum twice just last week. If it's something else, then, I don't know, you'll need to do something else. But I don't see anything in that link that actually outputs XML.

  • Adding Encoding in XML header without mapping

    Hi Gurus,
    I am stuck in a situation where in a pass through scenario, I need to add encoding type in XML header.
    Below is example -
    Current Situation - <?xml version="1.0"?>
    Expected result -  <?xml version="1.0" encoding="UTF-8"?>
    Can anybody help me in this regard? how to achieve this?
    Regards
    Vidhi S

    Hi Vidhi
    Use it in the below way in the receiver adapter.
    Module name: AF_Modules/XMLAnonymizerBean
    Parameter name: anonymizer.encoding
    This will work. I have tested already.

  • XML header?

    Hi experts,
    I am generatig an xml file. I want to add FileID = "X123" before version="1.0" in the xml header.
    For ex:
    <?xml version="1.0" ?>
    to
    <?xml FileID="X123" Version="1.0">
    Any idea?

    NO. SAP XML parser are the tools created by SAP to work with XML.
    Parsing XML
    All modern browsers have a build-in XML parser that can be used to read and manipulate XML.
    The parser reads XML into memory and converts it into an XML DOM object that can be accessed with JavaScript.
    You will learn more about the XML DOM in the next chapter of this tutorial.
    There are some differences between Microsoft's XML parser and the parsers used in other browsers. The Microsoft parser supports loading of both XML files and XML strings (text), while other browsers use separate parsers. However, all parsers contain functions to traverse XML trees, access, insert, and delete nodes (elements) and their attributes.
    In this tutorial we will show you how to create scripts that will work in both Internet Explorer and other browsers.
    Note: When we talk about parsing XML, we often use the term "Nodes" about XML elements.
    In package SIXML you have the tools and examples for work with XML in an efficient way.

  • Edit/add XML data in BI Publisher

    Hi
    I have a java program that is generating an XML file that I am using as input for my BI publisher for PO report. However, I want to add some extra information(location addresses corresponding to location id) that is not there in the XML and I cannot edit the java program generating it. Is there any way I can do this in BI publisher? Can I edit/add XML data in BI publisher? This is really urgent and I appreciate any help.
    Thanks,
    Sharmila

    You have to edit the package which has the sql query,
    without fetching them in xml , you cannot display that.
    BIP will not help you to get that into report.
    The code which generates the XML data has to edited for sure..
    I guess, i helped one guy for similar requirement,
    i guess you are asking in the same report..
    the java program in turn calls the Pl/Sql package which generates the XML data and pass it to the Java Concurrent Program.
    The Pl/Sql package picks data from these views po_headers_xml, po_lines_xml, po_distribution_xml.
    you can also add the columns you want to be displayed in these views, and then change the template accordingly.

  • Add XML Publisher Administrator responsibility with EBS 11.5.9

    Hi all !
    I'm exploring the possibility to use XML Publisher inside Oracle E Business Suite 11.5.9. because...unfortunately it's not possible to upgrade EBS to the 11.5.10 version
    I found a note on the forum which says: "Starting from 11.5.9 the XMLP is bundled with Apps. You just need to add XML Publisher Administrator responsibility to your profile, and install MS Word template builder on your PC".
    So...my questions are:
    1) how can I add the XML Publisher Administrator responsibility to my profile ? Should I set up something (already existing into EBS), or should I install a patch ?
    2) how can I know the XML Publisher version bundled within Apps (if what is written inside that note it's true), 'cause I'd like to use the 5.6.3 version
    Also, I looked for a solution on Metalink and the only note regarding how to use XML Publisher inside E Business Suite 11.5.9. is the note id 278727.1 (even I should install the 4.5 XML Publisher version - TOO OLD)
    Thanks in advance
    Alessandro

    Hi Ravi thanks for you answer !
    So....I tried to create the responsibility from scratch, because nothing is defined for XML Publisher, in this way (from the OA System Administrator):
    Responsibility Name: XML Publisher Administration
    Application: XML Publisher
    Responsibility Key: XDO_ADMINISTRATION
    .....but inside the Data Group area
    Name : Standard
    Application: ?
    ....and inside the Menu area which information should I write ?
    Is there something to follow in order to create from scratch a XML responsibility ?
    Thanks again
    Alex

  • Create a new line in the xml-header structure.

    Hi,
    Can any one tell me how to create a new line in the xml-header structure.
    I am doing a IDOC-XI-HTTP scenario.
    Actually my mapping create this file:
    <b><?xml version="1.0" encoding="utf-8"?>
    <ORDERS05>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    The result must look like this.
    <b><?xml version="1.0" encoding="utf-8"?>
    <ORDERS05>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    Thanks and Regards,
    Eren

    Hi,
    thanks for you quick answer.
    I found a xsl script.
    It works fine.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes"/>
       <xsl:template match="*">
          <xsl:param name="depth">0</xsl:param>
          <!-- New line with indenting. -->
          <xsl:if test="$depth > 0">
             <xsl:text>    </xsl:text>
          </xsl:if>
          <xsl:text>&#xA;</xsl:text>
          <xsl:element name="{name(.)}">
             <xsl:for-each select="@*">
                <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
             </xsl:for-each>
             <xsl:apply-templates>
                <xsl:with-param name="depth" select="$depth + 1"/>
             </xsl:apply-templates>
          </xsl:element>
       </xsl:template>
    </xsl:stylesheet>
    Best regards
    Eren

  • How do I add a header/footer to a document?

    I am using Adobe X Standard, version 10.1.2 and everything I am reading tells me to go to tools>pages>Header & Footer>Add Header & Footer, but once I click on tools to the left, the only options I have are export and create pdf files and send files. There is no tools option in the tool bar on the top. File, edit, view, window & help are my only options. How can I add a header/footer to a document?!

    I think you might be opening your Pdf document in Adobe Reader. If you try open your pdf document in Adobe Standard and check again as far as your option are concerned you should be able to do that.

  • How can I add a header/footer to a document?

    I am using Adobe X Standard, version 10.1.2 and everything I am reading tells me to go to tools>pages>Header & Footer>Add Header & Footer, but once I click on tools to the left, the only options I have are export and create pdf files and send files. There is no tools option in the tool bar on the top. File, edit, view, window & help are my only options. How can I add a header/footer to a document?!

    What you describe tends to indicate that you're using Reader, not Acrobat. If you do have Acrobat installed, make sure you're using it and not Reader.

  • Add xml Tags in Indesign CS4 by Apple/Java script

    Hi,
    All, I'm new to Indesign Scripting, and I'm hoping someone can help me with the following add xml tags in my xml indesign cs4 files.
    I have IDML (ETMV2) xml Indesign CS4 files. But i have lots of powermath equation without xml tags. So i want how i can insert xml tags.
    My probleam like this =>
    <no open xml tags>[&x^{2}+y_{3}&]<no close xml tags>
    I want like this (But i do manualy)
    <inlineequation><inlinemediaobject><textobject role="xpressmath">[&x^{2}+y_{3}&</textobject></inlinemediaobject></inlineequation>
    Can anyone write/suggest me how i can add xml Tags. By Apple/Java Script
    Any insight is appreciated!
    snegig

    Hi,
    John Hawkinson thank you so much your suggestion.
    I am new  this type of discusion (on this page). So i think anybody could not replay my answer. So i repost my question.
    I want insert tags in my Indesign CS4 files. Is this posible when i select my powermath equaiton then run script. Script add tags automatically before/after my equation. Please ignore IDML word.
    Yes i an comfortable with XSLT presently i working with Pearson ETMV2.
    I have one more question when i past my snapshot its appear properly but when i agin see my commant then my snapshot disappear (see small blue rectangle).
    Thank you John again i am new in this industry please guide.
    snegig

  • Need to add xml tag in the request message

    Hello Experts,
    Need ur help.
    Right now i am working on the scenario Http -> to -> Proxy.
    Whatever request i am getting is not having XML tag in it, and because of that my mapping is failing.
    Can you tell me that how can i add XML tag in my request so it will not fail in Mapping?
    Need to add : <?xml version="1.0" encoding="UTF-8"?> in request.
    Thanks,
    Hetal

    HI Hetal
    Instead of adding this to the source message. Remove this tag from mapping.
    Use a XSLT mapping without this initial tag. it will work.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://namespace">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
    <xsl:template match="/">
    <xsl:for-each select="//tag">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Use this mapping without
    <?xml version="1.0" encoding="UTF-8"?>
    If you still see XML tag then use
    <xsl:output method="html"
    instead of
    <xsl:output method="xml"
    Thanks
    Gaurav

  • How can i add a header to each page of my form

    Hi
    Iam creating a form - it was based on one of the templates, however I would like to add a header to the top of each page (it currently only has it on the first page). Can someone please help?
    Many thanks
    Shev

    There isn't a direct way to do this for PDF forms (web forms have the header on every page). For PDF you would have to copy a text/image item at the top of each page yourself.
    Randy

  • How to add a header to an InfoSpoke generated CSV

    Hello everybody,
    I would appreciate any suggestions on how to add a header line (with the field names) to the CSV-file generated by an InfoSpoke.
    Thanks for your help.
    Greetings,
    Martin

    if I recall correctly, that "header line" you're looking for, gets created automatically as a 2nd file... you could use a macro to combine both files in Excel?

Maybe you are looking for