[xmljs-users] Parser error: expected document node...
Brought to you by:
djoham,
witchhunter
From: Tornick, E. x. -N. <Edw...@es...> - 2006-08-24 13:05:52
|
I am using the domparser.js and I get this error... Error expected document node found text. It is from this code in the xmldom.js.... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D function _XMLDoc_handleNode(current)=20 { /* function: _XMLDoc_handleNode Author: mi...@id... Description: adds a markup element to the document */ if ((current.nodeType=3D=3D'COMMENT') && (this.topNode!=3Dnull)) { return this.topNode.addElement(current); } else if ((current.nodeType=3D=3D'TEXT') || = (current.nodeType=3D=3D'CDATA')) { // if the current node is a text node: // if the stack is empty, and this text node isn't just whitespace, we have // a problem (we're not in a document element) if(this.topNode=3D=3Dnull) { if (trim(current.content,true,false)=3D=3D"") { return true; } else { return this.error("expected document node, found: " + current); } } else { // otherwise, append this as child to the element at the top of the stack return this.topNode.addElement(current); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The values are being parsed correctly but the error is showing up: My server side code that generates the xml looks like this.... response.setContentType("text/xml"); PrintWriter out =3D response.getWriter(); out.println("<?xml version=3D\"1.0\"?>"); out.println("<vendor>"); out.println("<name>"); out.println("harry");=20 out.println("</name>");=09 out.println("<address>"); out.println("100 Cherry Tree Lane"); out.println("</address>");=09 out.println("</vendor>"); Is anything obviously wrong with this???? Thanks, Ed |