{"id":32854,"date":"2017-09-14T03:01:20","date_gmt":"2017-09-13T17:01:20","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=32854"},"modified":"2017-09-14T08:24:15","modified_gmt":"2017-09-13T22:24:15","slug":"xml-subtraction-and-addition-processing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-processing-tutorial\/","title":{"rendered":"XML Subtraction and Addition Processing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou_processing.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"XML Subtraction and Addition Processing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou_processing.jpg\" title=\"XML Subtraction and Addition Processing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">XML Subtraction and Addition Processing Tutorial<\/p><\/div>\n<p>Many projects that involve data will surprise you when you get to the phase of running your planned code over real data.  Real business data can throw up surprises like &#8230;<\/p>\n<ul>\n<li>the length of time to process the data or the amount of data to process<\/li>\n<li>the size of one element of that data is huge (causing the problem shown on today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou_processing.jpg\" title=\"Click picture\">tutorial picture<\/a>)<\/li>\n<\/ul>\n<p> &#8230; and, respectively, we find useful when PHP &#8220;surfing the net&#8221; mode of use is used, it can be useful to &#8230;<\/p>\n<ul>\n<li>set up the top of the PHP a code line like <i><a target=_blank title='PHP ini_set information' href='http:\/\/php.net\/manual\/en\/function.ini-set.php'>ini_set<\/a>(&#8216;max_execution_time&#8217;, 6000);<\/i> setting the maximum execution time greater than PHP&#8217;s default of 30 seconds<\/li>\n<li>found with a file of 7.7 mB that we needed to switch from a PHP &#8220;surfing the net&#8221; mode of use to an <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a>([PHP &#8220;command line&#8221; mode of use command]) scenario (that is a vastly less memory hungry mode of use) <i>just for that file<\/i><\/li>\n<\/ul>\n<p> &#8230; and for our PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php----GETME\" title=\"mil_mapping.php\">mil_mapping.php<\/a> &#8220;XML Adderer and Subtractor&#8221; web application (last talked about at <a title='XML Subtraction and Addition Accountability Tutorial' href='#xmlsaat'>XML Subtraction and Addition Accountability Tutorial<\/a>) run of 93 files, we found that we need change for the &#8220;processing&#8221; surprises above, in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php----GETME\" title=\"mil_mapping.php\">this way<\/a>.<\/p>\n<p>Another very important aspect to software processing (and deployment for that matter) is that you either &#8230;<\/p>\n<ul>\n<li>log the actions made in files (especially for batch processing) &#8230; and\/or &#8230;<\/li>\n<li>see for yourself in realtime that the software proceeded and completed correctly<\/li>\n<\/ul>\n<p>With our &#8220;XML Adderer and Subtractor&#8221; project we always envisaged a &#8220;surfing the net&#8221; processing run, as we like a &#8220;cockpit&#8221; style of working here, and fit in with the second scenario above.  Hence the &#8220;<i>just for that file<\/i>&#8221; modification design.  That large file broke the initial run in the middle of the list of files, but the logic changes above allowed for the whole run to proceed &#8220;surfing the net&#8221; with a switch over to &#8220;command line usage&#8221; behind the scenes for &#8220;files over 4000000 bytes&#8221; (was our business logic for this decision).<\/p>\n<p>Of course, if your project sponsor can supply you with the data size and numbers of components straight away as you unit test, that can be a good thing too.  Take the opportunity to really &#8220;load test&#8221; your software that way if you get the chance &#8230; the earlier the better.<\/p>\n<hr>\n<p id='xmlsaat'>Previous relevant <a target=_blank title='XML Subtraction and Addition Accountability Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-accountability-tutorial\/'>XML Subtraction and Addition Accountability Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou_two.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"XML Subtraction and Addition Accountability Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou_two.jpg\" title=\"XML Subtraction and Addition Accountability Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">XML Subtraction and Addition Accountability Tutorial<\/p><\/div>\n<p>We like to make our web applications &#8220;accountable&#8221; to those users using them.  Often &#8220;sharing&#8221; functionality features when improving the &#8220;accountability&#8221; of a web application, at least for us.<\/p>\n<p>We&#8217;re trying to improve on the &#8220;accountability&#8221; of yesterday&#8217;s <a title='XML Subtraction and Addition Modes of Use Tutorial' href='#xmlsamut'>XML Subtraction and Addition Modes of Use Tutorial<\/a> by &#8230;<\/p>\n<ul>\n<li>adding optional email reporting of the command line modes of use to improve the web application&#8217;s reporting capabilities<\/li>\n<li>leaving a script file on the web server, that at least for a short time, reflects that last command line execution<\/li>\n<li>adding back in the HTML div element change elements even when using command line functionalities (as buttons) off the &#8220;surfing the net&#8221; mode of use<\/li>\n<\/ul>\n<p>We hope you try to implement the PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php---GETME\" title=\"mil_mapping.php\">mil_mapping.php<\/a> changed for the &#8220;accountability&#8221; aims above, in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php---GETME\" title=\"mil_mapping.php\">this way<\/a>, to get this into context for some of your own XML data.<\/p>\n<hr>\n<p id='xmlsamut'>Previous relevant <a target=_blank title='XML Subtraction and Addition Modes of Use Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-modes-of-use-tutorial\/'>XML Subtraction and Addition Modes of Use Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"XML Subtraction and Addition Modes of Use Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou.jpg\" title=\"XML Subtraction and Addition Modes of Use Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">XML Subtraction and Addition Modes of Use Tutorial<\/p><\/div>\n<p>Today&#8217;s job is to extend the modes of functionality for the &#8220;XML Subtraction and Addition&#8221; PHP web application we&#8217;ve been developing off yesterday&#8217;s <a title='XML Subtraction and Addition Genericization Tutorial' href='#xmlsagt'>XML Subtraction and Addition Genericization Tutorial<\/a>.<\/p>\n<p>You may recall from a few tutorials at this blog that we are sometimes keen, when it seems apt, to develop PHP (only) web applications to use the three modes of use, identified at <a target=_blank title='PHP Find in Context Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-find-in-context-primer-tutorial\/'>PHP Find in Context Primer Tutorial<\/a>, as &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-find-in-context-primer-tutorial\/'>\n<ul>\n<li>&#8220;surfing the net&#8221; calling the PHP from a web browser&#8217;s address bar<\/li>\n<li>&#8220;<a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/CURL' title='Curl information from Wikipedia ... thanks'>curl<\/a>&#8221; call of the PHP<\/li>\n<li>&#8220;command line&#8221; execution of PHP<\/li>\n<\/ul>\n<\/blockquote>\n<p>You can see this in play with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mou.jpg\" title=\"Tutorial picture\">tutorial picture<\/a> when two additional HTML input type=button elements to have three buttons for each of the PHP &#8220;modes of use&#8221; above, those latter two linked into the &#8220;surfing the net&#8221; PHP web application mode of use via PHP&#8217;s <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> method, leaving us with PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php--GETME\" title=\"mil_mapping.php\">mil_mapping.php<\/a> changed for the aims above, with lots of delimitation (inhouse design and) issues, in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php--GETME\" title=\"mil_mapping.php\">this way<\/a>. <\/p>\n<p>It&#8217;s not just an intellectual exercise for us.  It&#8217;s a reminder what another dynamic duo are &#8230;<\/p>\n<ul>\n<li>PHP<\/li>\n<li><a target=_blank title='MAMP local Apache\/PHP\/MySql web server' href='http:\/\/mamp.info'>MAMP<\/a> local Apache\/PHP\/MySql web server<\/li>\n<\/ul>\n<p> &#8230; and how PHP&#8217;s <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> method can help link modern &#8220;online&#8221; &#8220;surfing the net&#8221; methodologies with the history of those operating systems which both &#8230;<\/p>\n<ul>\n<li>preceeded in history those web browsers &#8230; and which, it should be noted &#8230;<\/li>\n<li>still underpins these &#8220;online&#8221; &#8220;surfing the net&#8221; methodologies in the web application &#8220;client&#8221; sense, and the web application&#8221; &#8220;server&#8221; sense &#8230; PHP brings this together as well<\/li>\n<\/ul>\n<p>We recognize four other sets of dynamic duos involving PHP &#8230; think &#8230;<\/p>\n<ul>\n<li>PHP<\/li>\n<li>MySql database &#8230; we think <a target=_blank title='Fred and Ginger' href='https:\/\/www.youtube.com\/watch?v=YFI0rFFp8j8'>Fred and Ginger<\/a><\/li>\n<\/ul>\n<p> &#8230; and &#8230;<\/p>\n<ul>\n<li>PHP<\/li>\n<li>HTML so that the &#8220;server&#8221; can directly amend (or even create from scratch &#8230; as for our web application in this blog posting &#8220;thread&#8221;) the &#8220;client&#8221; webpage contents (on its way through)<\/li>\n<\/ul>\n<p> &#8230; and &#8230;<\/p>\n<ul>\n<li>PHP<\/li>\n<li>Javascript so that the &#8220;server&#8221; can directly amend the &#8220;client&#8221; dynamics and interaction (on its way through)<\/li>\n<\/ul>\n<p> &#8230; and &#8230;<\/p>\n<ul>\n<li>PHP<\/li>\n<li>Apache web servers as a great web server environment team<\/li>\n<\/ul>\n<hr>\n<p id='xmlsagt'>Previous relevant <a target=_blank title='XML Subtraction and Addition Genericization Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-genericization-tutorial\/'>XML Subtraction and Addition Genericization Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mil.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"XML Subtraction and Addition Genericization Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mapping_mil.jpg\" title=\"XML Subtraction and Addition Genericization Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">XML Subtraction and Addition Genericization Tutorial<\/p><\/div>\n<p>If you are a programmer not interested in &#8220;genericization&#8221;, and that&#8217;s because you can think on your feet without the &#8220;label&#8221; &#8230; &#8220;I tips my hats to ya&#8221; &#8230; well done.  Think, though, that most of us, myself included, don&#8217;t always think that purely, alas.  Sometimes, quality levels here can depend on how your day is going.<\/p>\n<p>Today&#8217;s &#8220;genericization&#8221; work, following up on yesterday&#8217;s <a title='XML Subtraction and Addition Primer Tutorial' href='#xmlsapt'>XML Subtraction and Addition Primer Tutorial<\/a> had the simplest of underlying aims &#8230; doh! &#8230; eliminate in that code snippet of yesterday, have no hardcodings, perhaps with the exception of &#8220;&lt;&#8221; and\/or &#8220;&gt;&#8221; &#8230; the kiss approach.  There are two things we are doing today &#8230;<\/p>\n<ul>\n<li>genericizing, via an HTML form (via GET arguments web surfing, only, for now), but in so doing we left behind the command line mode usage, which we might talk about later &#8230; and &#8230;<\/li>\n<li>presenting these XML &#8220;additions&#8221; and &#8220;subtractions&#8221; usefully, &#8220;in application&#8221;<\/li>\n<\/ul>\n<p>Both above were challenging, and with the second we were glad we could call on &#8230;<\/p>\n<ul>\n<li><a target=_blank title='HTML Textarea and Div Talents Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-textarea-and-div-talents-primer-tutorial\/'>HTML Textarea and Div Talents Primer Tutorial<\/a> proved, at least to us, that HTML <a target=_blank title='HTML div tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> elements had to be involved in some way shape or form &#8230; along with the web application user experience (<a target=_blank title='UX information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/User_experience'>UX<\/a>) thoughts of &#8230;<\/li>\n<li><a target=_blank title='HTML5 Details Summary Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-details-summary-primer-tutorial\/'>HTML5 Details Summary Primer Tutorial<\/a> taught us, recently, about a great new HTML5 <a target=_blank title='blank title='Reveal tutorials here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal'>reveal<\/a> CSS styling idea<\/li>\n<\/ul>\n<p> &#8230; to crystallize ideas, and to end up with PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php-GETME\" title=\"mil_mapping.php\">mil_mapping.php<\/a> changed for the aims above in PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php-GETME\" title=\"mil_mapping.php\">this way<\/a>.  You can set up your own work with it via a download, then via (perhaps via the <a target=_blank title='MAMP local Apache\/PHP\/MySql web server' href='http:\/\/mamp.info'>MAMP<\/a> Apache\/PHP\/MySql) local web server mode usage.<\/p>\n<hr>\n<p id='xmlsapt'>Previous relevant <a target=_blank title='XML Subtraction and Addition Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-primer-tutorial\/'>XML Subtraction and Addition Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"XML Subtraction and Addition Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.jpg\" title=\"XML Subtraction and Addition Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">XML Subtraction and Addition Primer Tutorial<\/p><\/div>\n<p><a target=_blank title='XML information from w3schools' href='http:\/\/www.w3schools.com\/xml\/default.asp'>XML<\/a> being the intelligent data protocol it is, our last XML &#8220;command line or local web server (ours being the <a target=_blank title='MAMP local Apache\/PHP\/MySql web server' href='http:\/\/mamp.info'>MAMP<\/a> Apache\/PHP\/MySql web server we run our code through) web browsing&#8221; mode application we wrote when we presented <a title='Spreadsheet and XML Global Substitution Genericization Tutorial' href='#sxmlgsgt'>Spreadsheet and XML Global Substitution Genericization Tutorial<\/a>, you&#8217;d think with the &#8220;genericization&#8221; efforts we went to during that job that we&#8217;d use it for everything.  Information Technology &#8220;life&#8221; doesn&#8217;t work that way though, and the overarching data change aims we&#8217;d list as &#8230;<\/p>\n<ul>\n<li>XML global substitution<\/li>\n<li><b>XML data driven substraction of data<\/b><\/li>\n<li><b>XML data driven addition of data<\/b><\/li>\n<\/ul>\n<p> &#8230; with the previous blog posting above tailored for genericization of the first of above, but a stretch too far to imagine the usage for a scenario involving those other two &#8220;subtraction&#8221; and &#8220;addition&#8221; aims listed above.  It gets ridiculous to not do a bit of division of application aims when thinking about these things, otherwise the complexity of your application may lead to a one-off usage, not the happiest of scenarios.<\/p>\n<p>In our first draft today we show the bits before our genericization &#8220;push&#8221; with our job, and here is where, a code comment can play a big part, and be of use, a code feature, we normally don&#8217;t give a huge amount of credence to, instead figuring the use of web inspectors these days are a good analyzing tool rather than relying on code source comments.<\/p>\n<p>So if we show you the code below, developed with the user and public tester regarding requirements, via email &#8230;<\/p>\n<p><code><br \/>\n \/\/ &lt;\/title&gt;&lt;section role=\"annot_cont\u201d<br \/>\n $startfind='role=\"annot_cont\"';<br \/>\n<br \/>\n foreach (<a target=_blank title='PHP glob() method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'>glob<\/a>($filespec) as $filename) {<br \/>\n   $precont=@<a target=_blank title='PHP file_get_contents() method information' href='http:\/\/php.net\/manual\/en\/function.file-get-contents.php'>file_get_contents<\/a>($filename);<br \/>\n   $cont=$precont;<br \/>\n   $sections=explode($startfind, $cont);<br \/>\n   for ($i=1; $i&lt;sizeof($sections); $i++) {<br \/>\n     \/\/ check that \"&lt;section \" preceded<br \/>\n     if (explode(\" \",explode(\"&lt;\", $sections[-1 + $i])[-1 + sizeof(explode(\"&lt;\", $sections[-1 + $i]))])[0] == \"section\") {<br \/>\n       \/\/ before that last end tag should be &lt;\/title&gt;<br \/>\n       if (explode(\"&gt;\",explode(\"&lt;\", str_replace(\"&lt;?\",\"  \",str_replace(\"&lt;section \",\"        \",$sections[-1 + $i])))[-1 + sizeof(explode(\"&lt;\", str_replace(\"&lt;?\",\"  \",str_replace(\"&lt;section \",\"        \",$sections[-1 + $i]))))])[0] == \"\/title\") {<br \/>\n          \/\/ after that will be \"&lt;leg-history \"<br \/>\n          if (strpos($sections[$i], \"&lt;leg-history \") !== false) {<br \/>\n            \/\/ and in between will be no already done &lt;title&gt;&lt;\/title&gt; or other type of tag actually<br \/>\n            if (strpos(\"&lt;title\", explode(\"&lt;leg-history \", $section[$i])[0]) === false && strpos(\"&lt;\", explode(\"&lt;leg-history \", $section[$i])[0]) === false && strpos(\"&lt;\/title&gt;\", explode(\"&lt;leg-history \", $section[$i])[0]) === false) {<br \/>\n              $bits=explode(\"&lt;leg-history \", $sections[$i]);<br \/>\n              if (strpos(explode(\"&gt;\", $sections[$i])[0], ' href=\"') !== false) {<br \/>\n                $hrefv=explode('\"',explode('href=\"', explode(\"&gt;\", $sections[$i])[0])[1])[0];<br \/>\n                $newsectionone=str_replace($bits[0], str_replace(' href=\"' . $hrefv . '\"', '', $bits[0] . '&lt;title arch=\"online\"&gt;Note&lt;\/title&gt;'), $sections[$i]);<br \/>\n                $cont=str_replace($startfind . $sections[$i], $startfind . $newsectionone, $cont);<br \/>\n                $sections=explode($startfind, $cont);<br \/>\n             } else {<br \/>\n                $newsectionone=str_replace_first($bits[0], $bits[0] . '&lt;title arch=\"online\"&gt;Note&lt;\/title&gt;', $sections[$i]);<br \/>\n                $cont=str_replace($startfind . $sections[$i], $startfind . $newsectionone, $cont);<br \/>\n                $sections=explode($startfind, $cont);<br \/>\n              }<br \/>\n            }<br \/>\n          } else if (strpos($sections[$i], \"&lt;notes \") !== false) {<br \/>\n            \/\/ and in between will be no already done &lt;title&gt;&lt;\/title&gt; or other type of tag actually<br \/>\n            if (strpos(\"&lt;title\", explode(\"&lt;notes \", $section[$i])[0]) === false && strpos(\"&lt;\", explode(\"&lt;notes \", $section[$i])[0]) === false && strpos(\"&lt;\/title&gt;\", explode(\"&lt;notes \", $section[$i])[0]) === false) {<br \/>\n              $bits=explode(\"&lt;notes \", $sections[$i]);<br \/>\n              if (strpos(explode(\"&gt;\", $sections[$i])[0], ' href=\"') !== false) {<br \/>\n                $hrefv=explode('\"',explode('href=\"', explode(\"&gt;\", $sections[$i])[0])[1])[0];<br \/>\n                $newsectionone=str_replace($bits[0], str_replace(' href=\"' . $hrefv . '\"', '', $bits[0] . '&lt;title arch=\"online\"&gt;Note&lt;\/title&gt;'), $sections[$i]);<br \/>\n                $cont=str_replace($startfind . $sections[$i], $startfind . $newsectionone, $cont);<br \/>\n                $sections=explode($startfind, $cont);<br \/>\n              } else {<br \/>\n                $newsectionone=str_replace_first($bits[0], $bits[0] . '&lt;title arch=\"online\"&gt;Note&lt;\/title&gt;', $sections[$i]);<br \/>\n                $cont=str_replace($startfind . $sections[$i], $startfind . $newsectionone, $cont);<br \/>\n                $sections=explode($startfind, $cont);<br \/>\n              }<br \/>\n            }<br \/>\n          }<br \/>\n       }<br \/>\n     }<br \/>\n   }<br \/>\n<br \/>\n   if ($cont != $precont) {<br \/>\n    if (!file_exists($filename . \"_original_backup\")) copy($filename, $filename . \"_original_backup\");<br \/>\n    file_put_contents($filename, $cont);<br \/>\n   }<br \/>\n<\/code><\/p>\n<p> &#8230; we came up with a first draft PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/mil_mapping.php_GETME\" title=\"mil_mapping.php\">mil_mapping.php<\/a> that &#8220;does the job&#8221;, the first thing to hone in on with any job &#8230; doh!  Follow up tutorials make things clearer in a couple of ways to this initial draft, but please, rather than concentrating on bells and whistles, do not take your eye off the &#8220;application doing what the user wanted it to do&#8221; primary edict that should apply with any user based Information Technology work.<\/p>\n<hr>\n<p id='sxmlgsgt'>Previous relevant <a target=_blank title='Spreadsheet and XML Global Substitution Genericization Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/spreadsheet-and-xml-global-substitution-genericization-tutorial\/'>Spreadsheet and XML Global Substitution Genericization Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping_more.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Spreadsheet and XML Global Substitution Genericization Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping_more.jpg\" title=\"Spreadsheet and XML Global Substitution Genericization Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Spreadsheet and XML Global Substitution Genericization Tutorial<\/p><\/div>\n<p>It&#8217;s one thing to write a useful one off web application with quite a few hard codings, but what about an attempt to genericize it, and by so doing, oftentimes you are improving its documentation aspects, so that, if the code is revisited years later &#8230;<\/p>\n<ul>\n<li>its generic qualities will be plain to all &#8230; and at the same time &#8230;<\/li>\n<li>it will be far easier to imagine as far as inputs are concerned &#8230;<\/li>\n<li>the user can (still) break the job up<\/li>\n<li>the user has less to worry about as far as a backup of data goes<\/li>\n<li>it does not feel like a one off any more<\/li>\n<li>it is less likely to be ill used for an inapplicable application<\/li>\n<\/ul>\n<p> &#8230; so that, all in all, we feel much more confident such code can last the test of time and usefulness into the future than yesterday&#8217;s (albeit useful) one off feeling version of the code you can see at <a title='Spreadsheet and XML Global Substitution CSV Tutorial' href='#saxgsct'>Spreadsheet and XML Global Substitution CSV Tutorial<\/a> as shown below.<\/p>\n<p>What&#8217;s the main driver of genericization, in our book (<font size=1>but not our pamphlettes<\/font>) for small jobs?<\/p>\n<ol>\n<li>turn all hardcodings you can into parameterizable variables, and today that is via PHP $_GET[] variables off the web browser address bar<\/li>\n<li>allow the user to change these, as the hardcodings just become defaults, and are presented in a submittable HTML form whose action is to recall the same piece of PHP software (code)<\/li>\n<\/ol>\n<p> &#8230; simple, huh?!<\/p>\n<p>Again, you can see the various aspects of this, in play, with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping_more.jpg\" title=\"Tutorial picture\">tutorial picture<\/a>, and though it is not much use to run the PHP code live, its style is far more generic now, so we want to share <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.php-GETME\" title=\"tr_mapping.php\">tr_mapping.php<\/a> (changed <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.php-GETME\" title=\"tr_mapping.php\">this way<\/a>) with you for your perusal &#8230; just in case (it is of use for you).<\/p>\n<hr>\n<p id='saxgsct'>Previous relevant <a target=_blank title='Spreadsheet and XML Global Substitution CSV Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/spreadsheet-and-xml-global-substitution-csv-tutorial\/'>Spreadsheet and XML Global Substitution CSV Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Spreadsheet and XML Global Substitution CSV Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.jpg\" title=\"Spreadsheet and XML Global Substitution CSV Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Spreadsheet and XML Global Substitution CSV Tutorial<\/p><\/div>\n<p>Programmatically, we came in half way with the programming when we presented <a title='Spreadsheet and XML Global Substitution Primer Tutorial' href='#saxgspt'>Spreadsheet and XML Global Substitution Primer Tutorial<\/a> as shown below.  The programming, then, had two inputs, namely &#8230;<\/p>\n<ol>\n<li>input spreadsheet&#8217;s CSV file <i>manually created<\/i><\/li>\n<li>index XML file<\/li>\n<\/ol>\n<p> &#8230; but that CSV file can be <i>programmatically created<\/i> rather than <i>manually created<\/i>.  And while we&#8217;re at <i>programmatically creating<\/i> the CSV we could also <i>programmatically create<\/i> the Korn Shell (ksh) easier there too, with the same program, rather than using TextWrangler&#8217;s Grep (RegEx) talents &#8230; not that we&#8217;re ungrateful or anything &#8230; but it is good to mix things up to improve procedures sometimes.<\/p>\n<p>And what programming language can we use, and what environment for that programming code?  We think &#8230;<\/p>\n<ul>\n<li>coding wise, we&#8217;ll use PHP (starring PHP&#8217;s <a target=_blank title='PHP glob() method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'>glob()<\/a> method) &#8230; and the environment for that will be that &#8230;<\/li>\n<li>we&#8217;ll use a (local Apache\/PHP\/MySql web server) <a target=_blank title='MAMP local web server' href='http:\/\/mamp.info'>MAMP<\/a> subfolder (ie. how desktop application &#8220;can meet&#8221; web application) off its Document Root (\/Applications\/MAMP\/htdocs\/) &#8230; \/Applications\/MAMP\/htdocs\/tr_mapping\/ &#8230; to store the XML data files (no CSV needed as input this way, as it will be <i>programmatically created<\/i> in part 1 of 2 parts to the whole job) &#8230; which becomes accessible in two ways &#8230;\n<ol>\n<li><i>http:\/\/localhost:8888\/tr_mapping\/tr_mapping.php<\/i>#in_a_web_browser<\/li>\n<li>at Mac OS X Terminal desktop application command line via &#8230; <br \/><i>cd \/Applications\/MAMP\/htdocs\/tr_mapping<\/i><br \/><i>ksh -x tr_mapping.ksh<\/i><\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>Again, email is the conduit for both sides of &#8230;<\/p>\n<ol>\n<li>input in<\/li>\n<li>output out<\/li>\n<\/ol>\n<p> &#8230; to complete proceedings.  You can see the various aspects of this, in play, with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.jpg\" title=\"Tutorial picture\">tutorial picture<\/a>, and though it is not much use to run the PHP code live, its style is leaning towards the generic side enough for us to want to share <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/tr_mapping.php_GETME\" title=\"tr_mapping.php\">tr_mapping.php<\/a> with you for your perusal &#8230; just in case (it is of use for you).<\/p>\n<hr>\n<p id='saxgspt'>Previous relevant <a target=_blank title='Spreadsheet and XML Global Substitution Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/spreadsheet-and-xml-global-substitution-primer-tutorial\/'>Spreadsheet and XML Global Substitution Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/XML\/spreadsheet_xml_job.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Spreadsheet and XML Global Substitution Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/XML\/spreadsheet_xml_job-224of.jpg\" title=\"Spreadsheet and XML Global Substitution Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Spreadsheet and XML Global Substitution Primer Tutorial<\/p><\/div>\n<p>Yesterday when we were discussing <a target=_blank title='Worldbank API World Country Reporting Regex Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/worldbank-api-world-country-reporting-regex-tutorial\/'>Worldbank API World Country Reporting Regex Tutorial<\/a> we mentioned &#8230;<\/p>\n<blockquote>\n<p> &#8230; and we use <strike>it<\/strike> (ie. Regex) with serverside PHP today, under the auspices of the <a target=_blank title='PHP regex' href='http:\/\/php.net\/manual\/en\/function.preg-match.php'>preg_match<\/a> function, though we most often use RegEx thinking with the Javascript <a target=_blank title='Javascript string replace function information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_replace.asp'><i>replace<\/i><\/a> function, as the way to make substitutions for more than one occurrence, (the one occurrence design being) a default &#8220;curiosity&#8221; (but can be useful too) about Javascript&#8217;s version of substitution.  You may know this RegEx usage of the Javascript replace function as &#8220;global substitution&#8221;.<\/p>\n<\/blockquote>\n<p> &#8230; and that term &#8220;global substitution&#8221;.  Many editing jobs, especially text file based ones, require or benefit from &#8220;global substitution&#8221; carefully applied, that is.  It is common to see an editor who shies away from &#8220;global substitution&#8221; methods, and in many cases that is wise, but &#8220;global substitution&#8221; gets good results when you &#8230;<\/p>\n<ul>\n<li>substitute things you know exist in the precise form you intend to search for, and only there, where you want to replace &#8230; to <\/li>\n<li>replacements should not feed back into the substitution list &#8230; doh &#8230; or you will end up with a confused unintended result<\/li>\n<\/ul>\n<p>In real life, it is often the case that the conditions above are easy to obey, because you are mapping an old numbering and\/or naming system to a completely new and dissimilar numbering and\/or naming system.  That&#8217;s the case in a little job we drilled down into, to show you what we did, that involved RegEx thoughts, to solve a problem.<\/p>\n<p>So, with our job we had &#8230;<\/p>\n<ul>\n<li>Aim: Change some XML in one file to have the text in one column of a Spreadsheet be mapped to the contents of another column of that same Spreadsheet<\/li>\n<li>Inputs: Excel Spreadsheet with those two columns as mentioned above and the one input XML file<\/li>\n<li>From the User: Asked for the user to send the Excel Spreadsheet &#8230; Saved As Comma Separated Values (CSV) in MS-DOS format and the one input XML file as two attached files in an Email<\/li>\n<li>Processing:\n<ol>\n<li>Opened Email with <a target=_blank title='Gmail' href='http:\/\/gmail.com'>Gmail<\/a> web application in Safari web browser desktop application, on a MacBook Pro laptop<\/li>\n<li>Downloaded the two Attachments and copied over to where we like to work &#8230; the home of <a target=_blank title='MAMP' href='http:\/\/mamp.info'>MAMP<\/a> local Apache\/PHP\/MySql web server &#8230; on a Mac OS X system is <i>\/Applications\/MAMP\/htdocs<\/i> (which we&#8217;ll access later with the Mac OS X <i>Terminal<\/i> desktop application later via &#8220;cd \/Applications\/MAMP\/htdocs&#8221;)<\/li>\n<li>Opened our favourite Text Editor desktop application, called <a target=_blank href='http:\/\/www.macupdate.com\/app\/mac\/11009\/textwrangler' title='Mac TextWrangler text editor'><i>TextWrangler<\/i><\/a>, whose &#8220;Find and Replace&#8221; &#8220;Grep&#8221; suboption will be a feature of today&#8217;s solution<\/li>\n<li>File -&gt; Open the Spreadsheet CSV file<\/li>\n<li>Search -&gt; Find&#8230; &#8230; Matching Mode: <a target=_blank title='Linux grep command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ugrep.htm'>Grep<\/a> &#8230; Find: ^ Replace: #  &#8230; Replace All &#8230; remember our &#8220;RegEx&#8221; &#8220;cheat sheet&#8221; discussion (lots of which is relevant to TextWrangler <i>Matching Mode: Grep<\/i> as well) at that aforesaid mentioned tutorial &#8230;<br \/>\n<blockquote>\n<ul>\n<li>^ can mean &#8220;start of&#8221;<\/li>\n<li>$ can mean &#8220;end of&#8221;<\/li>\n<li>. can sometimes mean &#8220;one existant character wildcard&#8221; &#8230; or sometimes it is % or ? for this in other &#8220;systems&#8221;<\/li>\n<li>* can often mean &#8220;zero or more of preceding character wildcard&#8221;<\/li>\n<li>[] and () bracketing rules are pretty crucial for the more esoteric usages &#8230; also study | usage<\/li>\n<\/ul>\n<\/blockquote>\n<p>? &#8230; well, we want to start out mapping all lines to non-acting <a target=_blank title='korn' href='http:\/\/www.computerhope.com\/unix\/uksh.htm'>Korn Shell<\/a> command lines<\/li>\n<li>Typed as the new top line <i>#!\/bin\/ksh<\/i> &#8230; just for completeness sake &#8230; is optional step<\/li>\n<li>Search -&gt; Find&#8230; &#8230; No Matching Mode &#8230; Find: #,[ Replace: <a target=_blank title='Linux cat command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ucat.htm'>cat<\/a> COMM.MIL~INDEX.xml | <a target=_blank title='Linux sed command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/used.htm'>sed<\/a> &#8216;\/\\[    &#8230; Replace All<\/li>\n<li>Search -&gt; Find&#8230; &#8230; Matching Mode: Grep &#8230; Find: ]$ Replace: \\\\]\/g&#8217; > x.xxx ; cat x.xxx > COMM.MIL~INDEX.xml ; <a target=_blank title='Linux rm command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/urm.htm'>rm<\/a> -f x.xxx    &#8230; Replace All<\/li>\n<li>File -&gt; Save As&#8230; fix_csv.ksh (to \/Applications\/MAMP\/htdocs directory)<\/li>\n<\/ol>\n<li>Opened Terminal desktop application that has a default <a target=_blank title='bash' href='http:\/\/www.computerhope.com\/unix\/ubash.htm'>Bash<\/a> environment (a lot like Linux, but is (giving you access to) a Mac OS X BSD operating system, really)<\/li>\n<li>Typed in: <i>cd \/Applications\/MAMP\/htdocs<\/i>  # to get to data<\/li>\n<li>Typed in: <i>cp COMM.MIL~INDEX.xml COMM.MIL~INDEX_original.xml<\/i>  # to backup data ahead of processing, as well as to compare file sizes with later, as a sanity check<\/li>\n<li>Typed in: <i>ksh -x fix_csv.ksh<\/i>  # access Korn Shell interpreter and run the TextWrangler created Korn Shell Script (and the -x <i>switch<\/i> tells the interpreter to be verbose with output reporting)<\/li>\n<li>Typed in: <i>ls -l COMM.MIL~INDEX*.xml<\/i>  # first sanity check verified files different, and not disastrously so &#8230; good first sign<\/li>\n<li>Typed in: <i>fgrep -c &#8216;[S1.12.4.20]&#8217; COMM.MIL~INDEX*.xml ; fgrep -c &#8216;[CCR.28E.20]&#8217; COMM.MIL~INDEX*.xml<\/i>  # second sanity check to prove old\/new parts of first\/last relevant Spreadsheet CSV file records were correctly mapped &#8230; and they were &#8230; so<\/li>\n<li>Opened Email with <a target=_blank title='Gmail' href='http:\/\/gmail.com'>Gmail<\/a> web application in Safari web browser desktop application (and used &#8220;Forward&#8221; option, attaching that new XML file), on a MacBook Pro laptop &#8230; so that &#8230;<\/li>\n<\/ol>\n<li>Output: One XML file with the global substitutions expressed in the Excel Spreadsheet performed, returned to User via Email &#8220;Forward&#8221; option, attaching that new XML file<\/li>\n<\/ul>\n<p>We hope you can see the good use you can make with Email and a good Text Editor and Linux type shell scripting, influenced by <a target=_blank title='Linux RegEx' href='https:\/\/www.digitalocean.com\/community\/tutorials\/using-grep-regular-expressions-to-search-for-text-patterns-in-linux'>RegEx<\/a> pattern matching regarding &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Linux grep command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/ugrep.htm'>grep<\/a><\/li>\n<li><a target=_blank title='Linux sed command information from computerhope' href='http:\/\/www.computerhope.com\/unix\/used.htm'>sed<\/a><\/li>\n<\/ul>\n<p>Which leaves us with today&#8217;s PDF slideshow of snapshots of making this job work, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/XML\/spreadsheet_xml_job.pdf\">here<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d28426' onclick='var dv=document.getElementById(\"d28426\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/regex\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28426' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d28733' onclick='var dv=document.getElementById(\"d28733\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/csv\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28733' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d28771' onclick='var dv=document.getElementById(\"d28771\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/form\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28771' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d32519' onclick='var dv=document.getElementById(\"d32519\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/xml\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d32519' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d32561' onclick='var dv=document.getElementById(\"d32561\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/genericization\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d32561' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d32587' onclick='var dv=document.getElementById(\"d32587\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/tutorial\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d32587' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d32598' onclick='var dv=document.getElementById(\"d32598\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d32598' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d32854' onclick='var dv=document.getElementById(\"d32854\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/memory\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d32854' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Many projects that involve data will surprise you when you get to the phase of running your planned code over real data. Real business data can throw up surprises like &#8230; the length of time to process the data or &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/xml-subtraction-and-addition-processing-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2098,103,174,234,284,2276,380,2325,2321,429,452,1839,1533,1615,714,744,767,932,997,1063,1122,1137,1319,1480],"class_list":["post-32854","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-accountability","tag-array","tag-button","tag-command-line","tag-curl","tag-delimitation","tag-email","tag-execution","tag-explode","tag-file_get_contents","tag-form","tag-genericization","tag-get","tag-glob","tag-local-web-server","tag-mamp","tag-memory","tag-php","tag-programming","tag-reveal","tag-server","tag-sharing","tag-tutorial","tag-xml"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/32854"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=32854"}],"version-history":[{"count":9,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/32854\/revisions"}],"predecessor-version":[{"id":32867,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/32854\/revisions\/32867"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=32854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=32854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=32854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}