Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16684 > unrolled thread
| Started by | Pervez Mulla <mullapervez@gmail.com> |
|---|---|
| First post | 2012-10-17 05:23 -0700 |
| Last post | 2012-10-31 00:50 -0700 |
| Articles | 15 — 8 participants |
Back to article view | Back to comp.lang.javascript
Display XML content in HTML page Pervez Mulla <mullapervez@gmail.com> - 2012-10-17 05:23 -0700
Re: Display XML content in HTML page Jim T. <x@y.z> - 2012-10-17 09:11 -0400
Re: Display XML content in HTML page Jim T. <x@y.z> - 2012-10-17 09:20 -0400
Re: Display XML content in HTML page Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-17 10:24 -0700
Re: Display XML content in HTML page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-17 20:05 +0200
Re: Display XML content in HTML page Jim T. <x@y.z> - 2012-10-17 21:31 -0400
Re: Display XML content in HTML page Pervez Mulla <mullapervez@gmail.com> - 2012-10-17 21:42 -0700
Re: Display XML content in HTML page Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2012-10-17 15:39 +0200
Re: Display XML content in HTML page Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-17 20:03 +0200
Re: Display XML content in HTML page Pervez Mulla <mullapervez@gmail.com> - 2012-10-17 21:38 -0700
Re: Display XML content in HTML page Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-18 07:41 +0200
Re: Display XML content in HTML page Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-29 12:09 +0100
Re: Display XML content in HTML page Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-11-09 23:03 +0100
Re: Display XML content in HTML page Danny <dann90038@gmail.com> - 2012-10-17 13:19 -0700
Re: Display XML content in HTML page Bart Van der Donck <bart@nijlen.com> - 2012-10-31 00:50 -0700
| From | Pervez Mulla <mullapervez@gmail.com> |
|---|---|
| Date | 2012-10-17 05:23 -0700 |
| Subject | Display XML content in HTML page |
| Message-ID | <1a067dc0-9d64-4b7c-ba61-736bf747bb78@googlegroups.com> |
Hi, 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 . <perldata> <hashref memory_address="0x86f4880"> <item key="0">1</item> </hashref> </perldata> <perldata> <hashref memory_address="0x86f4880"> <item key="43">1</item> </hashref> </perldata> <perldata> <hashref memory_address="0x86f4880"> <item key="44">1</item> </hashref> </perldata> <perldata> <hashref memory_address="0x86f4880"> <item key="45">1</item> </hashref> </perldata> <perldata> <hashref memory_address="0x86f4880"> <item key="46">1</item> </hashref> </perldata> <perldata> <hashref memory_address="0x86f4880"> <item key="50">1</item> </hashref> </perldata> Please Help Thank You Pervez
[toc] | [next] | [standalone]
| From | Jim T. <x@y.z> |
|---|---|
| Date | 2012-10-17 09:11 -0400 |
| Message-ID | <7cbt78t4o9lq18ta0tisg2ftq8gmp3pm9k@4ax.com> |
| In reply to | #16684 |
On Wed, 17 Oct 2012 05:23:19 -0700 (PDT), Pervez Mulla <mullapervez@gmail.com> wrote: >Hi, > >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. ><perldata> > <hashref memory_address="0x86f4880"> > <item key="0">1</item> > </hashref> ></perldata> ><perldata> > <hashref memory_address="0x86f4880"> > <item key="43">1</item> > </hashref> ></perldata> ><perldata> > <hashref memory_address="0x86f4880"> > <item key="44">1</item> > </hashref> ></perldata> ><perldata> > <hashref memory_address="0x86f4880"> > <item key="45">1</item> > </hashref> ></perldata> ><perldata> > <hashref memory_address="0x86f4880"> > <item key="46">1</item> > </hashref> ></perldata> ><perldata> > <hashref memory_address="0x86f4880"> > <item key="50">1</item> > </hashref> ></perldata> > > > >Please Help > > >Thank You >Pervez
[toc] | [prev] | [next] | [standalone]
| From | Jim T. <x@y.z> |
|---|---|
| Date | 2012-10-17 09:20 -0400 |
| Message-ID | <54ct78lpaki80ajirin38tlgtv99rltmgj@4ax.com> |
| In reply to | #16685 |
On Wed, 17 Oct 2012 09:11:44 -0400, Jim T. <x@y.z> wrote: >On Wed, 17 Oct 2012 05:23:19 -0700 (PDT), Pervez Mulla ><mullapervez@gmail.com> wrote: > >>Hi, >> >>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. If that's NOT the problem I meant to say.
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2012-10-17 10:24 -0700 |
| Message-ID | <pRBfs.2677$7h4.909@newsfe10.iad> |
| In reply to | #16685 |
On 10/17/12 6:11 AM, Jim T. wrote: > On Wed, 17 Oct 2012 05:23:19 -0700 (PDT), Pervez Mulla > <mullapervez@gmail.com> wrote: > >> Hi, >> >> 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! In any case, is it possible to change the back-end perl script's output? JSON is an easier transport format to deal with in JavaScript. > >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="0">1</item> >> </hashref> >> </perldata> >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="43">1</item> >> </hashref> >> </perldata> >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="44">1</item> >> </hashref> >> </perldata> >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="45">1</item> >> </hashref> >> </perldata> >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="46">1</item> >> </hashref> >> </perldata> >> <perldata> >> <hashref memory_address="0x86f4880"> >> <item key="50">1</item> >> </hashref> >> </perldata> >> >> >> >> Please Help >> >> >> Thank You >> Pervez >
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-17 20:05 +0200 |
| Message-ID | <10917678.yukSOJlrKS@PointedEars.de> |
| In reply to | #16689 |
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, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
[toc] | [prev] | [next] | [standalone]
| From | Jim T. <x@y.z> |
|---|---|
| Date | 2012-10-17 21:31 -0400 |
| Message-ID | <3jmu7854it6udvqrajv9fv1nnd3pqaltpe@4ax.com> |
| In reply to | #16689 |
On Wed, 17 Oct 2012 10:24:36 -0700, Daniel Pitts <newsgroup.nospam@virtualinfinity.net> wrote: >On 10/17/12 6:11 AM, Jim T. wrote: >> On Wed, 17 Oct 2012 05:23:19 -0700 (PDT), Pervez Mulla >> <mullapervez@gmail.com> wrote: >> >>> Hi, >>> >>> 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! In this case, if the XML is always structured as the sample below, it would be trivial to extra the data with RegExp. You're right thought that it's not the solution to use for general XML parsing. >In any case, is it possible to change the back-end perl script's output? > JSON is an easier transport format to deal with in JavaScript. > >> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="0">1</item> >>> </hashref> >>> </perldata> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="43">1</item> >>> </hashref> >>> </perldata> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="44">1</item> >>> </hashref> >>> </perldata> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="45">1</item> >>> </hashref> >>> </perldata> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="46">1</item> >>> </hashref> >>> </perldata> >>> <perldata> >>> <hashref memory_address="0x86f4880"> >>> <item key="50">1</item> >>> </hashref> >>> </perldata> >>> >>> >>> >>> Please Help >>> >>> >>> Thank You >>> Pervez >>
[toc] | [prev] | [next] | [standalone]
| From | Pervez Mulla <mullapervez@gmail.com> |
|---|---|
| Date | 2012-10-17 21:42 -0700 |
| Message-ID | <92f5b4e3-d3d7-4bf5-8c42-de2b66a121e5@googlegroups.com> |
| In reply to | #16689 |
On Wednesday, October 17, 2012 10:54:37 PM UTC+5:30, Daniel Pitts wrote: > On 10/17/12 6:11 AM, Jim T. wrote: > > > On Wed, 17 Oct 2012 05:23:19 -0700 (PDT), Pervez Mulla > > > <mullapervez@gmail.com> wrote: > > > > > >> Hi, > > >> > > >> 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! > > > > In any case, is it possible to change the back-end perl script's output? > > JSON is an easier transport format to deal with in JavaScript. > > > > > > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="0">1</item> > > >> </hashref> > > >> </perldata> > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="43">1</item> > > >> </hashref> > > >> </perldata> > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="44">1</item> > > >> </hashref> > > >> </perldata> > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="45">1</item> > > >> </hashref> > > >> </perldata> > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="46">1</item> > > >> </hashref> > > >> </perldata> > > >> <perldata> > > >> <hashref memory_address="0x86f4880"> > > >> <item key="50">1</item> > > >> </hashref> > > >> </perldata> > > >> > > >> > > >> > > >> Please Help > > >> > > >> > > >> Thank You > > >> Pervez > > > Hi Daniel, Yeah I can change that perl script output to get JSON data in terms of key/value pair. Please can u give me some example which suits my requirement......?
[toc] | [prev] | [next] | [standalone]
| From | Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> |
|---|---|
| Date | 2012-10-17 15:39 +0200 |
| Message-ID | <r3dt78h84julo9n901bh4ttrnnehfdk8sb@4ax.com> |
| In reply to | #16684 |
One standard method is to attach an XSLT style sheet to the HTML page. XSLT is a functional language that is made expressly for the transformation of XML into any other text, including HTML. You could also do it in JavaScript, but there it would be nice to have an XML parser. There is one in the XMLHttpRequest object. You could use that one by calling up the XML through AJAX. Otherwise you would have to find one or write one, which is not too difficult either. Hans-Georg
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2012-10-17 20:03 +0200 |
| Message-ID | <k5mrtl$fqk$2@speranza.aioe.org> |
| In reply to | #16684 |
W dniu 2012-10-17 14:23, Pervez Mulla pisze:
> Hi,
>
> 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 .
[...]
Maybe this could help you:
var parseXml;
if (typeof window.DOMParser !== "undefined") {
parseXml = function (xmlStr) {
return (new window.DOMParser()).parseFromString(xmlStr,
"text/xml");
};
} else if (typeof window.ActiveXObject !== "undefined" && new
window.ActiveXObject("Microsoft.XMLDOM")) {
parseXml = function (xmlStr) {
var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xmlStr);
return xmlDoc;
};
} else {
throw new Error("No XML parser found");
}
--
Cezary Tomczyk
http://www.ctomczyk.pl/
[toc] | [prev] | [next] | [standalone]
| From | Pervez Mulla <mullapervez@gmail.com> |
|---|---|
| Date | 2012-10-17 21:38 -0700 |
| Message-ID | <a5bc3e3a-3e99-4036-82a4-46af06387736@googlegroups.com> |
| In reply to | #16691 |
On Wednesday, October 17, 2012 11:33:37 PM UTC+5:30, Cezary Tomczyk wrote:
> W dniu 2012-10-17 14:23, Pervez Mulla pisze:
>
> > Hi,
>
> >
>
> > 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 .
>
> [...]
>
>
>
> Maybe this could help you:
>
>
>
> var parseXml;
>
>
>
> if (typeof window.DOMParser !== "undefined") {
>
> parseXml = function (xmlStr) {
>
> return (new window.DOMParser()).parseFromString(xmlStr,
>
> "text/xml");
>
> };
>
> } else if (typeof window.ActiveXObject !== "undefined" && new
>
> window.ActiveXObject("Microsoft.XMLDOM")) {
>
> parseXml = function (xmlStr) {
>
> var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
>
> xmlDoc.async = "false";
>
> xmlDoc.loadXML(xmlStr);
>
> return xmlDoc;
>
> };
>
> } else {
>
> throw new Error("No XML parser found");
>
> }
>
>
>
> --
>
> Cezary Tomczyk
>
> http://www.ctomczyk.pl/
Hi Cezary Tomczyk,
Yeah I can change that to get JSON data too in terms of key/value pair.
Please can u give me example which suits my requirement......?
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2012-10-18 07:41 +0200 |
| Message-ID | <k5o4pt$7jn$1@speranza.aioe.org> |
| In reply to | #16698 |
W dniu 2012-10-18 06:38, Pervez Mulla pisze:
> On Wednesday, October 17, 2012 11:33:37 PM UTC+5:30, Cezary Tomczyk wrote:
>> W dniu 2012-10-17 14:23, Pervez Mulla pisze:
>>
>>> Hi,
>>
>>>
>>
>>> 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 .
>>
>> [...]
>>
>>
>>
>> Maybe this could help you:
>>
>>
>>
>> var parseXml;
>>
>>
>>
>> if (typeof window.DOMParser !== "undefined") {
>>
>> parseXml = function (xmlStr) {
>>
>> return (new window.DOMParser()).parseFromString(xmlStr,
>>
>> "text/xml");
>>
>> };
>>
>> } else if (typeof window.ActiveXObject !== "undefined" && new
>>
>> window.ActiveXObject("Microsoft.XMLDOM")) {
>>
>> parseXml = function (xmlStr) {
>>
>> var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
>>
>> xmlDoc.async = "false";
>>
>> xmlDoc.loadXML(xmlStr);
>>
>> return xmlDoc;
>>
>> };
>>
>> } else {
>>
>> throw new Error("No XML parser found");
>>
>> }
>>
>>
>>
>> --
>>
>> Cezary Tomczyk
>>
>> http://www.ctomczyk.pl/
>
> Hi Cezary Tomczyk,
Hi,
> Yeah I can change that to get JSON data too in terms of key/value pair.
So, then you will not need an XML parser :-) Just get key/value from JSON.
> Please can u give me example which suits my requirement......?
Try to prepare some sample code on http://jsfiddle.net/, because I
cannot understand your whole idea. Maybe I missed something.
As for XML just wanted to note that you can get XML as a string and then
parse using build-it XML parser.
According to parsing XML this maybe interesting for you yet:
http://www.steveborn.com/codenotes/LoadingXML.htm
http://help.dottoro.com/ljssopjn.php
--
Cezary Tomczyk
http://www.ctomczyk.pl/
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-29 12:09 +0100 |
| Message-ID | <5981195.9lX6m5HqsZ@PointedEars.de> |
| In reply to | #16701 |
Cezary Tomczyk wrote: > W dniu 2012-10-18 06:38, Pervez Mulla pisze: >> Cezary Tomczyk wrote: >> Yeah I can change that to get JSON data too in terms of key/value pair. > > So, then you will not need an XML parser :-) Just get key/value from JSON. > >> Please can u give me example which suits my requirement......? > > Try to prepare some sample code on http://jsfiddle.net/, because I > cannot understand your whole idea. Maybe I missed something. > > As for XML just wanted to note that you can get XML as a string and then > parse using build-it XML parser. AISB, XML parsing is unnecessary if the proper Content-Type is served … > According to parsing XML this maybe interesting for you yet: > > http://www.steveborn.com/codenotes/LoadingXML.htm … and that is "explained" there as well. But they are confusing browsers with APIs so there are false negatives. ActiveXObject is _not_ limited to Internet Explorer, but to browsers that provide ActiveX/COM support. Those browsers include all that use MSHTML and have COM support enabled. But there was an ActiveX plugin for Mozilla on Windows once. > http://help.dottoro.com/ljssopjn.php While I have not found something wrong with that resource because I have not reviewed it yet, I strongly suggest you stick to and recommend only the official documentation at the vendor's sites, if available (or sites that cite them specifically, neither of which applies here). There is too much nonsense about this field on the Web to take risks. Your quotations are wasteful and hardly readable. PointedEars -- Danny Goodman's books are out of date and teach practices that are positively harmful for cross-browser scripting. -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2012-11-09 23:03 +0100 |
| Message-ID | <k7jujf$lmn$1@speranza.aioe.org> |
| In reply to | #16945 |
W dniu 2012-10-29 12:09, Thomas 'PointedEars' Lahn pisze: > Cezary Tomczyk wrote: > >> W dniu 2012-10-18 06:38, Pervez Mulla pisze: >>> Cezary Tomczyk wrote: >>> Yeah I can change that to get JSON data too in terms of key/value pair. >> >> So, then you will not need an XML parser :-) Just get key/value from JSON. >> >>> Please can u give me example which suits my requirement......? >> >> Try to prepare some sample code on http://jsfiddle.net/, because I >> cannot understand your whole idea. Maybe I missed something. >> >> As for XML just wanted to note that you can get XML as a string and then >> parse using build-it XML parser. > > AISB, XML parsing is unnecessary if the proper Content-Type is served … I checked it and you right. >> According to parsing XML this maybe interesting for you yet: >> >> http://www.steveborn.com/codenotes/LoadingXML.htm > > … and that is "explained" there as well. But they are confusing browsers > with APIs so there are false negatives. ActiveXObject is _not_ limited to > Internet Explorer, but to browsers that provide ActiveX/COM support. Those > browsers include all that use MSHTML and have COM support enabled. But > there was an ActiveX plugin for Mozilla on Windows once. I completely forgot about that ActiveX is not limited only to IE. I even played on Ubuntu with ActiveX, but not so long. >> http://help.dottoro.com/ljssopjn.php > > While I have not found something wrong with that resource because I have not > reviewed it yet, I strongly suggest you stick to and recommend only the > official documentation at the vendor's sites, if available (or sites that > cite them specifically, neither of which applies here). There is too much > nonsense about this field on the Web to take risks. I'll try to cite more official documentation. > Your quotations are wasteful and hardly readable. Not sure which part is wrong. -- Cezary Tomczyk http://www.ctomczyk.pl/
[toc] | [prev] | [next] | [standalone]
| From | Danny <dann90038@gmail.com> |
|---|---|
| Date | 2012-10-17 13:19 -0700 |
| Message-ID | <b418fddf-4368-4eab-9129-6a5df7dd81b6@googlegroups.com> |
| In reply to | #16684 |
Pervez, as Thomas Lahn suggested, get the file with XMLHttpRequest(), there's no need to parse it, XMLHttpRequest() have a .responseText property, which is just the text/plain content, which is the one folks use the most I guess, however, it also has a .responseXML property, which returns an XML tree off a properly structured .xml file, from there, just traverse it like you'd any other nodes tree.
[toc] | [prev] | [next] | [standalone]
| From | Bart Van der Donck <bart@nijlen.com> |
|---|---|
| Date | 2012-10-31 00:50 -0700 |
| Message-ID | <0e019303-7ea8-4b58-baa3-94e573326690@googlegroups.com> |
| In reply to | #16684 |
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. > > <perldata> > <hashref memory_address="0x86f4880"> > <item key="0">1</item> > </hashref> > </perldata> > <perldata> > <hashref memory_address="0x86f4880"> > <item key="43">1</item> > </hashref> > </perldata> > <perldata> > <hashref memory_address="0x86f4880"> > <item key="44">1</item> > </hashref> > </perldata> > <perldata> > <hashref memory_address="0x86f4880"> > <item key="45">1</item> > </hashref> > </perldata> > <perldata> > <hashref memory_address="0x86f4880"> > <item key="46">1</item> > </hashref> > </perldata> > <perldata> > <hashref memory_address="0x86f4880"> > <item key="50">1</item> > </hashref> > </perldata> > > Please Help > > Thank You > Pervez I would avoid XML in this case. It adds unnecessary complexity. Just send "0-43-44-45-46-50" as the output by Perl, and split by "-" in javascript. You win readability, speed, reliability, and simplicity in code+data. Hope this helps, -- Bart
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web