diff options
Diffstat (limited to 'sca-cpp/trunk/modules/js/htdocs/xmlutil.js')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/xmlutil.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/xmlutil.js b/sca-cpp/trunk/modules/js/htdocs/xmlutil.js index 121bf8692c..1bec45f9b9 100644 --- a/sca-cpp/trunk/modules/js/htdocs/xmlutil.js +++ b/sca-cpp/trunk/modules/js/htdocs/xmlutil.js @@ -84,6 +84,15 @@ function readElements(l) { } /** + * Return true if a list of strings contains an XML document. + */ +function isXML(l) { + if (isNil(l)) + return false; + return car(l).substring(0, 5) == '<?xml'; +} + +/** * Parse a list of strings representing an XML document. */ function parseXML(l) { @@ -107,7 +116,7 @@ function parseXML(l) { * Read a list of values from an XML document. */ function readXMLDocument(doc) { - var root = nodeList(doc.childNodes); + var root = childElements(doc); if (isNil(root)) return mklist(); return mklist(readElement(car(root))); |