*** es:preparedStatement TAG replacement in 3.5 ***????

hi there.
does anybody know what is the replacement for the tag <es:preparedStatement> in
WLCS 3.5?
nobody seems to be facing this problem.
any help is appreciated.
thanks,
nadeem

I had this same problem using makeagent
I found that the two files I needed to change afterwards on the agent were
/var/opt/SUNWsymon/cfg/domain-config.x
and
/var/opt/SUNWsymon/cfg/dtable.toe
Then the agent worked ok with my alternate port of 1161
Apologies if I am telling you something you already know, but maybe it will be useful for someone else reading this.
Regards
Steve

Similar Messages

  • String Param tag replace with Br tag

    original text:
    <P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
    I need to: <br/>sample text1<br2>sample text2<br2>sample text3
    can help me

    var reg:RegExp = /\<\/?P.*?\/?\>/igm;
      var _m=messageField.htmlText//<P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
      _m=_m.replace(reg, '<br/>');
    trace(_m) //  "<br/>sampletext1<br/><br/>sampletext2<br/><br/>sampletext3<br/>"
    Iam getting double breaks i need only one break.
    Re: String Param tag replace with Br tag 

  • JSTL c:set tag replace single qoutes to & #039;

    Hi all,
    i'm using the JSTL-Tags to create and query a SQL-Statement.
    I use the c:set Tag to set a part of my query...
    <c:set var="selectSeveral" value="d.hardwarecode = '${param.p_macAddress}'"/>
    ...and the sql:query Tag to excecute the query:
    SELECT <c:out value="${selectValue}"/>
    FROM event e, device d, billingunit b
    WHERE e.eventdate >= to_date('<c:out value="${param.p_dateFrom}"/>', 'DD.MM.YYYY HH24:MI:SS')
    AND e.eventdate <= to_date('<c:out value="${param.p_dateTo}"/>', 'DD.MM.YYYY HH24:MI:SS')
    AND <c:out value="${selectSeveral}"/>
    AND e.deviceid = d.deviceid
    AND d.billingunitid = b.billingunitid
    GROUP BY <c:out value="${groupValue}"/>
    By excecuting the Statement with Tomcat i get a Oracle ORA-00911: invalid character Errormessage.
    I found the reason for this in the Logfile, where the Statement looks like this:
    SELECT e.eventdate, e.sessionend, e.sourceip, e.amount, d.hardwarecode, d.typecode, b.name, b.code
    FROM event e, device d, billingunit b
    WHERE e.eventdate >= to_date('17.03.2003 19:44:06', 'DD.MM.YYYY HH24:MI:SS')
    AND e.eventdate <= to_date('17.03.2003 20:54:59', 'DD.MM.YYYY HH24:MI:SS')
    AND e.sourceip = & #039;172.24.214.222& #039;
    AND e.deviceid = d.deviceid
    AND d.billingunitid = b.billingunitid
    ORDER BY eventdate asc
    As you can see JSTL replaced the single quotes with the number code of the single quotes. (& #039;)
    Any ideas how to solve this problem.
    Thanks in advance.
    Cu Daniel

    Try setting the escapeXml attribute to false - it defaults to true, and will replace XML (and HTML) special characters to their entity codes. For example:
    <c:out value="${selectValue}" escapeXml="false"/>

  • TAG replacement problem

    can anybody tell me how to replace one tag with another in JTextPane using HTMLDocument and HTMLEditorKit?
    I mean if I have inserted <SUP> tag, I can't change to normal selected text.

    That is only a general guideline, it might take much less, my wifes only took a little over a week to get back. I have heard of quicker and some longer. We have no way of telling you for sure, this is a user forum, all we can do is tell you of our experiences. Hope this helps.

  • Image tag replacement

    i am new in java programming i hame on html file in which <img src="/editor/images/a1. gif" /> <img src="/editor/images/a2. gif" /> and similarly it continunue .
    i want these all src="/editor/images/" to replace with images/a1.gif and images/a2. gif
    i am using JDK1.3 pls. help me.

    hi,
    just search for /editor/ and remove from this from html file. in order to
    do this u have to go for file handling

  • Is this a bug for using DIV tag in adf page?

    I'm using the version 11.1.1.2.0. And when I write the adf page code with empty content in div tag like this :
    <div id="ex"></div>
    <othertags>123</othertags>Then the code in randered page :
    <div id="ex">
    <othertags>123</othertags>
    </div>Bug ?
    Edited by: Derek.Jaa on 2010-4-21 上午4:00

    Hi Simon
    Thanks for you help and I can't see the tag you suggested. Maybe you should make you code between tag, replace the [] with {} .                                                                                                                                                                                                                                                                                                   

  • Error in java proxy generation due to xs:choice tag

    Hi all,
    I'm trying to generate a java proxy in the SAP XI design.
    The message interface I'm using is based on an external definition which i imported from an xsd file.
    The problem is that XI doesn't allow me to generate the java proxy because in the xsd schema the tag <xs:choice> is present and XI cannot handle it (just in this case, because the external definition works fine).
    Does anybody know how to solve the problem or manage to generate the javaproxy anyhow?
    Thanks in advance,
    Daniele

    > Replace <xs:choice> tag with  <b><xsd:choice> tag
    > </b>
    > that should solve the prob.
    I tried to change the tag (replacing also other <xs:...> tags in order to obtain a valid xsd) but the problem didnt change.
    i'm almost convinced that tag is not supported in java proxy generation (but it is for external definitions...)

  • CS6 Find Font Replace All replaces all the text in that font with a space.

    Anybody else have this happen? It's happened to me more than once, so I don't think it's a fluke. The first time around I never noticed it until it was way too late to use UNDO. Disconcerting to say the least. It takes out all the words in that font and inserts a space.
    Using Lion 10.7.4
    MacBook Pro 2011
    CS6
    Profuse thanks to anyone who can enlighten me…
    Vicki

    backup entire site
    edit > find & replace
    find in > entire current local site or current document (whichever you prefer) 
    search > specific tag > <font> 
    Click the "-" symbol to remove tag modifier options 
    action > strip tag > replace all

  • 2 questions in PreparedStatement in JSP

    Dear All,
    I got 2 questions in PreparedStatement in JSP that i can't solve
    Q1) when I m inserting a record that contains \r\n then the PreparedStatement will replace it into \\r\\n.
    Q2)I can't insert records when it contains ' by using PreparedStatement.
    How can i resolve these problems
      public int updateInterview(int interviewID,String interviewee,String interviewer,String i_date,String i_time,String summary,String photo_path,String update_staff,String content,String person_title,String i_type) {
      Interview interview = new Interview();
      InterviewDAO dao = new InterviewDAO();
        interview.setInterviewID( interviewID );
        interview.setInterviewer( interviewer );
        interview.setInterviewee( interviewee );
        interview.setInterviewDate( i_date );
        interview.setInterviewTime( i_time );
        interview.setSummary( summary );
        interview.setPhotoPath( photo_path );
        interview.setUpdateStaff( update_staff );
        interview.setContent( content );
        interview.setPersonTitle( person_title );
        interview.setIntervieweeType( i_type );
        return dao.updateInterview(interview);
      }

    public int updateInterview(Interview interview) {
    int updateCount = 0;
    try{
    sql = "update interview set interviewee=?, interviewer=?, i_date=?, i_time=?, summary=?, photo_path=?, update_date=now(), update_staff=?, content=?, person_title=?, i_type=? ";
    sql += "where interviewID=?";
    Connection conn = db.getConnection();
    PreparedStatement pstm = conn.prepareStatement(sql);
    int i = 1;
    pstm.setString(i++,interview.getInterviewee());
    pstm.setString(i++,interview.getInterviewer());
    pstm.setString(i++,interview.getInterviewDate());
    pstm.setString(i++,interview.getInterviewTime());
    pstm.setString(i++,interview.getSummary());
    pstm.setString(i++,interview.getPhotoPath());
    pstm.setString(i++,interview.getUpdateStaff());
    pstm.setString(i++,interview.getContent());
    pstm.setString(i++,interview.getPersonTitle());
    pstm.setString(i++,interview.getIntervieweeType());
    pstm.setInt(i++,interview.getInterviewID());
    updateCount = pstm.executeUpdate();
    conn.close();
    catch(SQLException sql){}
    return updateCount;
    }

  • Forte built-in tags and MySQL

    Hello,
    I'm developing a web application using Forte Community Edition 3.0 and MySQL.
    I've been using the built-in jdbc and presentation tags of Forte, the same way as in the help and the CD Shop tutorial, but it seems to be not working with MySQL. There's no problem with making a connection and executing a query, but afterwards I can't iterate through the resultset. The <prefix:iterator> tag only gives me the last row, that one infinite times, however.
    Anyone experienced this problem and has an idea how to get around?
    Is there a way to get a reference to the Result object which is mentioned in the <query> and the <iterator> tag attributes?

    You're not alone. I spent several hours thinking I did something wrong, but I think there must be some incompatability with the ie & db tags supplied with Forte and the MySQL 2.0.4 driver.
    I've been searching the forums and the only suggestion that I've found is to not use the ie & db tags supplied with Forte and to replace them similar tags from Apache. Unfortunately, it isn't a tag for tag replacement. You're going to have to reference new tags with a different API.
    I downloaded dbtags.jar from http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/dbtags/
    In looking at the documentation, it looks like they have tags that will do most of the things that the ie & db tags will do.
    Good luck!
    Scott

  • Need to add extra lines in email generating from oracle

    Hi!
    I am using Oracle 9i Enterprise Edition 9.2.0.6
    I am facing a problem while generating the email from Oracle
    Problem is that I want to display the data in following format
    Terminal Statistics From: 30-MAR-2008 15:39:00 To: 06-JUN-2008 16:59:00
    Containers Examined
    Export: 2
    Import: 30
    but email shows data in following format
    Terminal Statistics From: 30-MAR-2008 15:39:00 To: 06-JUN-2008 16:59:00 Containers Examined Export: 2 Import: 30
    System combines the all the data in one line, while I have used following function to add new line when and where needed, but unable to get my desired result.
    1. utl_tcp.CRLF
    2. chr(130) || chr(10)
    3. chr(10)
    I have used following procedure to generate the email.
    PROCEDURE send_html_email(
    p_module_name in varchar2,
    p_subject in varchar2,
    p_text in varchar2 default null,
    p_html in varchar2 default null
    IS
    l_boundary varchar2(32767) default 'a1b2c3d4e3f2g1';
    l_connection utl_smtp.connection;
    l_body_html clob := empty_clob; --This LOB will be the email message
    l_offset number;
    l_ammount number;
    l_temp varchar2(32767) default null;
    l_to varchar2(100);
    l_cc varchar2(100);
    l_bcc varchar2(100);
    t_v_stpt Number:=0;
    t_v_endpt Number:=0;
    c_v_stpt Number:=0;
    c_v_endpt Number:=0;
    b_v_stpt Number:=0;
    b_v_endpt Number:=0;
    l_subject varchar2(255);
    BEGIN
    /*Function to retrieve the E-mail recipients list according to the Module/application*/
    mail_recipient(p_module_name,l_to,l_cc,l_bcc);
    l_connection := utl_smtp.open_connection( pk_parameter.setting('MAILSVR'), 25 );
    utl_smtp.helo( l_connection, pk_parameter.setting('MAILSVR') );
    utl_smtp.mail( l_connection, pk_parameter.setting('MAILFROM') );
    l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
    LOOP
    t_v_stpt := t_v_stpt + 1;
    t_v_endpt := INSTR (l_to, ',', t_v_stpt, 1);
    IF l_to is null then
    EXIT;
    ELSIF t_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_to, t_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_to, t_v_stpt, t_v_endpt -t_v_stpt));
    END IF;
    t_v_stpt := t_v_endpt;
    END LOOP;
    LOOP
    c_v_stpt := c_v_stpt + 1;
    c_v_endpt := INSTR (l_cc, ',', c_v_stpt, 1);
    IF l_cc is null then
    EXIT;
    ELSIF c_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_cc, c_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_cc, c_v_stpt, c_v_endpt -c_v_stpt));
    END IF;
    c_v_stpt := c_v_endpt;
    END LOOP;
    LOOP
    b_v_stpt := b_v_stpt + 1;
    b_v_endpt := INSTR (l_bcc, ',', b_v_stpt, 1);
    IF l_bcc is null then
    EXIT;
    ELSIF b_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_bcc, b_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_bcc, b_v_stpt, b_v_endpt -b_v_stpt));
    END IF;
    b_v_stpt := b_v_endpt;
    END LOOP;
    /*Header creation for email.*/
    IF l_to is not null or l_cc is not null or l_bcc is not null THEN
    l_temp := l_temp || 'To: ' || l_to || chr(13) || chr(10);
    l_temp := l_temp || 'CC: ' || l_cc || chr(13) || chr(10);
    l_temp := l_temp || 'BCC: ' || l_bcc || chr(13) || chr(10);
    l_temp := l_temp || 'From: ' || pk_parameter.setting('MAILFROM') || chr(13) || chr(10);
    l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
    l_temp := l_temp || 'Reply-To: ' || pk_parameter.setting('MAILFROM') || chr(13) || chr(10);
    l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
    chr(34) || l_boundary || chr(34) || chr(13) ||
    chr(10);
    -- Write the headers
    dbms_lob.createtemporary( l_body_html, false, 10 );
    dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
    -- Write the text boundary
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    l_temp := '--' || l_boundary || chr(13)||chr(10);
    l_temp := l_temp || 'content-type: text/plain; charset=us-ascii' ||
    chr(13) || chr(10) || chr(13) || chr(10);
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Write the plain text portion of the email
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
    -- Write the HTML boundary
    l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
    chr(13) || chr(10);
    l_temp := l_temp || 'content-type: text/html;' ||
    chr(13) || chr(10) || chr(13) || chr(10);
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Write the HTML portion of the message
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
    -- Write the final html boundary
    l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Send the email in 1900 byte chunks to UTL_SMTP
    l_offset := 1;
    l_ammount := 32767;
    utl_smtp.open_data(l_connection);
    while l_offset < dbms_lob.getlength(l_body_html) loop
    utl_smtp.write_data(l_connection, dbms_lob.substr(l_body_html,l_ammount,l_offset));
    l_offset := l_offset + l_ammount ;
    l_ammount := least(32767,dbms_lob.getlength(l_body_html) - l_ammount);
    end loop;
    utl_smtp.close_data(l_connection);
    utl_smtp.quit( l_connection );
    dbms_lob.freetemporary(l_body_html);
    END IF;
    END;
    Following procedure calls the above function and generate the email
    PROCEDURE generate_statistics
    IS
    l_minutes NUMBER:=0;
    l_sub_type cg_ref_codes.rv_meaning%type;
    l_gate_text VARCHAR2(5000);
    l_ves_text VARCHAR2(5000);
    l_exm_text VARCHAR2(5000);
    l_email_text VARCHAR2(5000);
    l_gate_tot NUMBER:=0;
    l_load_tot NUMBER:=0;
    l_discharge NUMBER:=0;
    l_exm_tot NUMBER:=0;
    /*Declare Cursor to get Examined Containers Summary*/
    CURSOR cur_examined_ctrs IS
    SELECT decode(eu.category,'I','Import','E','Export') Category, count(*) Total
    FROM service_events se, equipment_uses eu
    WHERE se.performed BETWEEN round(sysdate-l_minutes/1440,'mi')
    AND round(sysdate,'mi')
    AND se.tserv_id IN ('EXM')
    AND eu.gkey = se.equse_gkey
    AND eu.category IN ('I','E')
    GROUP BY eu.category;
    BEGIN
    /*Retrieve parameterized minutes*/
    l_minutes := nvl(pk_parameter.setting('STATSGMI'),0);
    /*Assign Values to generate email*/
    l_email_text := 'Terminal Statistics From: '||
    to_char(round(sysdate-l_minutes/1440,'mi'),'DD-MON-RRRR HH24:MI:SS')||
    ' To: '||to_char(round(sysdate,'mi'),'DD-MON-RRRR HH24:MI:SS')||
    chr(13) || chr(10)||chr(13) || chr(10);
    l_exm_text := 'Containers Examined'||utl_tcp.CRLF;
    FOR rec_examined_ctrs IN cur_examined_ctrs LOOP
    /*Generate Text for email - Vessel Activity Crane Wise Starts*/
    l_exm_text := l_exm_text ||rec_examined_ctrs.category ||': '||
    rec_examined_ctrs.total||utl_tcp.CRLF;
    l_exm_tot := l_exm_tot + rec_examined_ctrs.total;
    END LOOP;
    l_email_text := l_email_text||l_exm_text;
    pk_kictl_email.send_html_email('TERM STATISTICS',
    'Terminal Statistics Report',
    l_email_text,
    l_email_text
    END;
    I have been searching the reason and solution on net since last 2 days but hasn't find it yet.
    would anybody plz help me regarding this.
    Thanks
    Hassan

    I checked your suggestions after week end today and found that
    the suggestion of Nalla did not provide the result in my required format
    rewrite it as l_email_text := l_email_text||CHR(10)||l_exm_text;
    Peter & Krithika:
    I used html tag <BR> when and where needed and its gave me result in my required format
    e.g.: l_exm_text := l_exm_text ||'<br>'||rec_examined_ctrs.category ||': '||
    rec_examined_ctrs.total;
    Now I want to know if there any html tag thru which I can define the column number so that my text will start from there.
    means any html tag replacement of lpad (oracle funtion):
    Thanks
    Hassan

  • Use of jsp-file in web.xml

    hello
    can anybody explain about , when we need <jsp-file> in web.xml
    and why we use this tag in place of <url-pattern>?

    If you want to declare a JSP in your web.xml file you use the jsp-file tag instead of the servlet-class tag. Normally there is no need to declare a JSP in the web.xml file unless you want to use init-params.
    Usually people can access a JSP directly wether it is declared in the web.xml or not. So it is not that the jsp-file tag replaces the url-pattern tag so much as the url-pattern tag is not needed for a JSP. However notthing prevents you from declaring the JSP in the web.xml and then mapping the JSP to a different url that doesn't end in '.jsp'.

  • How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?

    How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?
    I myself think that (for instance) "A tribe called Quest" should be sorted under "A", not "T".
    Now I can edit the sort options manually per track and/or per selection, but I would really like to just kill this "iTunes-knows-how-you-should-sort"-feature in iTunes.
    Anyone any suggestion on how to do that?
    Thanks

    Here is a modified version of one of Doug's Scripts. My modification was to add Sort Name to the list of tags that could be changed. I tried it on a single track and it worked. I recommend backing up your library first. Select the tracks you want to change (or all tracks) and run the script from the Applescript Editor.  If it works as intended, save it so you can apply it to newly imported tracks.  And, yes, I know this isn't the exact answer to your question, you want to change a preference setting in iTunes (if there is such a setting).
    Original script can be forund at http://dougscripts.com/itunes/scripts/ss.php?sp=thistagthattag
    Modified script is below. Start up Applescript Editor, paste it into a new window.  Start up iTunes and select the tracks to modify.  Click Run in the Applescript Editor.  Follow the instructions.
    (* Put This In That
    v2.0 april 22 2008
    - runs as universal binary
    - adds "Show" tag
    - consolidated code
    - saved as script bundle
    v1.7 October 3, 2006
    - adds "Album Artist" as option
    v1.6 October 28, 2004
    - works around iTunes 4.7 selection bug
    v1.5 ('04/1)-- adds "grouping" tag
    Get more free AppleScripts and info on writing your own
    at Doug's AppleScripts for iTunes
    http://dougscripts.com/itunes/
    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    or visit http://www.gnu.org/copyleft/gpl.html
    -- CONSTANTS
    property allOptions : {"Song Name", "Artist", "Album", "Album Artist", "Composer", "Genre", "Comments", "Show", "Grouping", "Sort Name"}
    property my_title : "Put This In That"
    global thisTag, thatTag, theNewTags, theOriginalTags, yn
    tell application "iTunes"
              if selection is not {} then -- if tracks are selected...
                        set sel to selection
                        set numTracks to (length of sel)
                        set s to "s"
                        if numTracks is 1 then set s to ""
                        display dialog "The data from one tag REPLACES the data in another tag in all the selected tracks, with option to delete data in first tag." & return & return & (numTracks & " track" & s & " selected.") buttons {"Cancel", "Continue"} default button 2 with title my_title giving up after 30
                        if gave up of result is true then return
                        my choose_this_tag()
                        my choose_that_tag()
                        set yn to (button returned of (display dialog "Delete data in " & thisTag & " afterwards?" buttons {"Yes", "No"} default button 2 with title my_title giving up after 45) is "Yes")
                        set oldfi to fixed indexing
                        set fixed indexing to true
                        repeat with t from 1 to numTracks
                                  tell contents of item t of sel
                                            set theOriginalTags to {get name, get artist, get album, get album artist, get composer, get genre, get comment, get show, get grouping, get sort name}
                                            set theNewTags to theOriginalTags
                                            my do_put()
                                            set {name, artist, album, album artist, composer, genre, comment, show, grouping, sort name} to theNewTags
                                  end tell
                        end repeat
                        set fixed indexing to oldfi
              else
      display dialog "No tracks have been selected." buttons {"Cancel"} default button 1 with icon 0 giving up after 30
              end if -- no selection
    end tell
    to choose_this_tag()
              tell application "iTunes"
                        set n to (choose from list allOptions with prompt ("Select a tag to get data from:") with title my_title)
                        if n is false then error number -128
                        set thisTag to (n as text)
              end tell
    end choose_this_tag
    to choose_that_tag()
              set o to {}
              repeat with t in allOptions
                        if (t as text) is not thisTag then copy t to end of o
              end repeat
              tell application "iTunes"
                        set n to choose from list o with prompt ("Use data from the " & thisTag & " tag to REPLACE data in...") with title my_title
                        if n is false then error number -128
                        set thatTag to n as text
              end tell
    end choose_that_tag
    to do_put()
              try
                        repeat with i from 1 to (length of allOptions)
                                  if thisTag is (item i of allOptions) then
                                            set thisTag_sto to (item i of theOriginalTags)
                                            exit repeat
                                  end if
                        end repeat
                        repeat with i from 1 to (length of allOptions)
                                  if thatTag is (item i of allOptions) then
                                            set (item i of theNewTags) to thisTag_sto
                                            exit repeat
                                  end if
                        end repeat
                        if yn then
                                  repeat with i from 1 to (length of allOptions)
                                            if thisTag is (item i of allOptions) then
                                                      set (item i of theNewTags) to ""
                                                      exit repeat
                                            end if
                                  end repeat
                        end if
              end try
    end do_put

  • Java Mapping with CDATA

    One simplest way is read the data element value as the string and ignore first  six or seven characters by using substring method or so... Use the return value string for parsing the values from respective tag element using parser or manually

    Hi Xinaxu,
    Here is the java mapping code.
    public class Cdata implements StreamTransformation{
         public static void main(String[] args) {
              try{
                   Cdata genFormat=new Cdata();
                   FileInputStream in=new FileInputStream("C:\\Apps\\acm\\cdata.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\acm\\cdata1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /*input document in form of XML*/
                   Document docIn=builderel.parse(in);
                   /*document after parsing*/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element root,child,child1;
                   root=docOut.createElement("Header");
                   root.setAttribute("xmlns","urn:bp:xi:hr:edm:test:100");
                   NodeList l;
                   Node n;
                   l=docIn.getElementsByTagName("Data");
                   int i,len=l.getLength();
                   String charSet[]={"&lt;","&gt;","&amp;","&apos;","&quot;"};
                   String replaceSet[]={"<",">","&","'","\""};
                   for(i=0;i<len;++i)
                        child=docOut.createElement("Data");
                        if(l.item(i).hasChildNodes())
                             n=l.item(i).getFirstChild();
                             //System.out.println(n.getNodeType());
                             //System.out.println(n.getNodeValue());
                             int j;
                             if(n.getNodeType()==3 && n.getNodeValue().indexOf("CDATA")>=0)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.First replace
                                   * &lt; with < less than
                                     &gt; with > greater than
                                     &amp; with & ampersand 
                               &apos; with ' apostrophe
                               &quot; with " quotation mark
                               to avoid exceptions
                                  //System.out.println("s="+s);
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  int ll;
                                  ll=s.length();
                                  String a="";
                                  int count=0;
                                  //extract only xml tags from string
                                  for(j=0;j<ll;++j)
                                       if(count<2)
                                            if(s.charAt(j)=='<')
                                                 count++;
                                            if(count<2)
                                                 continue;
                                       a=a+s.charAt(j);
                                  //System.out.println("a="+a);
                                  for(j=a.length()-1,count=0;j>=0;--j)
                                            if(a.charAt(j)=='>')
                                                 count++;
                                            if(count==2)
                                                 break;
                                  if(j>=0)
                                       s=a.substring(0,j+1);
                                  System.out.println(s);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                             else if(n.getNodeType()==4)
                                  // that means this is Cdata section
                                  //capture data in a string
                                  String s=n.getNodeValue();
                                  /*if you are sure that string contains
                                   * valid xml tags. You can parse
                                   * the tags.  replace invalid characters
                                   * before parsing
                                  for(j=0;j<charSet.length;++j)
                                       s=s.replaceAll(charSet[j], replaceSet[j]);
                                  org.xml.sax.InputSource inStream = new org.xml.sax.InputSource();
                                 inStream.setCharacterStream(new java.io.StringReader(s));
                                  DocumentBuilder b=factory.newDocumentBuilder();
                                  Document cdataSection=b.parse(inStream);
                                  child1=(Element) docOut.importNode(cdataSection.getDocumentElement(),true);
                                  child.appendChild(child1);
                        root.appendChild(child);
                   docOut.appendChild(root);
                   transform.transform(new DOMSource(docOut), new StreamResult(out));
              catch(Exception e)
                   e.printStackTrace();
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
    Hope this solves your problem.
    regards
    Anupam

  • How to Read a Message with Content Type multipart/alternative

    Hi ,
    I need to write a POP3 Client to read email message ..but some times the messages comes with content type multipart/alternative
    how to parse it and read only one of the content :
    for example :
    This is a multi-part message in MIME format.
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    Assignment to workgroup Name 1 : L2 SD Service Delivery Apps Spt
    Open CI Search Code : HPSD
    Description : tesat
    General Information :
    Is the workgroup owner Aware of the addition to Workgroup : Yes
    Workgroup to be added :
    L2 SD Service Delivery Apps Spt
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <br><P>Assignment to workgroup Name 1 : L2 SD Service Delivery Apps =
    Spt</P>
    <P>Open CI Search Code : HPSD</P>
    <P>Description : tesat</P>
    <P>General Information :</P>
    <P>Is the workgroup owner Aware of the addition to Workgroup : Yes</P>
    <P>Workgroup to be added :</P>
    <P>L2 SD Service Delivery Apps Spt</P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    ------=_NextPart_000_12C25_01C6B64F.09226B00--
    The Same message is in text as well as HTML so not sure how to read it .
    currently my program is as follows
    for (int i = 0; i < found.length; i++) {
    Message m = found;
    // Get some headers
    Date date = m.getSentDate();
    Address [] from = m.getFrom();
    String subj = m.getSubject();
    String mimeType = m.getContentType();
    System.out.println(date + "\t" + from[0] + "\t" +
    subj + "\t" + mimeType);
    Object o = m.getContent();
    if (o instanceof String) {
    System.out.println("**This is a String Message**");
    System.out.println((String)o);
    } else if (o instanceof Multipart) {
    System.out.print("**This is a Multipart Message. ");
    Multipart mp = (Multipart)o;
    int count3 = mp.getCount();
    System.out.println("It has " + count3 +
    " BodyParts in it**");
    for (int j = 0; j < count3; j++) {
    // Part are numbered starting at 0
    BodyPart b = mp.getBodyPart(j);
    String mimeType2 = b.getContentType();
    System.out.println( "BodyPart " + (j + 1) +
    " is of MimeType " + mimeType);
    Object o2 = b.getContent();
    if (o2 instanceof String) {
    System.out.println("**This is a String BodyPart**");
    System.out.println((String)o2);
    } else if (o2 instanceof Multipart) {
    System.out.print(
    "**This BodyPart is a nested Multipart. ");
    Multipart mp2 = (Multipart)o2;
    int count2 = mp2.getCount();
    System.out.println("It has " + count2 +
    "further BodyParts in it**");
    } else if (o2 instanceof InputStream) {
    System.out.println(
    "**This is an InputStream BodyPart**");
    } //End of for
    } else if (o instanceof InputStream) {
    System.out.println("***********************************This is an InputStream message**");
    InputStream is = (InputStream)o;
    /* if(m.getContentType().equalsIgnoreCase("multipart/alternative")) {
    MimeMultipart mp = new MimeMultipart();
    // Assumes character content (not binary images)
    } else {*/
    BufferedReader reader
    =new BufferedReader(new InputStreamReader(is));
    String thisLine=reader.readLine();
    while (thisLine!=null) {
    System.out.println(thisLine);
    thisLine=reader.readLine();
    So when the Content TYpe is multipart/alternative it goes into InputStream message .
    any help and ideas to handel such situations ?
    Thanks
    San
    Message was edited by:
    sanrosh_95

    Try reposting that with tags (replace the {'s with ['s).
    Long story short, I think the FAQ and examples would go a long way towards explaining this, but you basically can check the content type, or check if the content contains parts, and parse each part separately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for