Spool Script for XML file

Question : I do not want <ROW num="1"> in xml file I need just <row> </row>. Because I want to change it to <TRANSACTIONS> <TRANSACTION> using Replace.
Please can any one help me to remove num = "1" and num ="2" from xml file ?
--MY SPOOL SCRIPT START HERE
set serverout on
set feedback off
spool C:\emp.XML
Declare
queryCtx DBMS_XMLquery.ctxType;
result CLOB;
procedure printClobOut(result IN OUT NOCOPY CLOB) is
xmlstr varchar2(32767);
line varchar2(2000);
begin
dbms_output.enable(99999999);
xmlstr := dbms_lob.SUBSTR(result,32767);
loop
exit when xmlstr is null;
line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
dbms_output.put_line(' '||line);
xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
end loop;
end;
begin
-- set up the query context...!
queryCtx := DBMS_XMLQuery.newContext('select ename,job,salary from emp');
-- get the result..!
result := BMS_XMLQuery.getXML(queryCtx);
-- Now you can use the result to put it in tables/send as messages..
printClobOut(result);
DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
end;
spool off
--MY SPOOL SCRIPT ENDS HERE
THE ABOVE WORKS AND CREATES XML FILE AS SHOWN BELOW WHICH IS GOOD
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<ENAME>JOHN</ENAME>
<JOB>MANAGER</JOB>
<SALARY>3000</SALARY>
</ROW>
<ROW num="2">
<ROW num="2">
<ENAME>KATTU</ENAME>
<JOB>SALESMAN</JOB>
<SALARY>1000</SALARY>
</ROW>
</ROWSET>

you requirement.. !!
11:44:18 zug7_real>SET SERVEROUTPUT ON
11:44:19 zug7_real>set feedback off
11:44:19 zug7_real>spool F:\emp.XML
SP2-0332: Cannot create spool file.
11:44:19 zug7_real>DECLARE
11:44:19   2  v_ctx DBMS_XMLGen.ctxHandle;
11:44:19   3  v_file Utl_File.File_Type;
11:44:19   4  v_xml CLOB;
11:44:19   5  v_more BOOLEAN := TRUE;
11:44:19   6  procedure printClobOut(result IN OUT NOCOPY CLOB) is
11:44:19   7  xmlstr varchar2(32767);
11:44:19   8  line varchar2(2000);
11:44:19   9  begin
11:44:19  10  dbms_output.enable(99999999);
11:44:19  11  xmlstr := dbms_lob.SUBSTR(result,32767);
11:44:19  12  loop
11:44:19  13  exit when xmlstr is null;
11:44:19  14  line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
11:44:19  15  dbms_output.put_line(' '||line);
11:44:19  16  xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
11:44:19  17  end loop;
11:44:19  18  end;
11:44:19  19  BEGIN
11:44:19  20  -- Create XML context.
11:44:19  21  v_ctx := DBMS_XMLGen.newContext('select n1,n2 from view_1 ');
11:44:19  22  -- Set parameters to alter default Rowset and Row tag names and de
fault case.
11:44:19  23  --DBMS_XMLGen.setRowsetTag(v_ctx, 'TEST');
11:44:19  24  --DBMS_XMLGen.setRowTag(v_ctx, '');
11:44:19  25  --DBMS_XMLGen.setTagCase(v_ctx, DBMS_XMLGen.LOWER_CASE);
11:44:19  26  -- Add an IE specfic XSL stylesheet reference so browser can trans
form the file.
11:44:19  27  --DBMS_XMLGen.setStylesheetHeader(v_ctx, 'C:\Development\XML\IESty
le.xsl', 'text/xsl');
11:44:19  28  -- Create the XML document.
11:44:19  29  v_xml := DBMS_XMLGen.GetXML(v_ctx);
11:44:19  30  DBMS_XMLGen.closeContext(v_ctx);
11:44:19  31  -- Output XML document to file.
11:44:19  32  printClobOut(v_xml);
11:44:19  33  END;
11:44:19  34  /
<?xml version="1.0"?>
<ROWSET>
<ROW>
<N1>10</N1>
<N2>40</N2>
</ROW>
<ROW>
<N1>10</N1>
<N2>50</N2>
</ROW>
<ROW>
<N1>20</N1>
<N2>40</N2>
</ROW>
<ROW>
<N1>20</N1>
<N2>50</N2>
</ROW>
</ROWSET>- Pavan Kumar N

Similar Messages

  • How to add payment advice for XML file filed in vendor account group

    Hi All,
    I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap,
    kindly advice where i can add above mention field in vendor account group.
    thanks
    khaja

    done

  • Make DW default for XML files?

    I'm sure there's a way to do this that I'm missing, but I'd like to make DW my default app for XML files.  I know how this can be done on Windows (using "open with" and changing default), but I'm using Mac OSX.  I tried messing with the file types section of DW's preferences, but it didn't work.  Anyone know how to fix this?  Thanks.

    In the Mac Finder, select an XML file, and click More Info (or press Cmd+I - that's I, not a lowercase L) to bring up an Info panel. Expand the section that says Open With, and then select Dreamweaver from the pop-up menu (click Other, if it's not listed). Then click the Change All button to apply it to all XML files.

  • Package for xml file insersion

    hi every body
    if any body know the link for the package of xml file insersion into oracle database. and also parser for xml file then plz tell me.
    my email address is " [email protected] "

    hi every body
    if any body know the link for the package of xml file insersion into oracle database. and also parser for xml file then plz tell me.
    my email address is " [email protected] "

  • Need script for moving files to specific directories base on csv

    Hi,
    I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
    Csv is looking like this:
    filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
    I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
    Thanks a lot for every help.
    Best Regards
    Petr, OS X Mavericks

    private function snapshotLastFrame():void
    gotoAndStop( this.totalFrames );
    _bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
    _bitmap                              = new Bitmap( _bitmapData );
    _bitmapData.draw ( stage );
    saveImageJPG( _bitmapData, "test.jpg", 96 );
    public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
                this.jpgEncoder = new JPGEncoder( quality );
                this.fileReference = new FileReference();
                this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
    Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

  • GUI_Download for XML file ?

    Hi Experts,
    I have xml data in an internal table say int_xml_data.
    While i m downloading this data to presenatation server using gui_download m getting an 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.
    Invalid at the top level of the document. Error processing resource 'file:///C:/Vendor File.xml'. Line 1, Position 1
    3C3F786D6C2076657273696F6E3D22312E30223F3E3C57535F56454E444F525F444154413E3C57535F56454E444F525F444154413E3C4C49464E52204461"
    I have used the function like this:-
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = 'C:\Vendor File.xml'
       FILETYPE                      = 'BIN'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = int_xml_data
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    What is the mistake ???
    How can the xml data be downloaded to presentation seerver? ?
    Function works fine for .txt data but not for xml ???

    @ Sandeep:
    I did this only.
    Firstly I converted data into xml using SAP_CONVERT_TO_XML_FORMAT
    the code is:
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
      I_FIELD_SEPERATOR          = ':'
      I_LINE_HEADER              =
      I_FILENAME                  = w_path
      I_APPL_KEEP                = ' '
      I_XML_DOC_NAME              = <w_xml_file>
    IMPORTING
      PE_BIN_FILESIZE            =
        TABLES
          I_TAB_SAP_DATA             = int_final_vendor
       CHANGING
         I_TAB_CONVERTED_DATA        = int_xml_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.
    After this I am downloading the data using GUI_Download
    Code is
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = w_file
        FILETYPE                      = 'BIN'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = int_xml_data
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    What is the mistake ????

  • Receiver File channel for XML files: with carriage return

    Hi all,
    we are using a receiver FILE channel to generate an XML file that is sent to an external partner.
    The XML file looks good in a parser (IExplorer). But in fact there are not carriage return / line feeds between the XML tags
    of the XML payload in the file.
    Our partner now requires the XML file in a more vertical structure which means: for every tag a separate line (like it is displayed in a parser)
    Does anybody know a more general way to convert to a vertical XML structure (so with carriage return line feed).
    There is one entry in the SDN dealing with this topic but suggesting using an UDF. I think this is a very specific way.
    I don't think it is a good way to change/enhance the message mapping just because of a general formating change.
    Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    any experiences? suggestions? examples?
    Thank you very much
    best regards
    Hans
    examples:
    original by XI receiver FILE adapter
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus><type>BS</type><header><message><messageSender>SENDER</messageSender><messageDate>20090723143720</messageDate> ... and so on
    required:
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus>
    <type>BS</type>
    <header>
    <message>
    <messageSender>SENDER</messageSender>
    <messageDate>20090723143720</messageDate>
    ... and so on

    >
    Hans Georg Walter wrote:
    > Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    > any experiences? suggestions? examples?
    In such a case, the best is to write an generic XSLT or Java mapping that will attempt to do the pretty printing/formatting of the xml.
    The advantage of a generic one is that you can reuse the same class/jar for many other scenarios.
    so the flow will be as below in your interface mapping;
    1. your specific source to target mapping
    2. the generic formatting class

  • Script for moving files and directory to archive

    Hi,
    I've search the web for good working script to archive my files and folder with no luck.
    do you have a script that move and preserve the structure of older files and folders that have not been accessed for X days?

    Hello, I found this quite quickly in the TechNet Gallery. It seems like it would do what you're looking to do.
    https://gallery.technet.microsoft.com/Archive-old-files-with-042f859a
    # Powershell script - move old files to an archive location.
    # Writes log files to $logpath
    # Ver 0.6
    $path = "C:\TEMP"
    $archpath = "D:\TEMP-ARCH"
    $days = "30"
    $logpath = "C:\Temp"
    $date = Get-Date -format yyyyMMddHHmm
    write-progress -activity "Archiving Data" -status "Progress:"
    If ( -not (Test-Path $archpath)) {ni $archpath -type directory}
    Get-Childitem -Path $path -recurse| Where-Object {$_.LastWriteTime -lt (get-date).AddDays(-$days)} |
    ForEach { $filename = $_.fullname
    try { Move-Item $_.FullName -destination $archpath -force -ErrorAction:SilentlyContinue
    "Successfully moved $filename to $archpath" | add-content $logpath\log-$date.txt }
    catch { "Error moving $filename: $_ " | add-content $logpath\log-$date.txt }

  • How to write POJO for XML file.. i do not want to use JAXB or any other tec

    How to generate POJOs for the specific xml files.
    Each XML file will have elements name with Type. Which in turn related to some other xml file
    For example
    student.xml
    <student name"mystudent">
    <studentname type="firstname"/>
    <studentname type="firstname"/>
    <studentname type="firstname"/>
    </student>
    firstname.xml
    <studentname name="firstname">
    <stufirstname type="myfirstname"/>
    </studentname>
    myfirstname.xml
    <myfirstname name="myfirstname">
    <myname1>xxx</myname1>
    </myfirstname>
    like this there will be so many xml files interlinked.
    I would like to write POJOs for these xml files
    please let me know what is the best way to write (design the hirarchy of these xml files
    Thanks in advance
    srinivas

    Not at this time. You may submit your polite feedback to Apple using this webpage: http://www.apple.com/feedback/itunesapp.html

  • Line Break for XML File

    All,
    I am able to generate xml file from an internal table. The problem is, if I open the file in IE everything looks good. When I open it in notepad or notepad++, everything is in one line. Can you tell me how to generate a line break after each tags.
    Please find the following code used by me for reference.
    LOOP AT lt_ohd INTO ls_ohd.
        ls_temp_ohd = ls_ohd.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_ohd  = l_document->create_simple_element(
                      name = 'OHD'
                      parent = l_document ).
        ENDAT.
        AT NEW cc.
          CLEAR : lv_inhaltskom, lv_text.
          lv_inhaltskom = ls_temp_ohd-cc.
          CALL FUNCTION 'ISM_SELECT_TEXT_JJTIKO'
            EXPORTING
              pv_inhaltskom = lv_inhaltskom
            CHANGING
              pv_langtext   = lv_text.
          TRANSLATE lv_text TO UPPER CASE.
          l_value = lv_text.
          l_element_county  = l_document->create_simple_element(
                      name   = 'city_county'
                      value  = l_value
                      parent = l_element_ohd  ).
        ENDAT.
        AT NEW order.
          l_element_neighborhood  = l_document->create_simple_element(
                      name    = 'entry'
                      parent  = l_element_county  ).
        ENDAT.
        l_value = ls_temp_ohd-neighborhood.
        l_element_address  = l_document->create_simple_element(
                    name   = 'neighborhood'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-address_detail.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address_detail'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-order.
        l_element_address  = l_document->create_simple_element(
                    name   = 'order'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-item.
        l_element_address  = l_document->create_simple_element(
                    name   = 'item'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-cc.
        l_element_address  = l_document->create_simple_element(
                    name   = 'cc'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-address.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-price.
        l_element_address  = l_document->create_simple_element(
                    name   = 'price'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-bed.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bed'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-bath.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bath'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-opentime.
        l_element_address  = l_document->create_simple_element(
                    name   = 'opentime'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-state.
        l_element_address  = l_document->create_simple_element(
                    name   = 'state'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-zip.
        l_element_address  = l_document->create_simple_element(
                    name   = 'zip'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_streamfactory = l_ixml->create_stream_factory( ).
        l_ostream = l_streamfactory->create_ostream_itable( table = lt_xml_table ).
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
        l_xml_size = l_ostream->get_num_written_raw( ).
      ENDLOOP.
    Regards,
    Salil
    Edited by: salil vaidya on Jan 18, 2011 2:34 PM

    Thanks.
    But now, I have a syntax error.
    BEGIN OF xml_line,
              data(256) TYPE x
    END OF xml_line.
    DATA: lt_xml_table      TYPE TABLE OF xml_line,
          ls_xml_table      TYPE xml_line.
    LOOP AT lt_xml_table INTO ls_xml_table.
        CONCATENATE ls_string cl_abap_char_utilities=>cr_lf INTO ls_string.
        MODIFY lt_xml_table FROM ls_xml_table INDEX sy-tabix.
        CLEAR : ls_xml_table, ls_string.
      ENDLOOP.

  • Conventions for XML-files

    Hi!
    I'm working on the text of a Bible translation that will be quite an extensive file when it's finished. The publisher has requested that I make an XML file in addition to the print-ready inDesign files they will use themselves. This is because there will be other publishers and companies that will want to use their translation (or parts of it) and it's inconvenient to send them inDesign files. An XML file with all of the paragraph styles, character styles and footnotes would be more convenient.
    Now, I've been trying to find information on how such a XML should look. Are there any code conventions for it? Most of the issues on this forum concerns importing xml files for use in indesign - but what I'm wondering is what I must think of when exporting XML files that other people will use?
    Also, is it possible to create inline xml tags based on character styles? (Such as bold, italic, suberscript etc.)
    I'm using CS6 and Mac OS X Lion.
    EDIT: Another thing just struck me. If anyone thinks that XML is not the best format for this then I'd very much like to hear about any other suggestions.

    InDesign has a native "Export XML" option, but that requires that you tag each separate item as an "XML item". Some of this can be automated, using "Map Styles to Tags". I don't have any experience with it, positive or negative, but if you exclusively used paragraph and character styles to layout your text it should be straightforward.
    Fastest way to get re-usable text in a not too difficult to parse file format is to export as Tagged Text. It's not really proper XML, but it may be Close Enough; if the above route is too complickated, try this (and send your publisher a test file).
    SimonLinden wrote:
    I've been trying to find information on how such a XML should look. Are there any code conventions for it? Most of the issues on this forum concerns importing xml files for use in indesign - but what I'm wondering is what I must think of when exporting XML files that other people will use?
    There are no "conventions". XML itself only has some very basic requirements (the way of writing element and attribute tags, correct nesting, some special characters that may not be used in plain text; that sort of things). So you can make up your own set of tags, or, to not confuse your receiving party, use a well-known set of tags such as XHTML (ie., <p> is for Paragraph, <i> is for Italic, and so on) or DocBook. There are also Scripture specific schema's of XML; http://ebible.org/usfx/ is one found with a quick Google.

  • A script for moving files to folder ? or relaunch photoshop

    I'm looking for a very simple java script to check file corruption
    it should:
    1.open a file I send to it (via droplet)
    2.if it works > close the file > send the file to a folder like c:/checked/
    3.if the open sequence crashes or doesn't work > re launch photoshop
    4.mark the file as beeing corrupt or send it to a another folder
    I don t know how to move a file via java script without saving
    I don t know how I can relaunch ? force-quit photoshop ? is this even possible ?
    Regards

    Anstellos1 wrote:
    xbytor2 > thats the exact problem I'm having. If there is a "wrong" file into my batch, photoshop stop/ crash, is waiting for an action on my side... the whole idea of using photoshop droplets is to do it without me.
    Should I parse the files (I have jpegs; png and raws... parsing raws ?)? Would it be better like someone said to use a script that "try catch"? (no idea what it is or how to write this). I also red that photoshop image processing is skipping bad files, is that true ? how could I apply this technique ?
    bad file > skip > no crash > process continue running would be even better than the original validation idea
    "Unfortunately, there are types of jpeg corruptions that cause PS to  throw up a 'Broke File' dialog in spite of how you open the file or have  your DialogModes preferences set. PS just stops cold waiting for user  interaction. I'll see if I can locate one of these that I used to test  with. The last time I looked at this problem in depth (CS2 or CS3) PS  was still misbehaving.
    xbytor2 if much more of an expert than I am in the script area so will have to defer to him"
    I would have to defer to xbytor2 since he is much more of an expert than I in scripting.  If the Try....Catch construct does not work, than Image Processor in PS and also accessed by Bridge would fail under the same circumstances since that is the construct  that script uses.  Interesting
    "How would you write that ? Are you saying that if I use this script  at the beginning of my photoshop droplets, it won't crash on a bad file and continue looping on the next ?:"
    If you want to use the Try...Catch constructs looking at the Image Processor Code from ExtendScript ToolKit (or other script editor) would let you see how it operates.  They use the Try...Catch construct in multiple locations in that script.
    At the highest level in Image Processor here is the basic code below for the Try...Catch construct with most everything else stripped out.
    There are two main steps. One is to set the app.displayDialogs mode to NO. The second is to use the try...catch construct below.   The error routine is the catch portion of the code just displays the error code.  Then the dialog mode is reinstated to the original settings set by the User.   The same construct is used deeper into the code so that would be a source of at least the approach Image Processor uses.
    try {
        // remember the dialog modes
        gSaveDialogMode = app.displayDialogs;
        app.displayDialogs = DialogModes.NO;
        Code you want to execute goes here
    // Lot's of things can go wrong
    // Give a generic alert and see if they want the details
    catch( e ) {
        if ( e.number != 8007 ) { // don't report error on user cancel
            alert( e + " : " + e.line );
    // restore the dialog modes
    app.displayDialogs = gSaveDialogMode;

  • Email Attachment is not Working for xml file

    Hi All,
    if any one has any answer to this below Query, Your help will be highly appreciated.
    1- while configuring the email for attachment i am getting the selection failure Error in Content Encoding line where i am setting the base64 for encoding. Please fine configuration done for Email activity
    <scope name="Email1">
    <bpelx:annotation>
    <bpelx:pattern patternName="bpelx:email"></bpelx:pattern>
    </bpelx:annotation>
    <variables>
    <variable name="varNotificationReq"
    messageType="ns1:EmailNotificationRequest"/>
    <variable name="varNotificationResponse"
    messageType="ns1:ArrayOfResponse"/>
    <variable name="NotificationServiceFaultVariable"
    messageType="ns1:NotificationServiceErrorMessage"/>
    </variables>
    <sequence name="Sequence1">
    <assign name="EmailParamsAssign">
    <copy>
    <from expression="string('Default')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:FromAccountName"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Bcc"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Cc"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:ReplyToAddress"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('subject')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Subject"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('mailId')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:To"/>
    </copy>
    <copy>
    <from>
    <Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/mixed</MimeType>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    </BodyPart>
    <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <contentencoding xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    </BodyPart>
    </MultiPart>
    </ContentBody>
    </Content>
    </from>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content"/>
    </copy>
    <copy>
    <from expression="string('base64')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentEncoding"/>
    </copy>
    <copy>
    <from expression="string('application/xml')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:MimeType"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('body')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:ContentBody"/>
    </copy>
    <copy>
    <from expression="string('application/xml')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:MimeType"/>
    </copy>
    <copy>
    <from expression="'abc.xml'"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:BodyPartName"/>
    </copy>
    <copy>
    <from expression="ora:readFile('file:///*/*.xml')"/
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentBody"/>
    </copy>
    </assign>
    If any one has done it before please help me out...
    thanks
    Dillip

    Hello Dillip,
    Please find below links. Either of one should solve your problem -
    http://mysoathoughts.blogspot.fi/2013/02/send-xml-file-as-attachment.html
    http://neeraj-soa-tips.blogspot.co.uk/2012/01/sending-attachment-using-email-activity.html
    BR
    Vaibhav

  • Unable to create a data server for xml file

    Hi ,
    I have created a data server for a xml file but when i test the connection i am getting the below error.
    java.sql.SQLException: class org.xml.sax.SAXException
    Prefix not found: xsi
    at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:133)
    at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
    at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1100)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:371)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.localConnect(SnpsDialogTestConnet.java:794)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.jButtonTest_ActionPerformed(SnpsDialogTestConnet.java:754)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.connEtoC1(SnpsDialogTestConnet.java:137)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$1(SnpsDialogTestConnet.java:133)
    at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$IvjEventHandler.actionPerformed(SnpsDialogTestConnet.java:87)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Can any one help me out with this issue ?
    Thanks in advance,
    Balajitk

    HI Balaji,
    Below is the sample xml file which i have saved as test.xml and placed it @ D: drive
    Test.xml:
    <employee>
    <emp>
    <eno>1</eno>
    <ename>Test1</ename>
    </emp>
    <emp>
    <eno>2</eno>
    <ename>Test2</ename>
    </emp>
    <emp>
    <eno>2</eno>
    <ename>Test2</ename>
    </emp>
    </employee>
    Goto Topology >Expand Technologues>right click on XML and select new data source
    in Defination Tab, provide the physical architecture name
    in JDBC Tab, provide the below details
    JDBC Driver: com.sunopsis.jdbc.driver.xml.SnpsXmlDriver
    JDBC URL: jdbc:snps:xml?f=d:\test.xml&d=test.dtd&re=employee&s=TEST&ro=false
    Save it
    Click on Test Connection and again click on test, it should show test connection as "Successfully Test"
    Hope this may helps you
    Regards,
    Phanikanth

  • APIs for XML file creation

    hi,
    can anyone tell me whether there is any Java APIs for creating XML file( similar to the one used for parsing).
    thx in advance,
    -Soni.

    Hi,
    you can try the org.apache.xml.serialize.XMLSerializer which is included in the Apache Xerces Package (http://xml.apache.org/xerces). This Class allows you to serialize a org.w3c.dom.Document to a OutputStream which can be a FileOutputStream.
    Check out this code:
    OutputFormat format = new OutputFormat();
    format.setDoctype("mapping","mapping.dtd");
    format.setEncoding("ISO-8859-1");
    format.setLineWidth(100);
    XMLSerializer ser = new XMLSerializer(new FileOutputStream(f),format);
    ser.serialize(doc);
    Rgds,
    Sebastian

Maybe you are looking for

  • Customer Sevice , warranty master  creation

    Dear All Experts, 1. I am creating a task for an equipment in IA01 to which i have created a service master  and a agreement, to which i have created an equipment and asingned task to that. 2.I have created a single cycle plan in which i have called

  • ITunes 7.3 failed back up data DVD burn had error code 261(0x00000105).

    Just bought a bunch of new songs and went to back them up in iTunes 7.3 and I keep getting error code 261(0x00000105). Any ideas? Did not have this problem in prior versions. Brner works fine with other programs. Thanks! Home Brew   Windows XP Pro  

  • ICWC document emailed with no extension or PDF corrupted.

    CRM 5.0 SP11. 1. We access a document in the inbox and an attached document exist & agent has visbility to the document in the Document Search (order ack, invoice) saved in CMS as OTF files. 2. Agent can click the hyper link and see the document (Goo

  • How to refer the 1st page's 2nd text field from the 2nd page in Java scrip?

    Hello I am developing an VISITOR info interactive form with webdynpro ABAP, its with 2 pages. Their heirarchy is, VISITOR_form     |     |     |------Page_1     |            |     |            |     |            |------Text_Field_A_1     |           

  • What's StyleContext worth for?

    Hi all, I learned hot to color a PlainDocument following Timothy Prinzing's article Customizing a Text Editor http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html For the time being, I'm using just one font, but various colors, mu