Question : simplexml-load-string stopped working?

After making some changes to my WAMP server and then reverting them,
I found that errors were now returning from simplexml-load-string, used in the attached code:

"Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Specification mandate value for attribute preference in C:\wamp\www\insert.php on line 16"

How can I fix this?
1:
2:
3:
4:
5:
6:
7:
<? php

$xml = simplexml_load_string(stripslashes($_GET['xml']));
 if(!$xml)
 {  $message  = 'No input ' . "\n";
    die($message);
 }

Answer : simplexml-load-string stopped working?

Unfortunately there's no way to do the enhanced variable substitution (like replacing characters, or extracting characters, etc with either parm variables (%1, %2, %3, ...) or FOR loop variables (%%A, %%B, %%C, ...).  Sad but true.

If you want to keep the mainline code a little cleaner you could do this approach using a called subroutine.  It trims any left or right spaces from the passed string, and stores the result in the named variable.

for /f "tokens=1-5 delims=," %%A in ("%String%") do (
  echo BEFORE: %%A %%B %%C %%D %%E
  call :Trim "%%A" A
  call :Trim "%%B" B
  call :Trim "%%C" C
  call :Trim "%%D" D
  call :Trim "%%E" E
)
echo AFTER : %A% %B% %C% %D% %E%
pause
exit /b

:Trim "input-string" return-variable
  set s=%~1
  for /F "tokens=* delims= " %%A in ("%s%") do set s=%%A
  for /L %%A in (1,1,50) do if "!s:~-1!"==" " set s=!s:~0,-1!
  set %~2=%s%
  exit /b

~bp
Random Solutions  
 
programming4us programming4us