PROCESSMAKER 画面作成
xmlFilePath = "sample.xml";
$xmlData = simplexml_load_file($xmlFilePath);
$array = json_decode(json_encode($xmlData), true);
var_dump($array);
PROCESSMAKER SOAP LOGIN
ROUTING ERROR CHECK
xmlparse
javascriptでログインしてXMLをパースする
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
xml = '<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.processmaker.com"><env:Body><ns1:loginResponse><ns1:status_code>0</ns1:status_code><ns1:message>557234039562f8d61c74302007690088</ns1:message><ns1:version>2.0</ns1:version><ns1:timestamp>2015-10-27 10:42:41</ns1:timestamp></ns1:loginResponse></env:Body></env:Envelope>';
var textAfter = xml.replace(/ns1:/g,"");
textAfter = textAfter.replace(/env:/g,"");
//$(xml).find('item').each(disp);
var parser, xmlDoc;
var text = "<bookstore><book>" +
"<title>Everyday Italian</title>" +
"<author>Giada De Laurentiis</author>" +
"<year>2005</year>" +
"</book></bookstore>";
parser = new DOMParser();
xmlDoc = parser.parseFromString(textAfter,"text/xml");
document.getElementById("demo").innerHTML =
xmlDoc.getElementsByTagName("timestamp")[0].childNodes[0].nodeValue;
</script>
</body>
</html>
(uniq関数は http://stackoverflow.com/q/7651/454997 より引用)
uniq.rb
p [1, 1, 2, 3, 3].uniq
...test:aaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
...
(uniqにブロックを与える書き方は http://ruby-doc.org/core-2.2.0/Array.html を参照)