[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml4lib
Subject:    [XML4LIB] using xml::libxml to find & replace in xml documents
From:       Ryan.Wick () oregonstate ! edu (Wick, Ryan)
Date:       2004-07-09 11:21:20
Message-ID: 5B7F6F34471D3D42851392808677CA140E1D79 () mtadams ! nws ! oregonstate ! edu
[Download RAW message or body]

I haven't worked with XML::LibXML before, but for a similar situation I created an XSL stylesheet that acts as a find and replace mechanism. Just perform the transformation, and you get all of the original file as XML except where you elected to make changes. It handles processing instructions, attributes, etc.

Let me know if you're interested in the XSL file.

Ryan Wick
Information Technology Consultant
Special Collections - OSU Libraries
Oregon State University
541-737-2075
ryan.wick@oregonstate.edu
http://osulibrary.oregonstate.edu/specialcollections


-----Original Message-----
From: xml4lib@webjunction.org
[mailto:xml4lib@webjunction.org]On Behalf Of Eric Lease Morgan
Sent: Thursday, July 08, 2004 9:22 PM
To: Multiple recipients of list
Subject: [XML4LIB] using xml::libxml to find & replace in xml documents



Has anybody here written one or more Perl scripts using XML::LibXML to 
find & replace in XML documents?

I have a set of 700 XML files. Each one has an incorrect attribute 
value in a processing instruction, a few invalid attributes in a 
particular element, and a set of elements that are no longer valid 
against the DTD.

I want to use XML::LibXML to clean up these files, and I'm hope someone 
out there has already done this to some extent and can share their 
code. While the XML::LibXML modules are very functional, I wish they 
had more examples in their PODs.

-- 
Eric Lease Morgan
University Libraries of Notre Dame


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic