xmljs-users Mailing List for xml for SCRIPT (Page 4)
Brought to you by:
djoham,
witchhunter
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(9) |
Mar
(20) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(14) |
Aug
(14) |
Sep
(10) |
Oct
(5) |
Nov
(2) |
Dec
(11) |
2005 |
Jan
(12) |
Feb
(4) |
Mar
(3) |
Apr
(5) |
May
|
Jun
|
Jul
(2) |
Aug
(12) |
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
2006 |
Jan
(2) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
(8) |
2007 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(8) |
Nov
|
Dec
(2) |
2008 |
Jan
(4) |
Feb
|
Mar
|
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
2009 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2010 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(4) |
Jul
(5) |
Aug
(5) |
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(6) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
(5) |
Apr
(3) |
May
(5) |
Jun
(8) |
Jul
(3) |
Aug
(14) |
Sep
(22) |
Oct
(9) |
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ricky V. <rv...@da...> - 2006-08-24 13:49:34
|
I have found xml.js has to sacrifice performance for cross browser compatibility (not taking anything away from it, because it is cool). However, if your project allows you to code for exclusively Firefox/IE, attached is some code that I use to do ajax calls to Servlets and ASP apps. //** BEGIN CODE /** XHConn - Simple XMLHTTP Interface - bf...@gm... - 2005-04-08 ** ** Code licensed under Creative Commons Attribution-ShareAlike License ** ** http://creativecommons.org/licenses/by-sa/2.0/ ** var myConn = new XHConn(); if (!myConn) alert("XMLHTTP not available. Try a newer/better browser."); var fnWhenDone = function (oXML) { alert(oXML.responseText); }; myConn.connect("mypage.php", "POST", "foo=bar&baz=qux", fnWhenDone); */ function XHConn() { var xmlhttp, bComplete = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; }}} if (!xmlhttp) return null; this.connect = function(sURL, sMethod, sVars, fnDone) { if (!xmlhttp) return false; bComplete = false; sMethod = sMethod.toUpperCase(); try { if (sMethod == "GET") { xmlhttp.open(sMethod, sURL+"?"+sVars, true); sVars = ""; } else { xmlhttp.open(sMethod, sURL, true); xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState == 4 && !bComplete) { bComplete = true; fnDone(xmlhttp); }}; xmlhttp.send(sVars); } catch(z) { return false; } return true; }; return this; } //** END CODE Ricky Vega (817) 313-6873 -----Original Message----- From: xml...@li... [mailto:xml...@li...] On Behalf Of Tornick, Edward x. -ND Sent: Thursday, August 24, 2006 8:32 AM To: David Joham; xml...@li... Subject: Re: [xmljs-users] Parser error: expected document node... I am using a javascript package called prototype.js on the client to do an ajax call to a servlet. The response ends up in a variable in a javascript function on the client. var xmlResponse = originalRequest.responseText; When I look at the response it looks like this... <?xml version="1.0"?> <vendor> <name> harry </name> <address> 100 Cherry Tree Lane </address> </vendor> xmlResponse is being processed by xmldos.js ======================================================== var objDom = new XMLDoc(xmlResponse, xmlError); var objDomTree = objDom.docNode; var tag1Elements = objDomTree.getElements("name"); var element = tag1Elements[0]; var name = element.getText(); var tag1Elements = objDomTree.getElements("address"); var element = tag1Elements[0]; var address = element.getText(); alert(name); alert(address); ========================================================== The nodes are being found. And my alerts show "harry" and "100 cherry Tree Lane" but the error Routine xmlError is called as each node is parsed. I will try the other parser as you suggested if I don't get anywhere with this. Thanks David Ed -----Original Message----- From: David Joham [mailto:dj...@ya...] Sent: Thursday, August 24, 2006 9:16 AM To: Tornick, Edward x. -ND; xml...@li... Subject: Re: [xmljs-users] Parser error: expected document node... 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=1216 > 42> _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > ------------------------------------------------------------------------- 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 |
From: Tornick, E. x. -N. <Edw...@es...> - 2006-08-24 13:33:07
|
I am using a javascript package called prototype.js on the client to do an ajax call to a servlet. The response ends up in a variable in a javascript function on the client. var xmlResponse =3D originalRequest.responseText; When I look at the response it looks like this... <?xml version=3D"1.0"?> <vendor> <name> harry </name> <address> 100 Cherry Tree Lane </address>=09 </vendor> xmlResponse is being processed by xmldos.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 var objDom =3D new XMLDoc(xmlResponse, xmlError); var objDomTree =3D objDom.docNode; var tag1Elements =3D objDomTree.getElements("name"); var element =3D tag1Elements[0]; var name =3D element.getText(); =20 var tag1Elements =3D objDomTree.getElements("address"); var element =3D tag1Elements[0]; var address =3D element.getText(); =20 alert(name); alert(address);=20 =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 nodes are being found. And my alerts show "harry" and "100 cherry Tree Lane" but the error Routine xmlError is called as each node is parsed. I will try the other parser as you suggested if I don't get anywhere with this.=20 Thanks David Ed -----Original Message----- From: David Joham [mailto:dj...@ya...]=20 Sent: Thursday, August 24, 2006 9:16 AM To: Tornick, Edward x. -ND; xml...@li... Subject: Re: [xmljs-users] Parser error: expected document node... 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=20 > document node found text. >=20 > 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 >=20 >=20 > function _XMLDoc_handleNode(current) > { > /* > 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') || =20 > (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=20 > 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: " +=20 > current); > } > } > else { > // otherwise, append this as child to the element at the=20 > 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.... >=20 > 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>"); >=20 > Is anything obviously wrong with this???? >=20 > Thanks, > Ed >=20 > > -------------------------------------------------------------------- > > ----- > 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=20 > Apache Geronimo=20 > = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 1216 > 42> _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users >=20 |
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 > |
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 |
From: David J. <dj...@ya...> - 2006-06-20 03:21:58
|
Interesting question... If the SVG document can call scripting then I don't see why not... What exactly are you trying to do? David --- Jayme Jeffman <jje...@gm...> wrote: > Hello to all, > May I create a instance of the DOMImplementation class inside a SVG document > ? > > -- > Jayme > > > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > |
From: Jayme J. <jje...@gm...> - 2006-06-19 21:35:47
|
Hello to all, May I create a instance of the DOMImplementation class inside a SVG document ? -- Jayme |
From: David J. <dj...@ya...> - 2006-04-12 14:48:30
|
Sorry, XML for <SCRIPT> doesn't have an XSL processor... David --- Srikanth Katepalli <kat...@gm...> wrote: > Hi, > I am new to Xml for <script>, trying to implement following code.I want to > load xsl and parse with xmlobject using <script> like following code.... > ss = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0'); > ss.async = false; > ss.load('bodycontent.xsl'); > cache = new ActiveXObject("Msxml2.XSLTemplate.3.0"); > cache.stylesheet = ss; > > var src = new ActiveXObject('MSXML2.DOMDocument.3.0'); > src.async = false; > src.load(xmlobject); > var proc = cache.createProcessor(); > proc.addParameter("myWidth",myWidth) > proc.input = src; > proc.transform(); > > Regards > Srikanth > |
From: Srikanth K. <kat...@gm...> - 2006-04-11 23:54:33
|
Hi, I am new to Xml for <script>, trying to implement following code.I want to load xsl and parse with xmlobject using <script> like following code.... ss =3D new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0'); ss.async =3D false; ss.load('bodycontent.xsl'); cache =3D new ActiveXObject("Msxml2.XSLTemplate.3.0"); cache.stylesheet =3D ss; var src =3D new ActiveXObject('MSXML2.DOMDocument.3.0'); src.async =3D false; src.load(xmlobject); var proc =3D cache.createProcessor(); proc.addParameter("myWidth",myWidth) proc.input =3D src; proc.transform(); Regards Srikanth |
From: Gavin <in...@bo...> - 2006-03-21 21:33:26
|
Hello, I am hoping to search an XML file (an rss feed), extract a string from it and pass this string as an argument in a web address. The XML file is cross domain - resides on a different server. The string I want to extract is in some HTML code (inside the XML document). I can identify the string as lying between "> and </a> in hte XML document. Questions which spring to mind are: Is this the right tool for the job? Can any one offer me any guidance/Hints/Links How difficult is it? My ability: I don't know much about javascript but I normally get there in the end! Thanks anyone for bothering to help, Gavin www.boredbrand.com |
From: James O. <jol...@bo...> - 2006-03-21 16:31:12
|
Ivo, I suggest using DOM to process all those nodes. The DOM processing should be well under 10 seconds for 5000 nodes. I've actually used DOM processing on ~3000 nodes and it usually completed in 2-3 seconds. In fact I did a side-by-side comparison of SAX to DOM using xmljs's SAX parser and DOM was about a second faster (both in IE and Firefox). Also when using DOM it's best to use getElementsByTagName() so if you have an XML file that looks like the following: <?xml version=3D"1.0"?> <myFile> <head> <!-- header information, metadata etc... --> </head> <body> <node> <!-- node data --> </node> <node> <!-- more node data --> </node> <node> <!-- etc... --> </node> <node> <!-- etc... --> </node> <node> <!-- etc... --> </node> </body> </myFile> You'd use var myNodes =3D document.getElementsByTagName('node'); to grab = a full listing of all your file's nodes. You can then run through this your myNodes array and process the subnodes or data however you wish. Again, this runs surprisingly fast and my guess is that's because when the XML file is initially loaded (either on initial load of the page or via an AJAX call) the browser parses the file using an optimized parser and then exposes the information to you via the DOM.=20 If you're having any trouble with the XML being processed slowly and taking forever to display I recommend analyzing your display code, not your processing code. Always output your HTML to a temporary variable within a loop and once the loop is done pop that temporary node or insert your temp vars innerHTML into your document, don't do it inside the loop because it will drastically decrease your performance. Good luck and let me know if you're having any further issues. James Oltmans |
From: David J. <dj...@ya...> - 2006-03-20 18:30:11
|
The SAX parser would probably be the fastest, although the classic DOM might be very close. Either way, you're probably well into go-get-a-cup-of-coffee-while-it-parses territory with 4000 nodes. At this point, you may be better served to load the XML up into a native parser and accept the browser limitations that requires. I'm not familiar enough with json to say if it will help or not - sorry... Best regards, David --- Ivo Benedito <ivo...@gm...> wrote: > Hi, > > I need to parse XML Files with 5000 plus lines in javascript. Since that > means a big break of performance in the web app, i had to pass that parsing > to the server side with php. Then what i did, is removing the trash from the > xml file that doesn't matter to me (tags that i dont need in the app) and > save some thousands of lines. But even with that, i get some xml files with > more than 4000 lines, and so it always gets a bit slowly to parse all that > lines. Can u confirm me if the best way to parse that xml files is using sax > parser or is it anything better to do it ?? Maybe i could try json 2 ... :| > |
From: Ivo B. <ivo...@gm...> - 2006-03-20 17:31:10
|
Hi, I need to parse XML Files with 5000 plus lines in javascript. Since that means a big break of performance in the web app, i had to pass that parsing to the server side with php. Then what i did, is removing the trash from th= e xml file that doesn't matter to me (tags that i dont need in the app) and save some thousands of lines. But even with that, i get some xml files with more than 4000 lines, and so it always gets a bit slowly to parse all that lines. Can u confirm me if the best way to parse that xml files is using sa= x parser or is it anything better to do it ?? Maybe i could try json 2 ... :| |
From: David J. <dj...@ya...> - 2006-02-20 21:39:11
|
Depending on your security constraints, you might be able to use xmljs's server-side proxies (http://xmljs.sourceforge.net/website/documentation-xmlproxies.html) or load the XML file directly (http://xmljs.sourceforge.net/website/documentation-tools.html#toolsLoadLocalData)... Good luck! David --- Ivo Benedito <ivo...@gm...> wrote: > Hi, > > I´m developing a (Thin)Web Client for WMS(Web Map Service) and WFS-T(Web > Feature Service - Transacional) Servers and this libraries for parsing xml > files in client side with javascript are very good since they are > cross-browser and implement W3C DOM Model. The main problem i´m having for > now, is that the XML Files i want to parse on client side are responses from > this WMS and WFT-S Servers. For example, i get a xml file from this url's > http://www.demis.nl/mapserver/request.asp?REQUEST=GetCapabilities , > http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi?REQUEST=GetCapabilities > (this > xml files contain information about the refered server capabilities) and i > dont know how to place the content of these xml files into a string or a > form object (hidden textarea, etc ...). Can anyone give me a help plz ?? > > Thks a lot ;) and keep on the good work. > > Ivo Benedito -> ivo...@gm... > |
From: Ivo B. <ivo...@gm...> - 2006-02-20 17:02:18
|
Hi, I=B4m developing a (Thin)Web Client for WMS(Web Map Service) and WFS-T(= Web Feature Service - Transacional) Servers and this libraries for parsing xml files in client side with javascript are very good since they are cross-browser and implement W3C DOM Model. The main problem i=B4m having fo= r now, is that the XML Files i want to parse on client side are responses fro= m this WMS and WFT-S Servers. For example, i get a xml file from this url's http://www.demis.nl/mapserver/request.asp?REQUEST=3DGetCapabilities , http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi?REQUEST=3DGetCa= pabilities (this xml files contain information about the refered server capabilities) and i dont know how to place the content of these xml files into a string or a form object (hidden textarea, etc ...). Can anyone give me a help plz ?? Thks a lot ;) and keep on the good work. Ivo Benedito -> ivo...@gm... |
From: David J. <dj...@ya...> - 2006-01-03 16:47:49
|
Hello Craig, If you're using XML for , you can use its ability to load local XML files from within the browser without having to refresh the page. Take a look at http://xmljs.sourceforge.net/website/tools-loadLocalXML.html for the documentation. If you're using other XML technologies, another option would be to make an XMLHTTPRequest to get the data. I don't have a good link for this right off hand, but a quick search should get you going... Best regards, David ----- Original Message ---- From: Craig Atkin <cr...@at...> To: xml...@li... Sent: Mon 02 Jan 2006 04:33:48 AM MST Subject: [xmljs-users] XML help.. Hi, I have a XML file that looks like the following. Data.xml <?xml version="1.0"?> <ControlME> <CurrentPresets> <Var0>2</Var0> <Var1>345</Var1> <Var2>34</Var2> <Var3>455</Var3> <Var4>1</Var4> <Var5>54</Var5> <Var6>67</Var6> </CurrentPresets> </ControlME> These values are constantly updating. I was wondering if any one would have a simple example of getting the values into a web page via button alert. eg: <input type="button" onclick="alert(getData('Data.xml', 'Var0'))" value="Var0"> Regards Craig ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ xmljs-users mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmljs-users |
From: Craig A. <cr...@at...> - 2006-01-02 11:33:54
|
Hi, I have a XML file that looks like the following. Data.xml <?xml version="1.0"?> <ControlME> <CurrentPresets> <Var0>2</Var0> <Var1>345</Var1> <Var2>34</Var2> <Var3>455</Var3> <Var4>1</Var4> <Var5>54</Var5> <Var6>67</Var6> </CurrentPresets> </ControlME> These values are constantly updating. I was wondering if any one would have a simple example of getting the values into a web page via button alert. eg: <input type="button" onclick="alert(getData('Data.xml', 'Var0'))" value="Var0"> Regards Craig |
From: David J. <dj...@ya...> - 2005-12-15 17:24:43
|
You can download the entire package of XML for by visiting this page (http://xmljs.sourceforge.net/website/download.html) and clicking on the "Download XML for Core Package (~720K)" link. That will download everything you need. Best regards, David ----- Original Message ---- From: noel garchitorena To: xml...@li... Sent: Thu 15 Dec 2005 01:00:22 AM MST Subject: [xmljs-users] log-in activation i want to download your sample script can you able to simplified your procedure. this are all wasting time. thanks Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
From: David J. <dj...@ya...> - 2005-12-15 17:21:59
|
Hello, Simplify what proceedure? Please be specific so we can best help you out. Please be aware that we do use the SourceForge tools so we don't control some of the things on our site... Best regards, David ----- Original Message ---- From: noel garchitorena <noe...@ya...> To: xml...@li... Sent: Thu 15 Dec 2005 01:01:31 AM MST Subject: [xmljs-users] post to this list my name simplify your procedure please. you have a lot of non-sense procedure. thanks Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
From: noel g. <noe...@ya...> - 2005-12-15 08:01:38
|
simplify your procedure please. you have a lot of non-sense procedure. thanks --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
From: noel g. <noe...@ya...> - 2005-12-15 08:00:29
|
i want to download your sample script can you able to simplified your procedure. this are all wasting time. thanks --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
From: Yoshi C. <yc...@ne...> - 2005-11-07 23:21:08
|
Are operators like "and" , "or" allow in XPATH for <script>? =20 I want to do something like the following: =20 //tag[@attr1=3D"a" and @attr2=3D"b"] =20 Is this possible? =20 Thanks in advance |
From: Brent J. <blj...@gm...> - 2005-08-29 17:08:22
|
> encoding: > XML for script shouldn't have a problem here. I did a check on th= e rss feed and the server isn't > specifying an encoding. Is it possible that Konfabulator is goofing up th= e string before xmljs > gets it? When I load the XML from that data source, Konqueror loses the a= ccents also. However, > Firefox does not. Just to make sure xmljs was OK, I stripped the XML from= that source down to the > bare minimum that had the accented characters. I then fed that XML into x= mljs in Firefox and > looked at the DOM tree. The accents were still there. >=20 > At this point, I'm not sure what really to do about the encoding issue. I= do have a battered G3 > Powerbook that I can use for further debugging, but I've never used Konfa= bulator and don't really > have a lot of time to learn it. Do you have any suggestions? Konfabulator is cross platform and I'm running it on a Windows machine, but I wouldn't take the time to learn it just for this problem. Here's what I did.. I downloaded the XML feed using "wget" (on Linux) which does nothing but pull it from the server and save it as a text file. Here's the first line: <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> So it's specifying an encoding there. I did notice that Firefox and IE both were translating the text. If I open the the file I downloaded with wget in Notepad it also shows correctly. So pretty much anything I open it with in Windows works. BUT, if I open the file with VIM on a Linux machine, I see garbled characters. So I suspect that most Windows apps are translating the characters correctly before sending it to xmljs, but Konfabulator on the other hand isn't doing any sort of translation even though its the Windows version, which is odd. I don't know that much about encoding, so :)=20 I'll bounce this back to the Konfab forums. > Please let me know if the namespaceAware property gets you going. I'll tr= y to look at the > exception in the next couple of days and see if I can get you a real fix.= .. That works perfectly! A real fix isn't really high priority to me. I could care less about the Atom namespaces. I just wanted to be able to parse it enough so Atom feeds could be displayed in my RSS Reader widget. Thanks for your help! - Brent |
From: David J. <dj...@ya...> - 2005-08-29 03:44:17
|
Hi Brent, namespace: something is horked here, but I don't know what it is yet. For the time being, you can probably get past this by turning namespace support off. It doesn't look like atom feeds really use namespaces all that much, so I doubt that will impact your code at all. To turn namespace support off, you set the namespaceAware property of the DOMImplementation node to false - like this: var parser = new DOMImplementation(); parser.namespaceAware = false; That got me past the exception and I was able to parse the XML properly... encoding: XML for script shouldn't have a problem here. I did a check on the rss feed and the server isn't specifying an encoding. Is it possible that Konfabulator is goofing up the string before xmljs gets it? When I load the XML from that data source, Konqueror loses the accents also. However, Firefox does not. Just to make sure xmljs was OK, I stripped the XML from that source down to the bare minimum that had the accented characters. I then fed that XML into xmljs in Firefox and looked at the DOM tree. The accents were still there. At this point, I'm not sure what really to do about the encoding issue. I do have a battered G3 Powerbook that I can use for further debugging, but I've never used Konfabulator and don't really have a lot of time to learn it. Do you have any suggestions? Please let me know if the namespaceAware property gets you going. I'll try to look at the exception in the next couple of days and see if I can get you a real fix... Best regards, David --- Brent Johnson <blj...@gm...> wrote: > > > 1) I can't get it to parse Atom feeds. It just keeps returning a > > > NAMESPACE_ERR. Anyone run into this and know how I can fix this, or a > > > way to get around it? > > > > I've never tried an Atom feed. Can you post as small an example as possible so we can take a > look > > at it? > > The example the user sent to me (I'm using xmljs for a Konfabulator > widget) was a blog entry on blogspot.com: > > http://trishtunney.blogspot.com/atom.xml > > > > 2) Encoding! I'm trying to pull an RSS feed thats in french and the > > > accented characters just keep coming back as garbled when I get the > > > node value of the text node containing the french text. > > > > > Make sure the page's locale header specifies the proper encoding. Otherwise, the browser has > to > > guess what it should be and may very well guess wrong. Otherwise, it should work... > > Hmm, here's the example RSS feed that has french characters: > http://www.lapresseaffaires.com/rss/lpa.xml > > Thanks, > > - Brent > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > |
From: Barry B. <ba...@ta...> - 2005-08-26 00:10:28
|
ach, you're spot on David to get the node itself it needed: var addressNode =3D = addressRoot.getElementsByTagName("addresses").item(0); so I could then do:=20 addressNode.removeChild(addrBlock); thanx again barry.b > -----Original Message----- > From: David Joham [mailto:dj...@ya...] > Sent: Friday, 26 August 2005 2:34 AM > To: Barry Beattie; XmlForJS (E-mail) > Subject: Re: [xmljs-users] .removeChild() syntax - just can't get it > right... >=20 >=20 >=20 > Hi Barry, >=20 > The problem is that the variable "addresses" is a DOMNodeList=20 > (returned from getChildNodes). A > DOMNodeList doesn't support removeChild. >=20 > Basically, you need to get yourself a reference back to the=20 > addresses node so you can call > removeChild. >=20 >=20 > Hope this helps! >=20 > David >=20 > --- Barry Beattie <ba...@ta...> wrote: >=20 > > Hi all > >=20 > > the error is "object doesn't support this property or method" > >=20 > > but I'm trying to remove a node (and it's children) and=20 > just can't land it on the correct node. > > Any idea what I'm doing wrong? I can see (alert) the=20 > correct node to remove but... (using W3C > > DOM) > >=20 > > thanx > > barry.b > >=20 > > code > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > function clearaddress(element_id){ > > var ele =3D document.getElementById(element_id); > > var clearAddrNum =3D ele.options[ele.selectedIndex].value; > > var addressRoot =3D masterXmlDoc.getDocumentElement();=20 > > var addresses =3D=20 > addressRoot.getElementsByTagName("addresses").item(0).getChildNodes(); > > var addrBlock, address; > > alert(masterXmlDoc);=20 > > for(var i=3D0;i<addresses.length;i++){ > > =09 > if(addresses.item(i).getAttribute("add_num")=3D=3DclearAddrNum){ > > address =3D addresses.item(i); > > alert(address) > > addresses.removeChild(address); > > break; > > }//if=09 > > }//for > > }=09 > >=20 > > XML schema(eg: want to remove address where add_num=3D"2") > > = =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 > > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>=20 > > <entity> > > <addresses> > > <address add_num=3D"1"> > > <address_name1 required=3D"true"> > > <![CDATA[ Gomez Addams ]]> > > </address_name1> > > </address> > > <address add_num=3D"2"> > > <address_name1 required=3D"true"> > > <![CDATA[ Fester Addams ]]> > > </address_name1> > > </address> > > </addresses> > > </entity> > >=20 > >=20 > >=20 > >=20 > > cheers > > barry.b > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > September 19-22, 2005 * San Francisco, CA * Development=20 > Lifecycle Practices > > Agile & Plan-Driven Development * Managing Projects & Teams=20 > * Testing & QA > > Security * Process Improvement & Measurement *=20 http://www.sqe.com/bsce5sf > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users >=20 |
From: David J. <dj...@ya...> - 2005-08-25 19:49:29
|
OK, thanks. I'll see if I can take a look at it sometime tonight or over the weekend... David --- Brent Johnson <blj...@gm...> wrote: > > > 1) I can't get it to parse Atom feeds. It just keeps returning a > > > NAMESPACE_ERR. Anyone run into this and know how I can fix this, or a > > > way to get around it? > > > > I've never tried an Atom feed. Can you post as small an example as possible so we can take a > look > > at it? > > The example the user sent to me (I'm using xmljs for a Konfabulator > widget) was a blog entry on blogspot.com: > > http://trishtunney.blogspot.com/atom.xml > > > > 2) Encoding! I'm trying to pull an RSS feed thats in french and the > > > accented characters just keep coming back as garbled when I get the > > > node value of the text node containing the french text. > > > > > Make sure the page's locale header specifies the proper encoding. Otherwise, the browser has > to > > guess what it should be and may very well guess wrong. Otherwise, it should work... > > Hmm, here's the example RSS feed that has french characters: > http://www.lapresseaffaires.com/rss/lpa.xml > > Thanks, > > - Brent > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > |