More dynamic than what? If you already have a simple cmd script, why are you not using it?
Microsoft provides an object (actually two) for traversing the nodes in a XML file, however yours is ill-formed and would choke a VBScript. For instance, judging from your post, <name> and <vir_name> are siblings. What is the parent node? Where do <DISPLAY_NAME> and <CANONICAL_NAME> logically fit into the tree? Is there a root to the tree and if so what is it.
Personally I don't find Gawk to be very intuitive, but it works and sometimes you need brute force instead of dynamic.
hi, i have a script that does what the gawk script above but i dont really need it in most situations
for example i have properties in some xml
<PROPERTY>
<CANONICAL_NAME></CANONICAL_NAME>
<CURRENT_STATE>4</CURRENT_STATE>
<DISPLAY_NAME>Hello</DISPLAY_NAME>
<FORMAT_STRING></FORMAT_STRING>
<IS_COMPUTED>1</IS_COMPUTED>
<IS_MANAGED>0</IS_MANAGED>
<IS_MULTI_VALUED>0</IS_MULTI_VALUED>
<IS_PCODE></IS_PCODE>
<IS_STRING>1</IS_STRING>
<IS_URI></IS_URI>
<LOCALE_ID>1</LOCALE_ID>
<PROPERTY_ID>11111111</PROPERTY_ID>
<STORAGE_UNIT></STORAGE_UNIT>
<TIP_TEXT></TIP_TEXT>
<VALUE_SORT_TYPE></VALUE_SORT_TYPE>
<VIEWBY_UNIT></VIEWBY_UNIT>
<MANAGED_PROPERTY_VALUES></MANAGED_PROPERTY_VALUES>
</PROPERTY>
these are most situation and the properties are build that way so what i need is
a script that will take 'Hello' from <DISPLAY_NAME> and paste it in <CANONICAL_NAME>
so the final file will look like that
<PROPERTY>
<CANONICAL_NAME>Hello</CANONICAL_NAME>
<CURRENT_STATE>4</CURRENT_STATE>
<DISPLAY_NAME>Hello</DISPLAY_NAME>
<FORMAT_STRING></FORMAT_STRING>
<IS_COMPUTED>1</IS_COMPUTED>
<IS_MANAGED>0</IS_MANAGED>
<IS_MULTI_VALUED>0</IS_MULTI_VALUED>
<IS_PCODE></IS_PCODE>
<IS_STRING>1</IS_STRING>
<IS_URI></IS_URI>
<LOCALE_ID>1</LOCALE_ID>
<PROPERTY_ID>11111111</PROPERTY_ID>
<STORAGE_UNIT></STORAGE_UNIT>
<TIP_TEXT></TIP_TEXT>
<VALUE_SORT_TYPE></VALUE_SORT_TYPE>
<VIEWBY_UNIT></VIEWBY_UNIT>
<MANAGED_PROPERTY_VALUES></MANAGED_PROPERTY_VALUES>
</PROPERTY>
putting manually a possible situation in the script will force me to write a wall of scripting
and i have numerous properties in the xml that the structure are the same as above but only the property_id changes and the labeling values
so what i need is that it will go trough the file and put <DISPLAY_NAME> value in <CANONICAL_NAME>
thats pretty much it...
thanks