Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!feeder.erje.net!eweka.nl!lightspeed.eweka.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <10917678.yukSOJlrKS@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 17 Oct 2012 20:05:46 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <7cbt78t4o9lq18ta0tisg2ftq8gmp3pm9k@4ax.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 43 NNTP-Posting-Date: 17 Oct 2012 20:05:46 CEST NNTP-Posting-Host: 34ae1238.newsspool2.arcor-online.net X-Trace: DXC=[bkAi^aCP8_\9P[:DUn00QA9EHlD;3YcR4Fo<]lROoRQ8kFKPXB;PldmT3:SB?nHD1FHW\V X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16692 Daniel Pitts wrote: > On 10/17/12 6:11 AM, Jim T. wrote: >> Pervez Mulla wrote: >>> I am newbie , I have application in which check-box tree is present. I >>> want to pre-populate the check-box's if user before checked some of >>> those check box. >>> >>> For that am getting XML format from my back-end perl script as shown >>> below.like , in below XML only 0, 43,44,45,46 and 50 are coming so only >>> those respective checkbox need to checked on page load.I want to display >>> those checked check-box on page load .How can I do this .......? >>> >>> I tried with so many examples . but am not getting solution for my >>> problem .Below is my XML format data which is am getting from perl >>> script . >> >> Is the problem parsing the XML? If so RegExp should be up to the job >> in this case. If that's the the problem please be more specific. > > No. Just no. > RegExp is *never* the solution to XML parsing. Bad! Bad! Utter nonsense. It can be *a* solution, but it has to be done carefully, with the Chomsky hierarchy in mind. In particular, never try to use a *single* RegExp to match a *self-nesting* or otherwise *several times occuring* element in an XML document. (An XML parser can be written that uses a RegExp to match language atoms efficiently and builds a document tree object reliably from the markup. Same for HTML, BTW, but its lacking well- formedness makes it harder.) In this case, however, using the `responseXML' XHR property is the best solution; no additional parsing necessary. For that property to be useful, the server must send a proper XML-related Content-Type; if there is none specific, text/xml should work and is appropriate. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs,