How to transform to custom xml format

Hi all,
I already transform my flat file to xml using xquery transformation, the result is shown below :
<investment>
<member>001</member>
</investment>
now I need to change the format like this :
<Message name="investment">
<Field name="member">001</Field>
</Message>
How can I do this using xquery transformation or other way?
Really thanks in advance.
Mr.K

Hi Dwivedi,
Actually I don't need first format, it formed because I don't know to format to the second one.
is it possible if I wanna transform to the second format directly using xq transformation?
This is my current .xq file :
(:: pragma bea:mfl-element-parameter parameter="$investment1" type="investment@" location="../MFL/investment.mfl" ::)
(:: pragma bea:global-element-return element="ns0:investment1" location="investment.xsd" ::)
declare namespace ns0 = "http://www.example.org/investment";
declare namespace xf = "http://tempuri.org/OSBFundSeparation_Project/Xquery/investment/";
declare function xf:investment($investment1 as element())
as element(ns0:investment1) {
let $investment0 := $investment1
return
<ns0:investment1>
let $investment := $investment0/investment[1]
return
<ns0:investment>
<ns0:member>{ data($investment/member) }</ns0:member>
                              </ns0:investment>
</ns0:investment1>
declare variable $investment1 as element() external;
xf:investment($investment1)
Really thanks in response.

Similar Messages

  • How do you differentiate IDOC XML format and ordinary XML format

    how do you differentiate IDOC XML format and ordinary XML format since they are used by IDOC adapter and RFC adapter???

    Hi,
    Cremas Structure starts with Header and followed by Segments...
    Normally it begins like this
    <CREMAS03><IDOC BEGIN="1">
    The second node is Idoc in the header..
    Thanks
    Anju

  • How to map data in xml format to BAPIs tructures?

    A webservice call to an external system from XI, is returning data to XI in xml format.
    This needs to be formatted to map to the structure of BAPI from SAP.
    I searched and found several threads pointing to do transformations.
    But I am not sure where to start. So this thread is being posted.
    Please help.
    Thanks,
    Ven

    The thing is my data is being retrieved from webservice call a bit different.
    here is the sample data that I need to map to two structures of BAPI - Housinginfo, Houseresponsersults.
      <?xml version="1.0" encoding="utf-8" ?>
    - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <soap:Body>
    - <GetResidentsResponse xmlns="http://empur.org/XLSWebSvc/XLS_Interface">
    - <GetResidentsResult>
    - <Residents xmlns="">
    - <Resident LastName="Xyz" FirstName="Abced" MiddleInitial="T" STX="1234567" Houseid="45622" SubDivName="xyz homes">
    - <Houses HousesName="villa ben" HousesId="1550" HousesStatus="P" HousesStatusDate="09/22/2009 15:26:54" HousesScore="90">
      <Street StreetCode="2538" StreetName="Victoria" StreetStatus="c" StreetStatusDate="09/22/2009 12:25:38" />
    - <Street StreetCode="2539" StreetName="Vicotria Ln" StreetStatus="p" StreetStatusDate="09/22/2009 15:26:54" StreetScore="90" ProctorID="3572" OwnerName="DONNA Perl">
      <HomeInteractions HomeNum="25873" ResidentResp="C" LayoutLawn="C" Judged="c" />
      <HomeInteractions HomeNum="25884" ResidentResp="B" LayoutLawn="B" Judged="c" />
      <HomeInteractions HomeNum="25896" ResidentResp="B" LayoutLawn="B" Judged="c" />
      <HomeInteractions HomeNum="25918" ResidentResp="D" LayoutLawn="D" Judged="c" />
      <HomeInteractions HomeNum="25919" ResidentResp="D" LayoutLawn="D" Judged="c" />
      <HomeInteractions HomeNum="25924" ResidentResp="A" LayoutLawn="A" Judged="c" />
      <HomeInteractions HomeNum="25948" ResidentResp="t" LayoutLawn="t" Judged="c" />
      <HomeInteractions HomeNum="25952" ResidentResp="C" LayoutLawn="A" Judged="w" />
      <HomeInteractions HomeNum="25953" ResidentResp="C" LayoutLawn="C" Judged="c" />
      <HomeInteractions HomeNum="25954" ResidentResp="D" LayoutLawn="D" Judged="c" />
      </Street>
      </Houses>
      </Resident>
      </Residents>
      </GetResidentsResult>
      </GetResidentsResponse>
      </soap:Body>
      </soap:Envelope>

  • How to get well structured XML format in application server ?

    Hi Experts,
                    I have developed program to download XML format in application server. The below format which i am getting in
    application server :
    <?xml version="1.0" encoding="utf-16" ?> - <asx:abap xmlns:asx="http://www.sap.com/abapxml"  version="1.0">asx:values>- <TAB>- <item>  <EBELN>4151503309</EBELN>   <BUKRS>1000</BUKRS>
      <VENDOR>T-K515A09</VENDOR>   <EKORG>1000</EKORG>  <EKGRP>001</EKGRP>
    But i want the format like  below one which i am getting when i am downloading presentation server . I want it to achieve
    in application server.
    <?xml version="1.0" encoding="utf-16" ?>
    - <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    - <asx:values>
    - <TAB>
    - <item>
      <EBELN>4151503309</EBELN>
      <BUKRS>1000</BUKRS>
      <VENDOR>T-K515A09</VENDOR>
      <EKORG>1000</EKORG>
      <EKGRP>001</EKGRP>
    Pls anyone help me out regarding this.
    Thanks
    Ramesh Manoharan

    Hi
       I am new to transformation ( strans ) .Pls send me if you have any document. Is it possible to get below format in application
    server using transaction STRANS ?
    <?xml version="1.0" encoding="utf-16" ?>
    - <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    - <asx:values>
    - <TAB>
    - <item>
    <EBELN>4151503309</EBELN>
    <BUKRS>1000</BUKRS>
    <VENDOR>T-K515A09</VENDOR>
    <EKORG>1000</EKORG>
    <EKGRP>001</EKGRP>
    Thanks
    Ramesh Manoharan

  • How to create new Custom XML Report without using Form Builder

    Hi,
    What are the steps to create new Custom XML Report without using Report Builder ?
    Thanks and Regards,
    Abhi

    Hi,
    Steps we now follow
    1)Create Data Model in Reports Builder
    2)Create xml
    3)Insert xml in Publisher to build Fomat
    4)FTp rdf
    5)Create Data Definition and Template
    6)Create executable and Concurrent Program
    Is there any way we can build reports without use of Report Builder ? By writing PL SQL Package for Before Report and After Report etc ...
    Thanks and Regards,
    Abhijit Rode

  • How to create a custom xml-page?

    Hi,
    I am trying to create a page that renders a xml format. For this, I created a page template in which I want to have an empty Header. Apex complains that the header is required and that the line <head>#HEAD#</head> should be included.
    The result is that the xml is not valid.
    Any ideas?

    JoepH wrote:
    I am trying to create a page that renders a xml format. For this, I created a page template in which I want to have an empty Header. Apex complains that the header is required and that the line <head>#HEAD#</head> should be included.
    The result is that the xml is not valid.
    Any ideas?Rather than an APEX page, use an On-Demand Process if your XML is generated using PL/SQL, or a report with the export: XML template if it's produced in SQL.

  • How to regenerate output in XML format after having assigned RTF Template

    1. I created a concurrent request to get the output in XML data format
    2. Having created RTF File and assigned Data Definition and Template through XML Administartor Responsibility
    3. Now I want to make changes in Data Definition XML File, However I need to get the output file in XML data format, However Concurrent Request is not allowing me to get the XML output because Template is already assigned for the output and not able to de-assign template file from concurrent request.
    For some reason in XML publisher, the end date for Template is disable, I am not able to update end date for template.
    Is there any way to create an output in XML format through concurrent request after Template File is assigned to create an output? I will appreciate your help.

    This is for people who want to know more in detail. Problem is if you put end date then you have to recreate an entry and then have to go through the same process. However I have found a way to use the same file,
    Get the template_id by running the following query
    select * from xdo_templates_b
    where template_code = 'TEMPLATE_CODE'
    Run the following query to update the end_date to some previous date value
    update xdo_templates_b
    set end_date = to_date('6/9/2011','mm/dd/yyyy')
    where template_id = 162
    After that when you run request through concurrent request, it will not show the default template assigned to concurrent request. Run the request, output will be created in XML format.
    Run the following query to use the template again
    update xdo_templates_b
    set end_date = null
    where template_id = 162
    Edited by: user9941374 on Jun 10, 2011 9:20 AM

  • (How) can TLF recognize custom attributes/format/data?

    Is there anyway we can associate custom data with specific range/span/elements of text?

    The FlowElement class, which is the base class for all elements that make up a TextFlow in TLF, has the ability to store 'custom' data in at least three places:
    1. The 'id' property.  The 'id' property is a simple string property on all FlowElement descendents.  You can set it directly on the flow elements or by using the ApplyElementIDOperation through the EditManager of the TextFlow containing the element.  There are some methods on TextFlow for locating elements by their ID (recursive iteration over the child elements).
    2. The 'stylename' property.  The 'stylename' property can be utilized to implement named styles for text formats, etc., possibly in conjunction with a class that implements IFormatResolver.  Although it's intended for that type of behavior, it could be used for other purposes.  The TextFlow class has some utility methods to find elements by stylename, etc., so it can be a useful way to attach a 'category' or other designation to certain flow elements that you would like to locate as a group or things along those lines.  Similarly to the 'id' property, 'stylename' can be set directly on flow elements or via the ApplyElementStyleNameOperation.
    3. User styles.  Every flow element has the capability to store key/value pair user data via getStyle()/setStyle() methods.  There is also a corresponding operation called ApplyElementUserStyleOperation for user styles.  This is the most flexible way to add additional data to flow elements.  You can put almost anything you like in here.
    See ASDoc API Reference for the FlowElement class here:
    http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flashx/textLayout/ elements/FlowElement.html
    There are some notes (outdated, but still somewhat useful) from back when these capabilities were added to TLF in this blog post:
    http://blogs.adobe.com/tlf/2009/02/tlf-api-changes-in-build-370-1.html
    Keep in mind that if you set id/stylename/userstyles on a flow element directly (without using an operation via the edit manager), that causes a model change to be dispatched up through the TextFlow, which causes 'damage'.  This is not a big deal, but you would need to call compose/update methods on the flow composer manually to recompose the TextFlow after the 'model' changes.
    One other thing to keep in mind is that if you are using an edit manager that has an undo manager assigned, any changes that are performed via operations are automatically undoable/redoable.  You can also avoid some of the headache that will result if you try to modify the flow elements directly, as mentioned in the previous paragraph.  The edit manager will automatically trigger composition after an operation is performed.
    And another thing is inheritance.  Certain styles and properties are inherited down the text flow child tree.  I believe that includes user styles.  If you decide to use any of these methods for storing custom data, you'll probably want to understand how the inheritance is going to affect what you're trying to implement before you go too far.  I don't have a good enough grasp on inheritance rules to give you an understandable explanation.
    Hope this helps.  My info may not be 100% accurate, but this is what things look like for custom data from my point of view.
    Good luck,
    Brent

  • How to not change the XML format

    I have a script that configures an XML document within a zip file. I unzip the file, load the xml doc into the script. Edit values then rezip it. 
    This works fine, but when I attempt to submit this to the device I am working on it returns an error. After checking the doc the only thing I can assume is going wrong is that the document is formatted by Powershell in such a way it can no longer be understood
    by the device. 
    To resolve this I have added the .PreserveWhiteSpace and set it to true. This also works, but when I do a comparison, character by character space I notice that there are whitespaces being added within certain xmlnodes. How do I stop this from happening?

    Can you post your script and a template XML, and show where the white spaces are being added?
    We can't see what your code or XML look like if you don't share it.
    Solved. Turns out it was something to do with the zip and not the script.

  • How to download data in xml format from a jsp in IE

    In my program, I am trying to download xml data from jsp. The problem I am facing is that the downloaded page opens in the browser itself. I want it to open in a new page. The same code works fine with csv and pdf format.

    Hello
    I am using a link that calls a javascript function. To show the file download box, I have used setContentType and setHeader functions in the jsp. Thanks.

  • How to create a Customized Page format?

    Hi Experts,
    Page size is ht- 278mm, width - 242 mm.
    Printer - EPSON LQ-680 (Dot Matrix Printer)
    Paper - Preprinted Stationary ( For Invoice Printing)
    As per the comments I have followed the below steps for my page format.
    From SPAD Transaction,
    1. Created Page format -
    Page Format ZINV_JGT
    Orientation as - Portrait
    Width 242 Unit MM
    Height 278 Unit MM
    2. Created Format type
    Format Type ZINV_JGT
    Type Format type for sap script
    Page Format ZINV_JGT Orientation - Portrait
    Comment Page format for JGT Invoice
    3. Created Device type
    Version 1
    Device type ZINV_JGT Name Device driver Invoice print
    Driver SAPlpd/SAPWIN driver 3.0
    Printer Driver Do not printer driver for ABAP list Print
    Character Set 1135 Printer EPLQ550 ASCII multilingual
    4. When to format for device
    Then created a format zinv_jgt
    I get the below options in this tab. What code i need to write here.
    Printer initialization
    Reset after exit
    Cover page
    First Page
    Start of even page
    Start of odd page
    Start of page
    End of first page
    End of even page
    End of odd page
    End of page
    Start of line on an even page
    Start of line on an odd page
    Start of line
    End of line on an even page
    End of line on odd page
    End of line
    Please check whether the above steps and the data filled is correct for my type of page format.
    Please help me on this.
    Thanks and Regards,
    Abdur Rafique

    Hi Alexander,
    I was not able to add the code in the Printer initialization and the other following steps.
    Printer initialization
    Reset after exit
    Cover page
    First Page
    Start of even page
    Start of odd page
    Start of page
    End of first page
    End of even page
    End of odd page
    End of page
    Start of line on an even page
    Start of line on an odd page
    Start of line
    End of line on an even page
    End of line on odd page
    End of line
    Please tell me what data i need to add? I think the above steps are used to define the format of the page.
    Please help me on this?
    If i give a print command without the code in the format type. I'm getting the following error.
         Device type SAPWIN does not support page format
         ZINV_JGT.
    Regards,
    Abdur Rafique

  • Cross references in custom XML

    Hello!
    We have a custom XML schema and a structured application that allows us to edit our XML documents in FM. The schema contains a definition for a cross reference element and a definition for a target element.
    =============================================================
    Example:
    A cross reference element (say, documentA.xml contains this element): <cref target="documentB.xml#sect123"/>.
    A target element (say, documentB.xml contains this element): <section id="sect123"/>.
    Also I have a book in FM that includes both documentA.xml and documentB.xml.
    =============================================================
    FM outputs error messages when I try to save documentA.xml.
    So, I have few questions concerning this issue.
    How should I describe the cref element in EDD?
    A manual says, that the @target attribute must be of the IDREF type. Sounds good but the # char is restricted for IDREF values. How can I resolve this contradiction? If I write <cref target="sect123"/> (target id without filename) FM outputs error messages when I open documentA.xml in FM.
    Thank you!

    Dear Russ,
    Thank you very much for the answer. I'm sorry for my replying you with a delay,
    To make long story short, now it's OK: we can load a document with cross references to FM as well as we can save it form FM. Thank you once more.
    I'd like to make some comments that might be useful for other readers of this forum.
    As far as I understand the Structure Developers Guide mostly describes import/export transformations between an XML format and the FM format. But we never convert XML files to FM files and vice versa in our application. We open an XML file in FrameMaker, we edit the XML file in FrameMaker, and finally we save the XML file from FrameMaker. So, while reading the Guide I had a permanent doubt if import/export is the case I deal with.
    After several probes and attempts we found out that the following format of cross reference is appropriate for our application:
    <xref srcfile="fm-properties.xml#sys_psnt_part_number" format="CrossReference"/>
    (We found this type of cross references on page 399 of the Guide).
    The xref element must have an attribute of the IDREF type defined in a schema and in an EDD even while we don't use it. This attribute may actually be omitted in an XML file but we had to define it for xref.
    The root element of a target XML document must have an attribute of the ID type even while we don't use it.

  • Custom XML Document over AS2

    Hi All,
    We are planning to send Custom XML Document over HTTP(AS2) to the Remote Trading Partner. The XML Document needs to be posted to a particular URL in the Remote Trading Partner Site.Here is the process flow:
    1. The input application format file having the messages will be transformed to an XML message in BPEL.
    2. Then as per the set-ups done in B2B, this particular XML message needs to be posted to a URL.
    I went through the B2B User's Guide but could not find any documentation on how to set up Custom XML Document over HTTP(AS2).
    Could you please share the documents/technical notes or link which I can refer to do the set-ups in B2B.
    Please let me know. Thanks In Advance.
    Regards,
    DIbya

    Hi Nandu, Ramesh,
    We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
    Our Business Case is as follows:
    1. Read the Flat File using BPEL File Adapter
    2. Transform the Message in BPEL and send it to B2B
    2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
    http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
    In the B2B Set-Ups, I have done the following:
    Business Protocol name: Custom Document over Internet
    Exchange Protocol: AS
    Document Protocol: Custom
    Transport Protocol: HTTP-1.1
    Host name : http://databridge.buy.datastream.net
    Port: 5555
    I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
    "Unable to get schema information for target".
    Hence I am not able to map the message in BPEL and send it to B2B.
    Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
    As always, your help and guidance is highly appreciated.
    Thanks,
    Dibya

  • Crystal Report 2008 SP2 & InfoView: Custom XML Export doesnt work

    Hi,
    I have created a Crystal Report .rpt and want to use the custom xml export function to output a custom xml file. For that, I created a custom transformation file (xsl) and imported it into the .rpt . On the client machine, if I open the .rpt with Crystal Reports 2008 SP2, and select to export it using the custom xml output, all runs fine. (under SP1, only half the file was created...)
    If I upload the .rpt file to Infoview (server-side: BO Enterprise 3.1, SP2 as well) and schedule it, I can select xml, and then my custom xml as output format, but I am getting the error message u201EUngültige Exportoptionen" (="invalid export options"), in the instance history. No output file is created. I use file system as destination. Other output formats like .pdf and .rpt work fine and files are created.
    Ideas:
    -Are there any more settings needed on the server (e.g.CMC - Crystal Server Jobs, other Processes, ...) so I can schedule the report and successfully create the custom xml format file as output?
    -Do I need to upgrade to a specific SP or FP on server-side so everything runs smooth?
    Thanks for your help!

    Hi Florian,
    I'm having the same problem, have you by any chance found a solution?
    Gajus.

  • How do you delete an  XML template?

    Does anyone know how to remove a custom XML template? I'm using 11.5.10 Rollup 2. I created an RTF template for AP Checks. But I've discovered that using a PDF template will be better suited to our needs. I can not change the template type to PDF. I deactivated the template, and tried to create a new template using a different template name , and code. I also created a new data definition using the new code. But when I try to save the new template I receive an error: "A template file already exists for this language/territory combination. Please use the update file option." I dont see an 'update file' option on this screen. I went back and tried to update the template by deleting the sample file, but it says "Delete button disabled". Does this mean, that I can only assign one template for the English/United States combination?! This is not a seeded template. How do I go about removing this template, so that I can set up a new one using the desired format. I've searched the net, but can't find any answers... Thanks in advance for any help. Thanks!

    Hello Dan.
    I never figured out how to delete a template.
    However, now that I think about it, you may be able
    to get around it. But you may have to jump through a few hoops first :)
    Using System Administrator..
    Try making a copy of the Concurrent Program.
    (Go to Concurrent >> Program >> Define)
    Query the existing program, then click the 'Copy To' button.
    Change the Short Name slightly.
    Be sure to check the "include parameters" and "include incompatible programs" boxes.
    You will also need to make a copy of the actual rdf file and rename it slightly.
    (In a subdirectory of $APPL_TOP i.e. /?/oracle/visappl)
    Then you would register your new report executable (Concurrent >> Program >> Executable).
    Once the new report executable has been registered, you can go back to your
    new Concurrent Program, and change the executable name to the one you just registered.
    Also, be sure to assign your new report to the same responsibility report group as the original
    (Concurrent >> Security >> Responsibility >> Request).
    Now, essentially you have cloned the original report, and you should be able to create a new RTF template for it. If you need more detailed steps, I may have some documentation for customizing reports somewhere.
    Good Luck!
    Mark K

Maybe you are looking for