4 property bool xmlTest: false
5 property bool dataOK: false
7 function checkCData(text, whitespacetext)
9 // This is essentially a copy of text.qml/checkText()
14 if (text.nodeName != "#cdata-section")
17 if (text.nodeValue != "Hello world!")
20 if (text.nodeType != 4)
23 if (text.parentNode.nodeName != "item")
26 if (text.childNodes.length != 0)
29 if (text.firstChild != null)
32 if (text.lastChild != null)
35 if (text.previousSibling != null)
38 if (text.nextSibling != null)
41 if (text.attributes != null)
44 if (text.wholeText != "Hello world!")
47 if (text.data != "Hello world!")
50 if (text.length != 12)
53 if (text.isElementContentWhitespace != false)
56 if (whitespacetext.nodeName != "#cdata-section")
59 if (whitespacetext.nodeValue != " ")
62 if (whitespacetext.nodeType != 4)
65 if (whitespacetext.parentNode.nodeName != "item")
68 if (whitespacetext.childNodes.length != 0)
71 if (whitespacetext.firstChild != null)
74 if (whitespacetext.lastChild != null)
77 if (whitespacetext.previousSibling != null)
80 if (whitespacetext.nextSibling != null)
83 if (whitespacetext.attributes != null)
86 if (whitespacetext.wholeText != " ")
89 if (whitespacetext.data != " ")
92 if (whitespacetext.length != 3)
95 if (whitespacetext.isElementContentWhitespace != true)
102 function checkXML(document)
104 checkCData(document.documentElement.childNodes[0].childNodes[0],
105 document.documentElement.childNodes[1].childNodes[0]);
109 Component.onCompleted: {
110 var x = new XMLHttpRequest;
112 x.open("GET", "cdata.xml");
115 x.onreadystatechange = function() {
116 if (x.readyState == XMLHttpRequest.DONE) {
120 if (x.responseXML != null)
121 checkXML(x.responseXML);