CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Deleting XML Segment

 



tbone587
User

Jan 31, 2012, 10:44 AM

Post #1 of 2 (679 views)
Deleting XML Segment Can't Post

Can someone offer recommendations on the best way to delete a segment of code (<input></input>) by inputting the the sd value? For example I enter 1 and it deletes the item block for User 1.

Code
        <item_list> 
<item>
<fn>User</fn>
<ln>1</ln>
<ct>0810</ct>
<sd>1</sd>
</item>
<item>
<fn>User</fn>
<ln>2</ln>
<ct>0812</ct>
<sd>2</sd>
</item>

</item_list>



rovf
Veteran

Feb 1, 2012, 4:29 AM

Post #2 of 2 (674 views)
Re: [tbone587] Deleting XML Segment [In reply to] Can't Post

You should parse the XML code into a hash (using XML::Parser or XML::Simple or, maybe, XML::Parser::Lite). You can then easily discard the data for User 1, and recreate the XML format.

For recreating XML, XML::Simple already provides a function. I don't have experience with XML::Parser, so I can't give a recommendation.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives