Here's the dilemma - I frequently rename log files and archive them but I would now also like to audit what I've done to ensure I didn't miss anything along the way. Here is a sample of what an xml file looks like prior to initiating filename changes:
Code:
<CurrentFileNames>
<CurrentFileName>foo1.txt</CurrentFileName>
<CurrentFileName>foo2.txt</CurrentFileName>
<CurrentFileName>foo3.txt</CurrentFileName>
<CurrentFileName>foo4.txt</CurrentFileName>
<CurrentFileName>foo5.txt</CurrentFileName>
<CurrentFileName>foo6.txt</CurrentFileName>
<CurrentFileName>foo7.txt</CurrentFileName>
<CurrentFileName>foo8.txt</CurrentFileName>
</CurrentFileNames>
<UpdatedFileNames>
<UpdatedFileName>goo1.txt</UpdatedFileName>
<UpdatedFileName>goo2.txt</UpdatedFileName>
<UpdatedFileName>goo3.txt</UpdatedFileName>
<UpdatedFileName>goo4.txt</UpdatedFileName>
<UpdatedFileName>goo5.txt</UpdatedFileName>
<UpdatedFileName>goo6.txt</UpdatedFileName>
<UpdatedFileName>goo7.txt</UpdatedFileName>
<UpdatedFileName>goo8.txt</UpdatedFileName>
</UpdatedFileNames>
As you can see, it shows the current filenames and the names after renaming. We'll call this file foo.xml.
Now, AFTER renaming files, it looks somewhat like this:
Code:
<CurrentFileNames>
<CurrentFileName>goo1.txt</CurrentFileName>
<CurrentFileName>goo2.txt</CurrentFileName>
<CurrentFileName>goo3.txt</CurrentFileName>
<CurrentFileName>goo4.txt</CurrentFileName>
<CurrentFileName>goo5.txt</CurrentFileName>
<CurrentFileName>goo6.txt</CurrentFileName>
<CurrentFileName>goo7.txt</CurrentFileName>
<CurrentFileName>goo8.txt</CurrentFileName>
</CurrentFileNames>
We'll call this goo.xml.
How would I pull "UpdatedFileName" from foo.xml and "CurrentFileName" from goo.xml into a single output file? I would rather not used the document() function because the filenames are dynamic (won't always bee foo.xml & goo.xml). If using the document() function is the easiest way, then that's fine too. I can rename files before and after.