How to remove/ignore the element using SAXParser

hello all,
I want to parse the text content in string from the existed xml file. but had problem with the parser. Does anyone have good idea, how to remove or ignore the <link> tag in tag <text>?
IS: the output is only the rest of part text behind <link style="blue" src="www.test.com" />.
Wanted: the whole text in <text> tags. like "Reach more customers by creating targeted micro-sites using test's multi-store retailing functionality."
Given below is my code :
<?xml version="1.0"?>
<test xmlns="http://www.test.com/test">
<title>test title</title>
<text>Reach more customers by creating targeted micro-sites using test's<link style="blue" src="www.test.com" /> multi-store retailing functionality.</text>
</test>java code using SAXParser
  public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
  public void endElement(String uri, String localName, String qName) throws SAXException {
    if (qName.equals("text")) {
      System.out.println("content: " + text);
  public void characters(char[] ch, int start, int length) throws SAXException {
    String str = new String(ch, start, length);
    if (str.length() > 0)
      text = text == null ? str : text + str;
...Edited by: lauehuang on Sep 9, 2008 4:37 AM

i think u can't modify the xml file using SAX
SAX is only for reading XML
for any modifications in xml file u have to use DOM parser....
correct me if i m wrong....
Thanks & Regs
Ravi

Similar Messages

  • Trying to update iPad mini. Old email continues to appear and can't authenticate. How to remove it totally and use my iCloud I.D.?

    Trying to update iPad mini. Old email continues to appear and can't authenticate. How to remove it totally and use my iCloud I.D.?

    If you have any apps that were acquired with the old ID they will always be tied to that ID. Delete them and reacquire them with the new ID that you have in Settings > iTunes and App Store

  • How to remove # from the end of each lines of .csv file.

    Hi ,
    I have uploaded .csv file from my local m/c (windows) to application server (unix) thru. FM 'ARCHIVFILE_CLIENT_TO_SERVER'
    Issue is when I open the file in AL11 it is showing # at end of each line. Click below link to see the output file.
    [https://docs0.google.com/document/edit?id=1PzjhljdCC2Wgj9L1dZ51G4pHJ0G_7jJwQAMqcJHdggc&hl=en#]
    Pls. help me how to remove all the # from the file.
    Thanks in advance.
    Devinder

    Hi ,
    use this
    Declare this 
    that # value is actually use of   Tab in file 
    so in order to remove that  use below code 
    DATA :C_TAB(1) TYPE c VALUE   cl_abap_char_utilities=>HORIZONTAL_TAB .
    loop at it_data .
    refno = it_data-line .
    REPLACE ALL OCCURRENCES OF c_tab IN refno WITH ''.
    modify it_data .
    endloop.
    Regards
    Deepak.

  • How to remove a lense flare using motion 5, how to remove a lense flare using motion 5

    how to remove a lense flare using motion 5,

    You can't. There's no magic bullet for the damage to the image a lens flare creates. Those areas are overexposed and there's no way to recover the lost detail. If you think there is enough detail, you could try duplicating the video layer, masking the flare area and try manipulating the (Filters > Color Correction >) Levels to "expand" the data (push the black level up to the beginning of the histogram data and adjust the "gamma"/gray level... probably right to darken the image a little -- don't move the white level, the image is blown out enough.) Try to bring the Levels effect into balance with the surrounding video (layer below the masked version.) Feathering the mask might help with that...
    Good luck!

  • How to find out the Transactions used per month & the USER who used that

    Hi,
    1)How to find out the Transactions used per month & the USER who used that?
    2)and can i get the above same for minimum 20 month?
    System : SAP- Enterprise Core Component.

    You can use my program...
    *& Report  Z_ABAP_TCODE_MONITOR
    *****&  Program Type          : Report                                 *
    *****&  Title                 : Z_ABAP_TCODE_MONITOR                   *
    *****&  Transaction code      : ZTCODE_USAGE                           *
    *****&  Developer name        : Shailendra Kolakaluri                  *
    *****&  Deveopment start date : 26 th Dec 2011                         *
    *****&  Development Package   : ZDEV                                   *
    *****&  Transport No          : DEVK906086                                       *
    *****&  Program Description   : This program is to display
    *List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    *& Modification history
    REPORT  Z_ABAP_TCODE_MONITOR.
    *& List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    TYPE-POOLS : slis.
    DATA: ind TYPE i,
          fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          layout TYPE slis_layout_alv,
          variant TYPE disvariant,
          events  TYPE slis_t_event WITH HEADER LINE,
          heading TYPE slis_t_listheader WITH HEADER LINE.
    *REPORT  z_report_usage.
    TYPES: BEGIN OF zusertcode,
      date   TYPE swncdatum,
      user   TYPE swncuname,
      mandt     TYPE swncmandt,
      tcode     TYPE swnctcode,
      report TYPE swncreportname,
      count     TYPE swncshcnt,
    END OF zusertcode.
    *data   : date type n.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode,
          wa           TYPE zusertcode,
          t_ut         TYPE STANDARD TABLE OF zusertcode,
          wa_result    TYPE zusertcode,
          t_result     TYPE STANDARD TABLE OF zusertcode.
    PARAMETER: month TYPE dats DEFAULT sy-datum.
    *PARAMETER: date TYPE dats.
    *select-options : username for wa_usertcode-account.
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM get_fieldcatalog.
      PERFORM set_layout.
    PERFORM get_event.
    PERFORM get_comment.
      PERFORM display_data.
    FORM get_data .
    *date = sy-datum - 2 .
    After start-of-selection add this line (parameter Month required 01 as day).
      concatenate month+0(6) '01' into month.
      CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          ASSIGNDSYS    = 'DEV'
          periodtype    = 'M'
          periodstrt    = month
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      wa-date  = month.
    *wa-date  = date.
      wa-mandt = sy-mandt.
    wa_usertcode-account = username.
      LOOP AT t_usertcode INTO wa_usertcode.
        wa-user = wa_usertcode-account.
        IF wa_usertcode-entry_id+72 = 'T'.
          wa-tcode  = wa_usertcode-entry_id.
          wa-report = space.
        ELSE.
          wa-tcode  = space.
          wa-report = wa_usertcode-entry_id.
        ENDIF.
        COLLECT wa INTO t_ut.
      ENDLOOP.
      SORT t_ut BY report ASCENDING.
      CLEAR: wa, wa_result.
    endform.
    FORM get_fieldcatalog .
    fcat-tabname     = 't_ut'.
    fcat-fieldname   = 'DATE'.
    fcat-seltext_l   = 'Date'.
    fcat-key         = 'X'.
    APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'MANDT'.
      fcat-seltext_l   = 'Client'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'USER'.
      fcat-seltext_l   = 'User Name'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'TCODE'.
      fcat-seltext_l   = 'Transaction Code'.
      fcat-key         = 'X'.
      APPEND fcat.
    ENDFORM.
    *&      Form  SET_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM set_layout .
      layout-colwidth_optimize = 'X'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  GET_EVENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_event .
    events-name = slis_ev_top_of_page.
    events-form = 'TOP_OF_PAGE'.
    APPEND events.
    *ENDFORM.                    " GET_EVENT
    **&      Form  GET_COMMENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_comment .
    DATA: text(30).
    text = 'Billing Report'.
    heading-typ = 'H'.
    heading-info = text.
    APPEND heading.
    *ENDFORM.                    " GET_COMMENT
    **&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    *FORM top_of_page .
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         it_list_commentary       = heading[]
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    *ENDFORM.                    " top_of_page
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      sort t_ut[].
    DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          is_layout          = layout
          it_fieldcat        = fcat[]
          i_save             = 'A'
          is_variant         = variant
          it_events          = events[]
        TABLES
          t_outtab           = t_ut
        EXCEPTIONS
          program_error      = 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.
    ENDFORM.                    " DISPLAY_DATA

  • How can I find the schemas used in a database?  Any system table contains?

    How can I find the schemas used in a database? 
    Any system table contains?
    I would like to know sql statement (dictionary object name) which tells the all schema s in a database like dba_users.

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • HT4759 How can I know the Devices using my i Cloud or Apple ID?

    How can I know the Devices using my i Cloud or Apple ID?

    This information is not available. If you have any misgivings, change your password at http://appleid.apple.com - it should be at least 8 characters - 12 would be better - of which one must be a capital letter and one a numeral. No punctuations signs, and no real words.

  • How can I suspend the job using IPP_CANCEL_JOB of ipp api

    hi, Can anyone help how can I suspend the job using IPPCANCELJOB of ipp api,so that I can cancel my previous job.
    thanks

    As before, you should try http://lists.apple.com/mailman/listinfo/printing.

  • How to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS

    Dear gurus,
    how to remove all the cleaup events from DBA_AUDIT_MGMT_CLEAN_EVENTS
    Arun

    Hi,
    Take a look:
    http://www.morganslibrary.org/reference/pkgs/dbms_audit_mgmt.html
    Regards,

  • How can I Improve the Performance using Global Temo Tables ??

    Hi,
    Can anyone tell me , How can i make use of Global Temporary Tables to improve the Performance.
    I have few sample scripts ,
    Say i have the View based on some Complex query like ,
    CREATE OR REPLACE VIEW Profile_values_view AS
    SELECT d.Profile_option_name, d.Profile_option_id, Profile_option_value,
    u.User_name, Level_id, Level_code
    FROM Profile_definitions d, Profile_values v, Profile_users u
    WHERE d.Profile_option_id = v.Profile_option_id
    AND ((Level_code = 'USER' AND Level_id = U.User_id) OR
    (Level_code = 'DEPARTMENT' AND Level_id = U.Department_id) OR
    (Level_code = 'SITE'))
    AND NOT EXISTS (SELECT 1 FROM PROFILE_VALUES P
    WHERE P.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID
    AND ((Level_code = 'USER' AND
    level_id = u.User_id) OR
    (Level_code = 'DEPARTMENT' AND
    level_id = u.Department_id) OR
    (Level_code = 'SITE'))
    AND INSTR('USERDEPARTMENTSITE', v.Level_code) >
    INSTR('USERDEPARTMENTSITE', p.Level_code));
    Now i have created the Global temp Table as ,
    CREATE GLOBAL TEMPORARY TABLE Profile_values_temp
    Profile_option_name VARCHAR(60) NOT NULL,
    Profile_option_id NUMBER(4) NOT NULL,
    Profile_option_value VARCHAR2(20) NOT NULL,
    Level_code VARCHAR2(10) ,
    Level_id NUMBER(4) ,
    CONSTRAINT Profile_values_temp_pk
    PRIMARY KEY (Profile_option_id)
    ) ON COMMIT PRESERVE ROWS ORGANIZATION INDEX;
    Now I am Inserting the Records into Temp table as
    INSERT INTO Profile_values_temp
    (Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id)
    SELECT Profile_option_name, Profile_option_id, Profile_option_value,
    Level_code, Level_id
    FROM Profile_values_view;
    COMMIT;
    Now what my doubt is, when do i need to execute the Insert Statement.
    Say , if the View returns few millions of records , then loading such a data into Global Temporary table takes lot of time.
    Then what is the use of Global Temporary tables and how can i improve the Performance using the same.
    Raj

    Thanks for the responce ,
    There are 2 to 3 complex views in our database, and there always be more than 5000+ users will be workinf on the application and is OLTP application. Those complex views are killing the application performance.
    I what i felt was, if i create the Global Temporary tables for thow views and will be able to load the one third million of records returned by the views in to cache and can improve the application performance.
    I have created the Global Temporary tables for 2 views with the option On Commit Preserve , But after am inserting the records into the Temp table and when i Issue the commit statement, the Temp table is getting Cleared.
    I really got surpised of this behaviour as i know that with the Option On Commit Preserve , the rows should retain in the Temp Table, Instead , it's getting cleared.
    Pelase suggest , what to do ??
    Raj

  • How can I change the value used in a Criteria Rule in a Subscription agent

    Dear mobile heroes.... How can I change the value used in a Criteria Rule in a Subscription agent in a quality environment? (CRM 70 SP04).
    I have built a subscription agent in dev, which uses a static where clause to filter activity_object on VKORG. I need to filter on a different VKORG value in the quality environment, but when I change the value of the sales org, the change is not saved. I have tried this even non 'activated'  subscription agents, but it still does not appear possible to change and save the changes.
    This poses a big problem because the VKORG value I want to use does not even exist in the dev environment, so I could not even rebuild in dev and transport the new agent to quality. Can anyone help me?

    Too old to care now.

  • TS4147 How to remove all the duplicated contacts from ICloud?

    How to remove all the duplicated contacts from ICloud?

    If your Mac is syncing contacts with your iCloud account, open Contact on your Mac and go to Card>Look for Duplicates, then Merge the found duplicates.  These changes will be synced to iCloud.

  • I had a "pdf export" plan and upgraded it to "pdf pack" plan and it was charged the full price of the new plan in my credit card. How to get back the non used part of the old plan?

    I had a "pdf export" plan and upgraded it to "pdf pack" plan and it was charged the full price of the new plan in my credit card. How to get back the non used part of the old plan?

    Hi edilsoncf,
    I've seen your question on several forums, and responded there. Did you get your subscription sorted out?
    See: How do I get a refund if I have multiple Acrobat service subscriptions?
    Best,
    Sara

  • How to display all the surveys using content query web part

    Can you please tell me how to display all the surveys using content query web part in more details? I also created a subsite and multiple surveys in that site. Then, I inserted a Content Query Web Part and select the List Type to be "Survey",
    however, it returned nothing. Did I miss anything?

    Hi,
    OOTB Survey List does not contain any
    Content Types and it has the following structure:
    Response entry is represented by
    List Item
    Response entry consist of questions and answers, where Question correspond to
    Field and Answer to Item value respectively.
    For querying Survey List via CQWP  the following properties could be used
    BaseType 
    <Lists BaseType="4">
    ServerTemplate
    <Lists ServerTemplate="102">
    Example
    To retrieve all the responses from Survey lists, specify List Type property as shown on picture
    Reference:
    http://stackoverflow.com/questions/17280778/display-all-surveys-using-content-query-web-part
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How Can I Move the Elements by Tap on Touchscreen or Mouse Down Event in Adobe Edge Animate?

    hi , how can i move the elements by tap on tochscreen or mouse down event in adobe edge animate? like action for moving car.

    in my idea is mousedown action or tap on touchscreen plays the role of car accelerator, (gas pedal) when i left click on mouse my car moves forward and the car doesnt move when I dont click or tap.
    Do you have a solution?

Maybe you are looking for