From: Daniel S. <sh...@ir...> - 2003-08-28 17:13:04
|
I did not put much thought yet but here is an idea... With the xml ed, we are actually replacing something with something else. So the basic idea is xml ed -u "..." -x "..." where -u is the r-left and -x is the r-right values. However, it is often difficult to construct an XPath for the r-value in one statement. I was rather thinking something in the line of : xml ed -u "..." -r ...multiple statements... In multiple statements we must be able to match (-m), copy (-c), add a tag (-e), get a value (-v), evaluate an XPath (-x), delete a tag (-d) and maybe more. Each of these actions are "piped" together as usual, and the result of the last command will be pasted in the l-value. I dont know what can happen if you try to replace an attribute with an XML node instead of a value? Therefore we could do something like: xml ed -u "..." -r -m "/Record/Number" -v "node()" -x "some XPath that adds 1 to the -v" ... This example is obvisouly overkill for what it does. Daniel Shane |