SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    May 2002
    Location
    Bangalore India
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Modifying XML files

    Hi,
    I have a requriment where i have to modify the values of elements and add new elements in an xml file.....How can i do this.
    for example

    say this is the xml file
    <abc>
    <xyz>sana</xyz>
    </abc>

    and i need to modify it to

    <abc>
    <xyz>NASA</xyz>
    <def>HELP</def>
    </abc>


    Can any one help me...?

    ------------------
    sanagaram
    sanagaram

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modifying XML files

    As far as I know you can only get and set XML values using ST. You are trying to add new nodes.
    It looks to me like you would have to use XSLT or some scripting language to process the actual .xml file throwing the output back at the browser. Both Python and Perl have reasonable libraries for both SAX and DOM.
    However, I have no experience of testing XML with ST.

    ------------------




    [This message has been edited by johntest (edited 12-13-2002).]
    Tempus fugit, Carpe Diem, et al

  3. #3
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modifying XML files

    Look in the downloads section for an xml parser written by David Genrich. It works really well.

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Location
    bangalore,karnataka,india
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Modifying XML files

    Hello Sana,
    We were also facing same problem here. Workaround we found for that is as we do for any text file:

    1. read each lines of the XML file to a string
    2. search for the pattern in the string using "MatchStr" function
    3. write the line to a new XML file
    4. If the string matches write your <def>HELP</def> string line to the new file
    5. Delete your Original File
    6. Rename your new file as the original one.

    Hope this may help you

    Regards
    Avinash Gatty


    ------------------
    avi..
    avi..

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:56 AM.

Copyright BetaSoft Inc.