Add attributes of dataTemplate, custom format, xml output

I need to format dataTemplate tag, in xml-output.
E.g.
<myDataTemplate_tag_name SchemaVersion="1.0" xmlns="http://www.oracle.com/">
Now, I have in xml
<dataTemplate name="myDataTemplate_tag_name" defaultPackage="ccc_pack" version="1.0" description='SchemaVersion=\"1.0\" xmlns=\"http://www.oracle.com/\"'>
but not work.
Any suggestion? How can I add attributes?
Thanks.
kale.
Edited by: kaleonardo on Oct 22, 2009 3:02 AM
Edited by: kaleonardo on Oct 22, 2009 7:12 AM

I discovered, I can make a xsl-xml template for manipulating tag name and attribute.
Now, my problem is to keep all informations which are in main tag.
Eg.
my xml:
<?xml version="1.0" encoding="UTF-8" ?>
<InsNewArrival>
<InsCodeVersions>
<CountryVer>2007</CountryVer>
<EuCountryVer>2007</EuCountryVer>
<CnVer>2008</CnVer>
<ModeOfTransportVer>2005</ModeOfTransportVer>
<DeliveryTermsVer>2005</DeliveryTermsVer>
<NatureOfTransactionAVer>2005</NatureOfTransactionAVer>
<NatureOfTransactionBVer>2005</NatureOfTransactionBVer>
<CountyVer>1</CountyVer>
<LocalityVer>06/2006</LocalityVer>
<UnitVer>1</UnitVer>
</InsCodeVersions>
</InsNewArrival>
after xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="InsNewArrival/*">
<InsNewArrival>
<xsl:attribute name="SchemaVersion">1.0</xsl:attribute>
</InsNewArrival>
</xsl:template>
</xsl:stylesheet>
I have
<?xml version="1.0" encoding="UTF-8" ?>
<InsNewArrival SchemaVersion="1.0" />
not
<?xml version="1.0" encoding="UTF-8" ?>
<InsNewArrival SchemaVersion="1.0" xmlns="http://www.intrastat.ro/xml/InsSchema">
<InsCodeVersions>
<CountryVer>2007</CountryVer>
<EuCountryVer>2007</EuCountryVer>
<CnVer>2008</CnVer>
<ModeOfTransportVer>2005</ModeOfTransportVer>
<DeliveryTermsVer>2005</DeliveryTermsVer>
<NatureOfTransactionAVer>2005</NatureOfTransactionAVer>
<NatureOfTransactionBVer>2005</NatureOfTransactionBVer>
<CountyVer>1</CountyVer>
<LocalityVer>06/2006</LocalityVer>
<UnitVer>1</UnitVer>
</InsCodeVersions>
</InsNewArrival>
Thanks.
kale

Similar Messages

  • How to add attribute to the elements in XML file in BPEL transformation

    Hi All-
    I have to create a XML file using transformation and file adapater and the parent element is USERRECORDS, now when I am creating the XML file using transformation the XML get creates like
    <?xml version="1.0">
    <USERRECORDS>
    so on
    But I want the parent element and the xml version tags as:
    <?xml version="1.0" encoding="UTF-8"?>
    <USERRECORDS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd">
    as I need to add the attributes.
    Is it possible in transformation?
    Any idea, please suggest.
    Thanks and Regards,
    Sreejit

    I have never come across any functionality like that.
    However I assigned values to attributes in Assign Acitivity using XML Fragment on source side.

  • Formatting XML Output

    How can I format the XML output I get from extract()?
    - get rid of new lines
    - get rid of indents
    - get rid of namespaces
    Thanks.

    You write some PL/SQL or Java code yourself to do so. We'll provide the capability to turn off the indent & newline stuff in a future release. I'm at a loss to understand why you would want to turn off namespace declarations though--they change the semantics of the data.

  • Formatting XML output as hierarchical vs detail

    Thank you for clicking into this thread, given the vague subject. I didn't know how to best word it.
    My query to produce a list of search terms and related category is;
    SELECT XMLElement("SEARCH_TERM"
    ,XMLAttributes(search_category as "category")
    ,search_term
    ) AS result
    FROM t1;
    Results;
    <SEARCH_TERM category="a">123</SEARCH_TERM>
    <SEARCH_TERM category="a">456</SEARCH_TERM>
    <SEARCH_TERM category="b">789</SEARCH_TERM>
    How can I write this query to get the following results?
    <SEARCH_CATEGORY name="a">
    <SEARCH_TERM>123</SEARCH_TERM>
    <SEARCH_TERM>456</SEARCH_TERM>
    </SEARCH_CATEGORY>
    <SEARCH_CATEGORY name="b">
    <SEARCH_TERM>789</SEARCH_TERM>
    </SEARCH_CATEGORY>
    Happy Holidays.

    #1. Please read posting guidelines regarding database version, and code samples...
    SQL> drop table T1
      2  /
    Table dropped.
    SQL> create table T1
      2  (
      3    search_category VARCHAR2(10),
      4    SEARCH_TERM VARCHAR2(10)
      5  )
      6  /
    Table created.
    SQL> insert into T1 values ('a','123')
      2  /
    1 row created.
    SQL> insert into T1 values ('a','456')
      2  /
    1 row created.
    SQL> insert into T1 values ('b','789')
      2  /
    1 row created.
    SQL> set long 1000 pages 50
    SQL> --
    SQL> select XMLSERIALIZE
      2         (
      3           DOCUMENT
      4           xmlElement
      5           (
      6             "SearchCatergory",
      7             xmlAttributes(SEARCH_CATEGORY as "category"),
      8             xmlAGG
      9             (
    10               xmlElement("SearchTerm",SEARCH_TERM)
    11             )
    12           )
    13           AS CLOB INDENT SIZE=2
    14         )
    15    from T1
    16   group by SEARCH_CATEGORY
    17  /
    XMLSERIALIZE(DOCUMENTXMLELEMENT("SEARCHCATERGORY",XMLATTRIBUTES(SEARCH_CATEGORYA
    <SearchCatergory category="a">
      <SearchTerm>123</SearchTerm>
      <SearchTerm>456</SearchTerm>
    </SearchCatergory>
    <SearchCatergory category="b">
      <SearchTerm>789</SearchTerm>
    </SearchCatergory>
    SQL>
    SQL>XMLAGG is 'GROUP' function, so can be comibined with a GROUP BY...

  • Need to add custom button (xml) in VA05

    I need to add a custom button (xml) to report output layout of VA05. Even the corrsponding functionality needs to be written for this button. Without changing the SAP standard code using Access keys, is there any other functionality in which we can add the button and write the code.
    Please send me detail steps in this regard.

    Hi Ramesh,
    As i knoew in case of va05 there is no badi or exit available to achieve this functionality.There is a provision to add some fields in report out put.I hope this is possible through a custom one.
    Regards,
    Madhu

  • Having a xml output with custom xml tags

    Hi All,
    I have a requirement where we need to generate an xml output with a custom set of tags as given below.
    <templates>
    <list>
    <List_no></list_no>
    <List_name> </List_name>
    </List>
    </templates>
    I am not sure how to get the list part as tags within tags.
    I am able to get the output if the tag level is just one level like ,
    <templates>
    <List_no></list_no>
    <List_name> </List_name>
    </List>
    </templates>
    Does anybody know how I could get the multi-level tags. Any help would be much appreciated. Thank you all.
    -Vin

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Payment Format Program Output in XML

    Hi All,
    I am trying to create a new payment format and should display the output in XML.
    For this I created a PL/SQL procedure , created my tags and displayed the out put in XML format. Using this I created one RTF template and did the data def and data Template.
    I defined the payment format, programs and a document.
    When I run the payment batch using this format , It says no output is generated.
    But the xml output is generated, the template is not shown as attached.
    If I run the concurrent program alone of the payment format I can see the template attched and the output generated in XML.
    BUt when I run the same through a payment batch selecting the document from which the program format is run it does not seem to take the template and hence no output even though there is XML.
    Can someone throw some light.
    Thanks.

    Hi,
    I got it...Now I am able to generated the output in PDF.
    It is a 2 step process, I had to submit XML Report Publisher Program once the format program is run so that it picks the tempalte and generates the output.
    So, Now is there a way to skip this 2 step process ?
    coz finally I have to print the out of the format to a printer.
    Thanks
    Edited by: user576422 on Oct 21, 2008 2:22 PM

  • How to add prefixes to xml output?

    Does anyone know a quick and easy way to add a namespace prefix to an xml document when you output it as a string?
    i'm looking for somethinglike this.
    <Order xmlns="http://www.something.com/name">
       <item>sink</item>
    <Order>
    converted into
    <dof:Order xmlns:dof="http://www.something.com/name">
       <dof:item>sink</dof:item>
    <dof:Order>
    I have attempted to use the xmlText method on the XmlObject class passing in an XmlOptions object with setSaveSuggestedPrefixes() set to my hsahmap with the namespace and prefix, however nothing happens. Well, sometimes it works and other times it does not.
    It seems that it works when i programatically build my xml using XmlObject methods, but it fails when i parse an existing xml string into the XmlObject using parse(String).
    Any help would be appreciated. I can't find any detailed help anywhere.
    Thanks
    Jeremy

    You can achieve your requirement using XSLT maaping on XML. Read more about XSLT mapping. Also read more about WordML processing tool by Microsoft.

  • Customized formatting in XML publisher

    HI,
    I just want to know if customized formatting is possible in designing the templates in BI publisher.
    e.g if i want the report to be displayed with some different formatting features in html and different in EXL
    grid line off in html and with grid lines in EXL
    Can some sort of coding be done to achieve this
    PLease help its urgent
    Thanks
    Isha

    Hi Isha
    Today Excel and HTML output are actually the same file but the mime type is set to force either a browser or Excel to open it. Now the template is aware of its final output so you could put some logic into the template to check this.
    you need to declare the parameter
    <?param@begin:_xf;'None'?>
    then in your outut you can refer to that value e.g.
    <?if:$_xf='HTML'?>
    <?end if?>
    etc
    Regards
    Tim

  • XML output File Format change

    Hi experts,
    I am currenty getting below output in my XML file and it is wrapped in message type MT_Test.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Test xmlns:ns0="http://test.com/xi/T1/Data">
    <Tests>
    <schemaLocation>http://tempuri.org/TestSchema.xsd F:/documentation/MID/Release-Test/TestSchema.xsd</schemaLocation>
    <Test>
    <HeaderID>This is a string 1</HeaderID>
    </Test>
    </Tests>
    </ns0:MT_Test>
    and I want to change it to the below format.
    <?xml version="1.0" ?>
    <Tests xmlns="http://tempuri.org/TestSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/TestSchema.xsd F:/documentation/TEMP/Release-Test/TestSchema.xsd">
    <Test HeaderID="RES-996-25885-527">
    </Test>
    </Tests>
    Request you to give your inputs on how I can achieve this?

    Hi ,
             You need a java mapping to produce exactly the output you posted here.
    I assume you r working with PI 7.1 here is the java mapping code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class FormatXML extends AbstractTransformation{
         public void execute(InputStream in, OutputStream out)
         throws StreamTransformationException {
              try{
              // TODO Auto-generated method stub
              DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
              DocumentBuilder builderel=factory.newDocumentBuilder();
              /*input document in form of XML*/
              Document docIn=builderel.parse(in);
              NodeList l=null;
              String schemaLocation="";
              l=docIn.getElementsByTagName("schemaLocation");
              if(l!=null)
                   schemaLocation=l.item(0).getTextContent();
                   schemaLocation=schemaLocation.replaceFirst("/MID/", "/TEMP/");
              String outPut="<?xml version=\"1.0\" ?><Tests xmlns=\"http://tempuri.org/TestSchema.xsd\" " +
                                  "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
                                  "xsi:schemaLocation=\""+schemaLocation+"\">"
                                  +"<Test HeaderID=\"RES-996-25885-527\">"
                                  +"</Test></Tests>";
              out.write(outPut.getBytes("UTF-8"));
              catch(Exception e)
                   throw new StreamTransformationException(e.getCause().toString());
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   FormatXML genFormat=new FormatXML();
                   FileInputStream in=new FileInputStream("C:\\Apps\\sdn\\format.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\sdn\\format1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void transform(TransformationInput arg0, TransformationOutput arg1)
                   throws StreamTransformationException {
          this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
    If you are new to java mapping pls follow this  http://www.****************/Tutorials/XI/Mapping/Index.htm
    You need to install eclipse and java 1.5.0 for PI 7.1. You also need proper library files for PI 7.1 which you need to download from PI server. Please follow this link http://wiki.sdn.sap.com/wiki/display/XI/WheretogetthelibrariesforXI+development
    Regards
    Anupam

  • Xml output format in sql*plus problem

    Hi all,
    In stead of seeing xml output in multiple line format, my sql*plus always returns xml output in ONE line, is there a way to change the format, it's really hard to read.
    Thanks
    1 select xmlelement("row", xmlelement("user", xmlattributes(username as "name", default_tablespa
    2 from dba_users
    3* where rownum=1
    SQL>/
    XMLELEMENT("ROW",XMLELEMENT("USER",XMLATTRIBUTES(USERNAMEAS"NAME",DEFAULT_TABLES
    <row><user name="SYS" tbs="SYSTEM"></user></row>
    however I want to see something well formatted like
    <row>
    <user name="SYS" tbs="SYSTEM"></user>
    </row>

    Not sure if there are any settings with the SQL*PLUS but if you use packages other than the SQLX operators like DBMS_XMLQUERY, DBMS_XMLGEN, SYS_XMLGEN to generate xml then the output is as desired.
    select dbms_xmlgen.getxml('select username, default_tablespace from dba_users
    where rownum=1') from dual
    DBMS_XMLGEN.GETXML('SELECTUSERNAME,DEFAULT_TABLESPACEFROMDBA_USERSWHEREROWNUM=1'
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <USERNAME>REVIEW</USERNAME>
    <DEFAULT_TABLESPACE>METRICS</DEFAULT_TABLESPACE>
    </ROW>
    </ROWSET>
    But these packages does not offer the flexibility you have with SQLX operators.
    so if you requirement is simple generation you can use the above method.

  • How to add attributes in the xml tag

    hi,
    i have two tables employee,department
    employee table
    empno number,
    empname varchar2(100),
    deptno number,
    department table
    deptno number,
    deptname varchar2(100)
    i want xml file in the above mentioned two tables.The xml file is as follows,
    <?xml version="1.0" encoding="UTF-8" ?>
    <EmployeeInfo>
    <Data type="employee">
    <empno>1</empno>
    <empname>siva</empname>
    <deptno>10</deptno>
    </data>
    <Data type="department">
    <deptno>10</empno>
    <deptname>IT</empname>
    </data>
    </EmployeeInfo>
    can anybody please give plsql code for this requirement.i need to add attributes in the xml tag.Its urgent
    By
    Siva

    A general example (based on the OE sample data/tables)
    SQL>SELECT XMLElement("Emp",
      2                     XMLAttributes(employee_id AS "id"
      3                                  , '10' "dept"),
      4                     first_name||' '||last_name) as result
      5 FROM   employees e
      6 WHERE  department_id = 10;
    RESULT
    <Emp id="200" dept="10">Jennifer Whalen</Emp>

  • Add (concatenate) a string to the end of a numerical field value (custom format script)?

    Hello All!
    1) I have a form field where a customer can input mileage (e.g. 48,000)
    I would like to be able to dynamically place the comma in the proper place as well as add " miles" to the end of the value the user input.
    For example:
    If the user types "123456" into the field, I would like for it to display as "123,456 miles"
    I assume this will require some custom format javascript... I'm familiar with the general syntax of JavaScript, but don't really know specific keywords/object names to use, I have a few custom calculation scripts in the form, and I've done some simple thing like concatenate two fields into one, etc.
    But this is a little different, because I'm only working with data from one field. I tried:
    event.value += " miles";
    However, this causes " miles" to get added everytime ANY field changes... so I end up getting "123,456 miles miles miles miles" as the user makes changes to other fields.
    2) Also, to further complicate things, is it possible to "remove" the custom formatting when the field gains focus? For example, if you use Acrobat's default number format ($1,394.00) on a field, when the user selects that field to edit the value, the formatting "disappears" so that the user would only see "1394".
    I would like to achieve the same with my custom field, so when the user selected the field that displays "123,456 miles" to change the value, they would only see/edit "123456"
    A bit wordy, I know, but thanks for any help!

    Here's a simple way. Begin by creating a new document-level JavaScript and include the following code:
    function my_format() {
        // Format number (no decimal point, comma thousands separator, etc.)
        AFNumber_Format(0, 0, 0, 0, "", false);
        // Add " miles" if there is an entry
        event.value = event.value ? event.value + " miles" : "";
    function my_keystroke() {
        // Restrict entry to characters consistent with a number
        AFNumber_Keystroke(0, 0, 0, 0, "", false);
    For the field in question, add the following as the custom Format script:
    my_format();
    and the following as the custom Keystroke script:
    my_keystroke();
    George

  • Add a custom field in output tab of po header SRM 7.0

    Hello All,
    Please let  me know How to add a custom field in output tab of po header SRM 7.0.
    Regards,
    Neelima

    Hello Neelima,
    Have you already check the note 458591, which help to custom fields creation? I think this note can be relevant for you.
    Best regards,
    Denise Zanuz

  • Converting Sequence (XML format presaved) to my CUSTOM format?

    Hi Experts!
    I need Teststand Style Sheet for  XML. (e.g. TAGS explanation when you saved your sequence in XML's format)
     For example when I saved TestStand's sequence at XML format previously I got: __________________________________________________​___________ Main classname='Objs' valueflags='4194304'><value lbound='[0]' ubound='[]'/></Main><Setup classname='Objs' valueflags='4194304'><value lbound='[0]' ubound='[]'/></Setup><Cleanup classname='Objs' valueflags='4194304'><value lbound='[0]' ubound='[]'/></Cleanup><GotoCleanupOnFail classname='Bool' valueflags='4194312'><value>false</value></GotoCleanupOnFail><RecordResults classname='Bool' valueflags='4194312'><value>true</value></RecordResults> __________________________________________________​___________ I would like to know what EVERY of tags (<value>,<Main>,<GotoCleanupOnFail> ….and many others) means??? e.g. you can say that <value> is a tag that responsible for the LOOP value.    I need to deal with tags because I want from the present XML saved sequence to build my custom sequence in my CUSTOM format (e.g. TO CONVERT TestStand’s sequence to other format)
    Any ideas? any suggestions?
    Thank you!!!
    Thank you & Best Regards
    *I use LabVIEW 8.X & TestStand 3.5/4.0.1 versions only
    Solved!
    Go to Solution.

    TestStand does not support saving sequence files in other formats than the predefined formats (ini, binary and xml). So you have two different choices:
    a) Write a tool which converts one of the sequence file types into your custom format. This enables you to export the sequence to custom tools, but needs quite some work.
    b) Use "Sequence File Translator".  You can find info on this in the TestStand Reference Manual in chapter 15.
    Regarding b) i want to tell you some more things here in this post:
    - You can use it only to important any format into TestStand, not the other way round. So this is designed for customers who create sequences outside of TestStand but want to use it in TestStand for execution.
    - It requires the knowledge of the file layout you want to convert. You have write an DLL as described in the manual.
    - Changes done to the sequence within TestStand will never be saved back into the original file. You can save the sequence in a new TestStand sequence file though.....
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for