-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_issues.html
More file actions
49 lines (44 loc) · 1.47 KB
/
check_issues.html
File metadata and controls
49 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="xml2json.js"></script>
</head>
<body>
<h1>Check issues html</h1>
<script type="text/javascript">
var x2js = new X2JS({
arrayAccessFormPaths : [
/.*\.test3\.item/,
"MyOperation.test4.item",
function(obj, childName, path) {
return false;
}
],
datetimeAccessFormPaths : [
"MyOperation.testdt"
],
stripWhitespaces : true,
enableToStringFunc : true
});
var xmlText =
"<!-- Test comment -->"+
"<MyOperation myAttr='SuccessAttrValue'>"+
"<txtAttrChild sAttr='SUCCESS TXT ATTR CHILD'>SUCCESS TXT<!-- comment --></txtAttrChild><test>Success</test>"+
"<test2 myAttr='SuccessAttrValueTest2&'><item>first</item><item>second</item></test2>"+
"<test3><item>first </item></test3>"+
"<test4><item>first</item></test4>"+
"<test5><item>first</item></test5>"+
"<testdt>2002-10-10T12:00:00-05:00</testdt>"+
"<!-- comment2 -->"+
"</MyOperation>";
var jsonObj = x2js.xml_str2json( xmlText );
console.log(jsonObj.MyOperation._myAttr);
console.log(jsonObj.MyOperation.test2._myAttr);
console.log(jsonObj.MyOperation.txtAttrChild._sAttr);
console.log(jsonObj.MyOperation.txtAttrChild.__text);
console.log(jsonObj.MyOperation.txtAttrChild.toString());
console.log(jsonObj.MyOperation.testdt);
console.log( x2js.json2xml_str( jsonObj ) );
console.log( "Ok!" );
</script>
</body>