I need to remove &lt;batchRequest&gt; and &lt;/batchRequest&gt; from my XML file in a batch file.   Is it possible?  My current file:  &lt;batchRequest&gt;&lt;sid sid="100000000" test="false" &gt;&lt;/sid&gt; &lt;/batchRequest&gt; &lt;batchRequest&gt;&lt;sid sid="100000000" test="false" &gt;&lt;/sid&gt; &lt;/batchRequest&gt;   And I need this:   &lt;sid sid="100000000" test="false" &gt;&lt;/sid&gt; &lt;sid sid="100000000" test="false" &gt;&lt;/sid&gt;   I'm stuck on this setting    set str=!str:&lt;batchRequest&gt;=!   If I use   set str=!str:batchRequest=!   It works, but isn't what I need.  My code so far:  @echo on setlocal enabledelayedexpansion  For /f "tokens=* delims= " %%a in (_1000_1008603__30122015_153242_all.xml) do ( Set str=%%a set str=!str:&lt;batchRequest&gt;=! echo !str!&gt;&gt;_1000_1008603__30122015_153242_all_NEW.xml )
3334
I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. "FOO") with another (ex. "BAR"). What is the simplest way to do that? Any built in functions?
73459
I have an XML file on my server. In that file, I have many tags in which there is a tag for example, "container" tag. I need to fetch the content of all the container tags content separately. Many thanks in advance.
106533
I am trying to take the last line from a logfile and remove some text from the beginning and end of it and put it into a new text file. I have minimal batch experience, any help is appreciated.  last line:   Opening track for playback: "D:\Music\musicfile.m4a"   Path to the logfile:   %USERPROFILE%\Documents\file.log   What I want the last line to look like when it is done:   musicfile
16076
What's the difference between &lt;&lt;, &lt;&lt;&lt; and &lt; &lt; in bash?
89840
The full html setting is only allowing certain tags to go through. How do I turn this off and allow all tags?     Full HTML   Allowed HTML tags: &lt;a&gt; &lt;blockquote&gt; &lt;br&gt; &lt;cite&gt; &lt;code&gt; &lt;dd&gt; &lt;div&gt; &lt;dl&gt; &lt;dt&gt; &lt;em&gt; &lt;li&gt; &lt;ol&gt; &lt;p&gt; &lt;span&gt; &lt;strong&gt; &lt;ul&gt;
18539
I've got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML.  Is there any way to change the returned mime type of the php output on the fly from text/html to text/xml or application/xml?
68575
I have an input xml file like below INPUT FILE &lt;ReconSummary&gt; &lt;entryName&gt;Total Deep&lt;/entryName&gt; &lt;Code&gt;777&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Saurav&lt;/entryName&gt; &lt;Code&gt;666&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Ankur&lt;/entryName&gt; &lt;Code&gt;555&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;  I want to comment the tag if i find the pattern &quot;Total Deep&quot; so that the output file looks like below OUTPUT &lt;!--&lt;ReconSummary&gt; &lt;entryName&gt;Total Deep&lt;/entryName&gt; &lt;Code&gt;777&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;--&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Saurav&lt;/entryName&gt; &lt;Code&gt;666&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;   &lt;ReconSummary&gt; &lt;entryName&gt;Total Ankur&lt;/entryName&gt; &lt;Code&gt;555&lt;/Code&gt; &lt;License&gt;L&lt;/License&gt; &lt;Tran&gt;H20&lt;/Tran&gt; &lt;job&gt;1234&lt;/job&gt; &lt;/ReconSummary&gt;  Since i am new to shell scripting, can anyone help me out as to how i can apply this with the help of shell scripting?
31495
How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it.
120955
I am creating a lightweight editor in C# and would like to know the best method for converting a string into a nicely formatted XML string.  I would hope that there's a public method in the C# library like "public bool FormatAsXml(string text, out string formattedXmlText)", but it couldn't be that easy, could it?  Very specifically, what would the method "SomeMethod" have to be that would produce the output below?  string unformattedXml; string formattedXml;  unformattedXml = "&lt;?xml version=\"1.0\"?&gt;&lt;book&gt;&lt;author&gt;Lewis, C.S.&lt;/author&gt;&lt;title&gt;The Four Loves&lt;/title&gt;&lt;/book&gt;" formattedXml = SomeMethod(unformattedXml);  Console.WriteLine(formattedXml);   Output:  &lt;?xml version="1.0"?&gt;   &lt;book id="123"&gt;     &lt;author&gt;Lewis, C.S.&lt;/author&gt;     &lt;title&gt;The Four Loves&lt;/title&gt;   &lt;/book&gt;
61794
I have a Partner sending some data to a Triggered Email/Data Extension which includes a column for XML data.   The trigger is erroring and not allowing the data to get to the Data Extension.   Below is what they are sending over. Is the formatting of the XML incorrect?  XML data that I've used in the past in Data Extensions starts with....   &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;   This version of XML starts with... {"XML":  Could that be it?  {"To": {"SubscriberKey": "test@acme.com", "ContactAttributes": {"SubscriberAttributes": **{"XML":** "&lt;root&gt;&lt;ITEM&gt;&lt;ITEM_PRODUCT_NAME&gt;dark chocolate nuts &amp; sea salt&lt;/ITEM_PRODUCT_NAME&gt;&lt;ITEM_PRODUCT_SKU&gt;15127&lt;/ITEM_PRODUCT_SKU&gt;&lt;ITEM_PRODUCT_URL&gt;https://www.test.com/15127.html&lt;/ITEM_PRODUCT_URL&gt;&lt;ITEM_PRODUCT_IMG_URL&gt;https://www.test.com/images/nuts.png&lt;/ITEM_PRODUCT_IMG_URL&gt;&lt;ITEM_QTY&gt;1&lt;/ITEM_QTY&gt;&lt;ITEM_SUBSCRIPTION_PRICE&gt;12.59&lt;/ITEM_SUBSCRIPTION_PRICE&gt;&lt;ITEM_TOTAL&gt;12.59&lt;/ITEM_TOTAL&gt;&lt;/ITEM&gt;&lt;ITEM&gt;&lt;ITEM_PRODUCT_NAME&gt;crunchy peanut butter&lt;/ITEM_PRODUCT_NAME&gt;&lt;ITEM_PRODUCT_SKU&gt;41800&lt;/ITEM_PRODUCT_SKU&gt;&lt;ITEM_PRODUCT_URL&gt;https://www.test.com/images/butter.png&lt;/ITEM_PRODUCT_IMG_URL&gt;&lt;ITEM_QTY&gt;1&lt;/ITEM_QTY&gt;&lt;ITEM_SUBSCRIPTION_PRICE&gt;11.37&lt;/ITEM_SUBSCRIPTION_PRICE&gt;&lt;ITEM_TOTAL&gt;9.55&lt;/ITEM_TOTAL&gt;&lt;/ITEM&gt;&lt;ITEM&gt;&lt;ITEM_PRODUCT_NAME&gt;pear cinnamon &amp; pecan&lt;/ITEM_PRODUCT_NAME&gt;&lt;ITEM_PRODUCT_SKU&gt;17227&lt;/ITEM_PRODUCT_SKU&gt;&lt;ITEM_PRODUCT_URL&gt;https://www.test.com&lt;/ITEM_PRODUCT_URL&gt;&lt;ITEM_PRODUCT_IMG_URL&gt;https://www.test.com/images/apples.png&lt;/ITEM_PRODUCT_IMG_URL&gt;&lt;ITEM_QTY&gt;1&lt;/ITEM_QTY&gt;&lt;ITEM_SUBSCRIPTION_PRICE&gt;12.59&lt;/ITEM_SUBSCRIPTION_PRICE&gt;&lt;ITEM_TOTAL&gt;12.59&lt;/ITEM_TOTAL&gt;&lt;/ITEM&gt;&lt;/root&gt;", "SHIPPING_LNAME": "Tester", "FIRST_NAME": "Test", "LAST_NAME": "Tester", "ORDER_TOTAL_SAVINGS": -5.97, "MERCHANT_ORDER_ID": "1810002352", "SHIPPING_ADDRESS_STATE": "NY", "ORDER_PLACE_DATE_LONG": "Fri 11 January 2019", "SHIPPING_ADDRESS_ZIP": "10004", "ORDER_SHIPPING": 0.00, "CARD_TYPE": "Visa", "ORDER_SUBTOTAL": 47.32, "ORDER_PLACE_DATE_SHORT": "01/11/2019", "SHIPPING_FNAME": "Test", "SHIPPING_ADDRESS_TOWN": "new york", "ORDER_TOTAL": 47.32, "CARD_EXPIRE": "12/2027", "CARD_HOLDER": "Test Tester", "SHIPPING_ADDRESS_1": "75 broad st", "SHIPPING_ADDRESS_2": "fl 23"}}, "Address": "acme@test.com"}}   AMPSCRIPT IN EMAIL Calling the XML....  %%[   var @LOOPINGAPPENDIX  set @LOOPINGAPPENDIX = AttributeValue("LOOPINGAPPENDIX")  set @productRows = BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM", 0)  ]%%   %%[   for @j = 1 to RowCount(@productRows) do       set @productXML = Concat("", Field(Row(@productRows, @j), "XML"), "")      set @ITEMPRODUCTNAME = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_PRODUCT_NAME", 0), 1), "Value"))      set @ITEMPRODUCTSKU = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_PRODUCT_SKU", 0), 1), "Value"))      set @ITEMPRODUCTURL = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_PRODUCT_URL", 0), 1), "Value"))      set @ITEMPRODUCTIMGURL = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_PRODUCT_IMG_URL", 0), 1), "Value"))      set @ITEMQTY = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_QTY", 0), 1), "Value"))      set @ITEMSUBSCRIPTIONPRICE = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_SUBSCRIPTION_PRICE", 0), 1), "Value"))      set @ITEMTOTAL = Trim(Field(Row(BuildRowSetFromXML(@LOOPINGAPPENDIX, "/root/ITEM/ITEM_TOTAL", 0), 1), "Value"))      set @rowColor = Iif(Mod(@j,2) == 0, "#efefef", "#ffffff")   ]%%   %%[endif]%%   %%[next @j]%%
35437
I'm looking for a function in batch that recursive delets all files/folders older than X Days from a given path.  Is there a Fast and easy snippet that could be placed in a batch function?
66183
I have a string that represents a non indented XML that I would like to pretty-print. For example:  &lt;root&gt;&lt;node/&gt;&lt;/root&gt;   should become:  &lt;root&gt;   &lt;node/&gt; &lt;/root&gt;   Syntax highlighting is not a requirement. To tackle the problem I first transform the XML to add carriage returns and white spaces and then use a  tag to output the XML. To add new lines and white spaces I wrote the following function:   function formatXml(xml) {     var formatted = '';     var reg = /(&gt;)(&lt;)(\/*)/g;     xml = xml.replace(reg, '$1\r\n$2$3');     var pad = 0;     jQuery.each(xml.split('\r\n'), function(index, node) {         var indent = 0;         if (node.match( /.+&lt;\/\w[^&gt;]*&gt;$/ )) {             indent = 0;         } else if (node.match( /^&lt;\/\w/ )) {             if (pad != 0) {                 pad -= 1;             }         } else if (node.match( /^&lt;\w[^&gt;]*[^\/]&gt;.*$/ )) {             indent = 1;         } else {             indent = 0;         }          var padding = '';         for (var i = 0; i &lt; pad; i++) {             padding += '  ';         }          formatted += padding + node + '\r\n';         pad += indent;     });      return formatted; }   I then call the function like this:  jQuery('pre.formatted-xml').text(formatXml('&lt;root&gt;&lt;node1/&gt;&lt;/root&gt;'));   This works perfectly fine for me but while I was writing the previous function I thought that there must be a better way. So my question is do you know of any better way given an XML string to pretty-print it in an html page? Any javascript frameworks and/or plugins that could do the job are welcome. My only requirement is this to be done on the client side.
33533
I have this as xml:  &lt;root xmlns:event="http://www.webex.com/schemas/2002/06/service/event"&gt;     &lt;event:event&gt;         &lt;event:sessionKey&gt;&lt;/event:sessionKey&gt;         &lt;event:sessionName&gt;Learn QB in Minutes&lt;/event:sessionName&gt;         &lt;event:sessionType&gt;9&lt;/event:sessionType&gt;         &lt;event:hostWebExID&gt;&lt;/event:hostWebExID&gt;         &lt;event:startDate&gt;02/12/2009&lt;/event:startDate&gt;         &lt;event:endDate&gt;02/12/2009&lt;/event:endDate&gt;         &lt;event:timeZoneID&gt;11&lt;/event:timeZoneID&gt;         &lt;event:duration&gt;30&lt;/event:duration&gt;         &lt;event:description&gt;&lt;/event:description&gt;         &lt;event:status&gt;NOT_INPROGRESS&lt;/event:status&gt;         &lt;event:panelists&gt;&lt;/event:panelists&gt;         &lt;event:listStatus&gt;PUBLIC&lt;/event:listStatus&gt;     &lt;/event:event&gt;     ... &lt;/root&gt;   How can I loop through all of the event:event nodes and display, for example, all of the event:SessionKey's?   This does not work:  $xml = new SimpleXMLElement($r); $xml-&gt;registerXPathNamespace('e', 'http://www.webex.com/schemas/2002/06/service/event');  foreach($xml-&gt;xpath('//e:event') as $event) {  var_export($event-&gt;xpath('//e:sessionKey')); }
113985
I had created the xml document with xml version="1.0".  In that document I need to use the greater than symbol &gt; and less than symbol &lt;.  How should I include those symbols? It's not working.  &amp;gt; and &amp;lt; are not working for me.  Is there any special encoder for this?
106091
I have a batch script template that includes a choice in it, I want to have the question for what the end-user wants to do, and the choice description(s) below the question. Here is my template:  @ECHO OFF Color __ TITLE %TITLE% ECHO. :choice set /P c=Do you want to %CHOICE%? &amp; ECHO.(%DESCRIPTION%) if /I "%c%" EQU "Y" goto :choice_yes if /I "%c%" EQU "C" goto :choice_cancel goto :choice :choice_cancel echo %CHOICE% has been cancelled. :choice_yes :: Insert additional commands or code here. pause @ECHO OFF   As you can see in the script, I have already attempted &amp; ECHO.(%DESCRIPTION%) among other methods that insert a new line. I believe there needs to be an additional ECHO before the actual choice question with the above method, but due to the structure of the code I don't know where to place it. What am I doing wrong? Is there perhaps a character that needs to be escaped due to syntax?
51449
Is there an easy way to substitute/evaluate environment variables in a file? Like let's say I have a file config.xml that contains:  &lt;property&gt;     &lt;name&gt;instanceId&lt;/name&gt;     &lt;value&gt;$INSTANCE_ID&lt;/value&gt; &lt;/property&gt; &lt;property&gt;     &lt;name&gt;rootPath&lt;/name&gt;     &lt;value&gt;/services/$SERVICE_NAME&lt;/value&gt; &lt;/property&gt;   ...etc. I want to replace $INSTANCE_ID in the file with the value of the INSTANCE_ID environment variable, $SERVICE_NAME with the value of the SERVICE_NAME env var. I won't know a priori which environment vars are needed (or rather, I don't want to have to update the script if someone adds a new environment variable to the config file). Thanks!
29504
What is the best way to replace all '&amp;lt' with &amp;lt; in a given database column? Basically perform s/&amp;lt[^;]/&amp;lt;/gi  Notes:   must work in  2000 Must be repeatable (and not end up with &amp;lt;;;;;;;;;;)