|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Small program to manipulate this XML? how??http://www.keepitsimplekid.com/xml/Ad00304.xml What I want the program to do. it would look at all.xml documents in a directory for example directory C:\XML\rename A Rename button would be pressed on the form and the program would go through all the XML documents, first rename the documents from FILENAME.XML to FIRNAME.XML.BAK - I still want to keep the FILENAME.XML document, because that is the one the manipulation will take place on. I then want to look at each .xml document and REPLACE the Untitled Ad text on the fourth line with whatever is here: - <Application_Info AI_TYPE="ETS_ADVERTISER"> <Ai_Item NAME="LEAF GUARD" /> So <Meta NAME="Untitled Ad" <--- that Untitled Ad text would now become: <Meta NAME="LEAF GUARD" I then want to save the file. So the directory will now contain the old file with Untitled Ad in it as the filename.xml.bak and then the converted file as .xml Also, there will be more than 1 xml doc in that directory, so this needs to go through each one, rename and manipulate them. how would I do this? I have no Idea how to even begin this. Ron <pts4***@yahoo.com> wrote in news:1178393233.389672.298540
@y5g2000hsa.googlegroups.com: > how would I do this? I have no Idea how to even begin this. You have a couple ways to loading up the document and finding the particular field to change. In the System.XML namespace you can use an XMLReader or the XMLDocument classes. XMLReader is forward only and allows you to loop through the document. XMLDocument loads the entire document in a DOM and you can navigate directly to the location with an XPATH query. I personally like using XPATH - it's very powerful and allows you to perform queries, etc on the document. However if the document is not suited to be queried (i.e. each doc is slightly different), perhaps consider looping through all the elements and parse out the attributes appropriately.
Databinding DateTimePicker and zeroing results?
Fun with products and Expression columns Delegates and AddressOf .net dll vs vb6 dll Comparing Alphanumeric strings VB.NET compiler does not find type error at compiletime System Menu (On Top) VB.NET 2003 C# - MS Access SQL using OleDbCommand Getting and updating columns in database How do I create a Serial port listner |
|||||||||||||||||||||||