Re: [xmljs-users] Parser error: expected document node...
Brought to you by:
djoham,
witchhunter
From: David J. <dj...@ya...> - 2006-08-24 13:16:33
|
Nothings obviously wrong, but I have a suspicion about your response.setContentType("text/xml"); line. How are you getting the data into xmljs? Is it going to a frame something else? Normally, you just write the XML directly into the web page (escaping characters as necessary) in a textarea or something else. I'm curious if what you're doing might be causing the problem somehow. What happens if you use the w3c parser? Does the same error occur? Can you send the list a minimal sample HTML page that causes this error? If we have that, we can probably dive into it and figure out what's going wrong... David --- "Tornick, Edward x. -ND" <Edw...@es...> wrote: > 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.... > ====================================================================== > > > function _XMLDoc_handleNode(current) > { > /* > function: _XMLDoc_handleNode > Author: mi...@id... > Description: > adds a markup element to the document > */ > if ((current.nodeType=='COMMENT') && (this.topNode!=null)) { > return this.topNode.addElement(current); > } > else if ((current.nodeType=='TEXT') || (current.nodeType=='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==null) { > if (trim(current.content,true,false)=="") { > 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); > } > ======================================================================== > 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 = response.getWriter(); > out.println("<?xml version=\"1.0\"?>"); > out.println("<vendor>"); > out.println("<name>"); > out.println("harry"); > out.println("</name>"); > out.println("<address>"); > out.println("100 Cherry Tree Lane"); > out.println("</address>"); > out.println("</vendor>"); > > Is anything obviously wrong with this???? > > Thanks, > Ed > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > |