Applying REGEX-pattern into XML File

I have the following problem:
I have an xml-file. let's say...
<NODE><NODE1 attr1="a1" attr2="a2">
     <NAME> abc</NAME>
     <VERSION> 1.0</VERSION>
</NODE1>
<NODE2 attr1="a3" attr2="a4">
     <NAME> xyz</NAME>
     <VERSION> 3.1</VERSION>
</NODE2></NODE>I need to know "HOW can I get the values of <NAME></NAME> and <VERSION></VERSION> without using DOM.
Since my xml-file is pretty big and DOM will take much Memory, i want to avoid it.
Can anybody suggest some "Regex pattern" so that i can apply it on the xml-file (after converting into String)
Thanks in Advance

That worked perfectly. I assumed ( insert comment here ) that the members of the Properties objects were Strings, and therefore followed the same rules where "\" characters are concerned.
Thank you for pointing out the difference between the two objects, I am not sure how long it would have taken me to figure that out.
Regards,
John Gooch

Similar Messages

  • Why we need to conver Context  Node data into XML file----Export to Excel

    Hi All,
    Let me clarify my dought........today i have gone through the concept of  "Exporting Context Data Using the Webdynpro Binary cache" in SAP Online Help.
    From the SAP Online Help pdf document, i have found that, the context node data has been converted first in to XML file,after that file had been stored in the web dynpor binary cache...bla....bla.........
    Here my qtn is why they had converted context node data into XML file. With out doing that can not we export context node data to excel file..?
    Regards
    Seshu
    Edited by: Sesshanna D on Dec 19, 2007 7:25 AM

    Hi Sesshanna,
    it is not neccessary to do that but xml has the advantage, that it can be easily transformed into every output format that might occur in later project stages.
    If it's simply about blowing out some Excel, I suggest using an OSS library such as jexcelAPI or Jakarta POI and building the Excel how you need it.
    regards,
    Christian

  • Insert Encoding tag into xml file. ?xml version="1.0"?

    I am using oracle 10g.
    I am using dbms_xmlgen.getxml function to generate xml data for oracle tables. I use utl_file to write data back into xml file.
    Oracle is generating the file in the following manner...
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <RSLT_ID>1</RSLT_ID>
    </ROW>
    </ROWSET>
    I want to change the following xml header to have encoding information in it as follows...
    <?xml version="1.0" encoding = "AL32UTF8"?>
    How do I achieve that?
    Any suggestions?

    I want to change the following xml header to have encoding informationIn 10g I think you could use a xmlroot hack:
    SQL> select xmlroot(xmlelement(e, dummy), version '1.0" encoding="AL32UTF8') xml from dual
    XML                                                    
    <?xml version="1.0" encoding="AL32UTF8"?>              
    <E>X</E>                                               
    1 row selected.

  • How can convert HTML file into xml file?

    Hi,
    I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard.
    Regards,
    mahesh.

    Use the HTMLEditorKit to parse the html file.
    this kit is having the callback methods which
    are called wenever the tag appears in the HTML
    stream.

  • How should convert text file into XML file?

    I do a project "WEB SERVER LOG ANALYZER" using JSP. For that i copy the content of log file into the other file . how i convert it into XML file . xplain with coding

    Read this [page.|http://www.devx.com/getHelpOn/10MinuteSolution/20356]

  • How to convert Xls file into Xml file

    Hi,
    I am trying to convert Xls file into Xml  but there  is no any direct procedure for it
    Pls help me out to convert Xls file into Xml file
    Thanks
    Anushree

    you will require to write a module in your file adapter for the same.
    ref: /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter as mentioned in the earlier post.
    Else you can also use Conversion Agent to read the same.
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/content.htm

  • How to convert database table into xml file

    Hi.
    How to convert database table into XML file in Oracle HTML DB.
    Please let me know.
    Thanks.

    This not really a specific APEX question... but I search the database forum and found this thread which I think will help
    Exporting Oracle table to XML
    If it does not I suggest looking at the database forum or have a look at this document on using the XML toolkit
    http://download-east.oracle.com/docs/html/B12146_01/c_xml.htm
    Hope this helps
    Chris

  • Writing into XML File in Flex

    Hi,
    I want to create a XML file (dynamically) and writes data
    into that xml file(data coming from web service).
    Thanks in advance.

    i want to write the data(coming from web service) into XML
    file and keep that XML file in Cache,then read that XML file
    contents and post into UI Control(Datagrid).
    <b>Sample Output Data from my Webservice:</b>
    <CoreProgramming>
    <BasicProgramming>
    <ProductId>10049</ProductId>
    <ProgrammingName>America'sTop60</ProgrammingName>
    <Price>29.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>false</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10041</ProductId>
    <ProgrammingName>America'sTop120</ProgrammingName>
    <Price>39.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DHLTH</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DISC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10045</ProductId>
    <ProgrammingName>America'sTop180</ProgrammingName>
    <Price>49.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DIY</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>LIME</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    </CoreProgramming>

  • Conversion of xls file into xml file

    Hi,
    i want to convert xls file into xml
    pls let me know the procedure for it
    Thanks

    Hi Anu,
    U can use FM <b>SAP_CONVERT_TO_XML_FORMAT</b> to convert data to XML.
    Or u can use some threads related to this FM. So that u can get better idea about this.
    Check this link also
    conversion of xls file into xml file
    regards,
    raghu

  • Can i download whole WD Abap scenario into XML File ?

    Hi,
    Experts,
    I want to download the WD( Web Dynpro ) Abap scenario into Xml file from one SAP server. by upload this xml file into another server(uploaded server) to create the WD abap scenario as it is in downloaded server. As like we download the report into xml using                              '  cl_gui_frontend_services ' class.
    through Transporting the request into that upload server i can do that but the thing is there is not communication between these systems. for that i am searching in this way.
    Thank you,
    Shabeer ahmed

    Hi Shabeer,
    This feature is not currently in the standard system. However there is a beta version of a plugin for exporting and importing Web Dynpro ABAP components.You would have to use the SAPLink program (ZSAPLINK) to export and import objects. Please go through this link to download the necessary stuff.
    [http://code.google.com/p/saplink/|http://code.google.com/p/saplink/]
    For any problems while uploading these nuggets into SAP you can post your queries [here|www.saplink.org].  Also refer to Thomas Jung's comments in [here|How to install the SAPlink plugins;.
    Regards,
    Uday

  • Outbound oracle data into xml file

    Hi Odie,
    Your previous inputs for xml inbound was working fine, in the similar way now I need outbound the oracle apps data into .xml file format. For that I've written one sample script like this. I thought of making use of the utl_file option in Oracle apps.
    declare
    l_log_handle UTL_FILE.FILE_TYPE;
    l_log_name varchar2(50);
    l_path_2 varchar2(40);
    l_global_file varchar2(50);
    l_time number:=1;
    cursor cur1 is
    select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual;
    --select menu_id from fnd_menus where rownum<100;
    begin
    BEGIN
    SELECT DECODE (INSTR (VALUE, ','),
    0, VALUE,
    SUBSTR (VALUE, 1, (INSTR (VALUE, ',', 1)) - 1)
    INTO l_path_2
    FROM v$parameter
    WHERE NAME = 'utl_file_dir';
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error while getting Unix Path ' || SQLERRM);
    END;
    l_log_name := 'XGBIZ_'||TO_CHAR (SYSDATE, 'YYMMDD')||l_time;
    l_log_name := CONCAT(l_log_name,'.xml');
    l_global_file := l_log_name;
    l_log_handle := UTL_FILE.FOPEN(l_path_2,l_log_name,'W');
    for cur2 in cur1 loop
    UTL_FILE.PUT_LINE(l_log_handle, cur2);
    end loop;
    utl_file.fclose_all;
    EXCEPTION
    WHEN UTL_FILE.INVALID_OPERATION THEN
    dbms_output.put_line('Invalid Operation For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_PATH THEN
    dbms_output.put_line('Invalid Path For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_MODE THEN
    dbms_output.put_line('Invalid Mode For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    dbms_output.put_line('Invalid File Handle '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.WRITE_ERROR THEN
    dbms_output.put_line('Invalid Write Error '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.READ_ERROR THEN
    dbms_output.put_line('Invalid Read Error '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INTERNAL_ERROR THEN
    dbms_output.put_line('Internal Error');
    UTL_FILE.FCLOSE_ALL;
    WHEN OTHERS THEN
    dbms_output.put_line('Other Error '||'SQL CODE: '||SQLCODE||' Messg: '||SQLERRM);
    UTL_FILE.FCLOSE_ALL;
    end;
    when running this script I am getting error
    ERROR at line 30:
    ORA-06550: line 30, column 2:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 30, column 2:
    PL/SQL: Statement ignored
    if in the cursor declaration happen to use 'select menu_id from fnd_menus ' a plain record then it is successfully creating.
    If tried again revert to actual select statement ' select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual'
    then its erring out as above said.
    Please give me your valuable inputs in this regard.
    Thanks & Regards
    Nagendra

    Hi,
    There are multiple ways to generate XML documents from relational data.
    Here are some :
    -- SQL/XML functions : XMLElement, XMLAgg, XMLAttributes etc.
    -- DBMS_XMLGEN package
    select dbms_xmlgen.getXML('SELECT * FROM scott.emp')
    from dual;-- XMLType constructor over a REF CURSOR (the one you chose)
    select xmlserialize(document
             xmltype(
               cursor(
                 select *
                 from scott.emp
             as clob
    from dual;-- From a DBUriType
    select xmlserialize(document
             dburitype('/SCOTT/EMP').getXML()
             as clob
    from dual;-- From XQuery using ora:view function
    select xmlserialize(document
             xmlquery('<ROWSET>{ora:view("SCOTT","EMP")}</ROWSET>' returning content)
             as clob indent size = 1
    from dual;If a column is NULL in the result set, those methods (except XMLElement) won't create the corresponding element.
    There's an option available for the XQuery method, but only in version 11.2.
    So if you want to output empty elements, you'll have to use DBMS_XMLGEN with setNullHandling method :
    DECLARE
    ctx   DBMS_XMLGEN.ctxHandle;
    v_out CLOB;
    rc    SYS_REFCURSOR;
    BEGIN
    OPEN rc FOR
      SELECT *
      FROM scott.emp
    ctx := DBMS_XMLGEN.newContext(rc);
    DBMS_XMLGEN.setNullHandling(ctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(ctx);
    DBMS_XMLGEN.closeContext(ctx);
    CLOSE rc;
    DBMS_XSLPROCESSOR.clob2file(v_out, 'TEST_DIR', 'test_out.xml');
    END;
    I thought of making use of the utl_file option in Oracle apps.You could, but you might find DBMS_XSLPROCESSOR.clob2file procedure more convenient for that (see above).
    All you have to do is serializing the XML in a CLOB variable, and call the procedure.
    WHERE NAME = 'utl_file_dir';The "utl_file_dir" init. parameter is deprecated since 10g, use directory objects instead.

  • Problem in creatinga sales order idoc into XML file in the same appl server

    Hai....friends....
    I am tring to send an  sales order as iDOC  to a xml port in the same application server....
    1. have created a xml port with path..\usr\sap\RRM\SYS\global\.
    2. assigned it to logical system.
    3.Have a RFC destination of TCP/ip(LOCAL_EXEC)
    but in bd64 after creating  model view when i am generating partner profiles  a tRFC PORT has been automatically created.
    then finally the IDOc has been created but its saying....IDOC CANNOT OR SHOULD NOT BE SENT...
    Pls help me regarding this...
    thx,
    ram

    Hi Thanks for your updates,
    But I got the same error, while pass the data from abap into XML.
    error message,what I am getting is
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/tempcustomers.xml'. Line 1, Position 1
    #<?xml version="1.0" encoding="utf-16"?>
    Thanks
    Gowrishankar

  • Howto transform a Sales Order (idoc) into xml file and download it?

    I need to tranform a Sales order into an xml file such that I could download the file onto my disk. I try to transform an IDOC.
    I do the following from an example and I get an xml document on screen but I do get get any file downloaded:
    DATA: document TYPE REF TO if_ixml_document.
      document = g_ixml->create_document( ).
      DATA: ostream TYPE REF TO if_ixml_ostream.
    ostream = g_stream_factory->create_ostream_uri(
      system_id = 'file://C:\test.xml' ).
      DATA: renderer TYPE REF TO if_ixml_renderer, rc TYPE i.
    renderer = g_ixml->create_renderer( ostream  = ostream
                                          document = document ).
      rc = renderer->render( ).
      document->render( ostream = ostream  recursive = ' ').
    Is there something else I should do? Is there another approach for transforming a sales order to an xml file.
    The R/3 4.6 system is used.
    Thank you
    -eglese-

    Hi Eglese,
    Another option could be to use XML port configured for the IDOC and use the XML files generated be extracted from Web Dynpro using a file download UI element.
    Thanks and Regards,
    Sam Mathew

  • Error while downloading data from internal table into XML file

    hi all,
    i developed a program to download data from into internal table to xml file like this.
    tables: mara.
    parameters: p_matnr like mara-matnr.
    data: begin of itab_mara occurs 0,
                matnr like mara-matnr,
                ernam like mara-ernam,
                aenam like mara-aenam,
                vpsta like mara-vpsta,
          end of itab_mara.
    data: lv_field_seperator type c,     " value 'X',
          lv_xml_doc_name(30) type c,    " string value ‘my xml file’,
          lv_result type i.
          lv_field_seperator = 'x'.
          lv_xml_doc_name = 'my xml file'.
    types: begin of truxs_xml_line,
              data(256) type x,
          end of truxs_xml_line.
    types:truxs_xml_table type table of truxs_xml_line.
    data:lv_tab_converted_data type truxs_xml_line,
         lt_tab_converted_data type truxs_xml_table.
    data: lv_xml_file type rlgrap-filename value 'c:\simp.xml'.
    select matnr ernam aenam vpsta from mara into table itab_mara up to 5
           rows where matnr = p_matnr.
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = lv_field_seperator
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
       I_XML_DOC_NAME             = lv_xml_doc_name
    IMPORTING
       PE_BIN_FILESIZE            = lv_result
      TABLES
        I_TAB_SAP_DATA             = itab_mara
    CHANGING
       I_TAB_CONVERTED_DATA       = lt_tab_converted_data
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    open dataset lv_xml_file for output in binary mode.
    loop at lt_tab_converted_data into lv_tab_converted_data.
    transfer lv_tab_converted_data to lv_xml_file.
    endloop.
    close dataset lv_xml_file.
    this program is syntactically correct and getting executed, but when i open the target xml file it is showing the following error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'file:///C:/simp.xml'.
    will anyone show me the possible solution to rectify this error
    thanks and regards,
    anil.

    Hi,
    Here is a small sample program to convert data in an internal table into XML format and display it.
    DATA: itab  TYPE TABLE OF spfli,
          l_xml TYPE REF TO cl_xml_document.
    * Read data into a ITAB
    SELECT * FROM spfli INTO TABLE itab.
    * Create the XML Object
    CREATE OBJECT l_xml.
    * Convert data in ITAB to XML
    CALL METHOD l_xml->create_with_data( name = 'Test1'
                                         dataobject = t_goal[] ).
    * Display XML Document
    CALL METHOD l_xml->display.
    Here are some other sample SAP programs to handle XML in ABAP:
    BCCIIXMLT1, BCCIIXMLT2, and BCCIIXMLT3.
    Hope this helps,
    Sumant.

  • How to convert text file into xml file

    Hi Folks,
    I am genarating list of data into text file, but i want to genarate xml file for this text file. How to achive this , please let me know. Thanks.
    regards
    Vishal

    hi Vishal,
      Use<b> GUI_DOWNLOAD</b> FM and give the file name as <b>file.xml</b> with BIN Mode....
    i.e,
      Download internal table to presentation server file(PC)
      DATA: ld_filename TYPE string value <b>file.xml</b>,
    Pre version 4.7 declaration e_file like rlgrap-filename.
      DATA: begin of it_datatab occurs 0,
      row(500) type c,
    end of it_datatab.
      call function 'GUI_DOWNLOAD'
           exporting
                filename         = ld_filename
                <b>filetype         = 'BIN'</b>
           tables
                data_tab         = it_datatab[]
           exceptions
                file_open_error  = 1
                file_write_error = 2
                others           = 3.
    Regards,
    Santosh

Maybe you are looking for

  • New item category not visible in CRM WebUI

    Hi, I am working on CRM 7.0, Leasing Contracts component BT114H_LAM. I created a new item category for the contract however this is not visible in the WebUI screen. the moment i enter the item it dissappears from the screen. It is available in the it

  • Is there a Big Band radio stream?

    No Big Band Folder present and I have looked buc annot find any Big Band Radio Stations available. Can we submit requests for a certain kind of music or station to be added to the iTunes radio server?

  • SSO with Webcache Load Balancing ???

    Hi, My system (in Win2K servers) +Infrastructure sever 9.0.2.3 +Midtier1 using OC4J_BI_Forms 9.0.2.3 +Midtier2 using OC4J_BI_Forms 9.0.2.3 I have followed the Note:207668.1 to setup Webcache as load balancer for 2 Midtiers. I also completed the steps

  • Billing date should take by default

    Hi dear, Please give me the solution for how the Billing date should take by default in VF01 screen( taday's date) . So that users are not allowed to enter the billing date in vf01 screen.

  • HELP ! Ipod only plays out of left headphone!

    i have tried everything. i have aquired new headphones. and the problem still occurs. i have even tried hooking it up to my car radio via Belkin tape adapter and it only play out of the left side speakers in my car. what is the problem !? PLEASE I NE