[Dojo-interest] Parse XML from dojo.io.bind

umeshawasthi solutions.aum at gmail.com
Tue Feb 6 09:56:36 MST 2007


Hi All,

I am new to dojo tool kit,i have few problems regarding this.
!)I am making  a form in dojo with some text boxes(combo etc.) in the form
layout.
2) I want to fetch data from these text boxes and convert this in to XML.
How can i  do this in DOJO.Can any body please suggest me about this.

Thanks in advance
Umesh  


D-Fens wrote:
> 
> Hi Penny,
> 
> I guess there is a misunderstanding : data is an xml object already. In IE
> it's an instance of a respective ActiveXObject while in FF it's an
> instance of Document. As per your sample you should try :
> 
> dojo.io.bind({
> formNode: "initForm",
> url: "returnXML.php",
> mimetype: "text/xml",
> load: function(type, data, http) {
> var xml = data;
> // do sth in there
> }
> 
> That's it - xml as well as data is the xml object you are looking for. You
> can serialize this to a string in IE by doing :
>    dojo.debug(data.xml);
> 
> In FF do :
> 
> var serializer = new XMLSerializer();
> dojo.debug(serializer.serialzeToString(data));
> 
> Hope that helps.
> 
> 
> Penny Tso wrote:
>> 
>> Hi D-Fens,
>> 
>> I have tried your code. The object is ActiveXObject in IE while it is
>> Document in FF. So how to retrieve the data in XML in two different
>> objects?
>> 
>> 
>> On 1/29/07, D-Fens <joerg-d.schneider at db.com> wrote:
>>>
>>>
>>> Hi Alihan,
>>>
>>> dojo.io.bind is the dojo wrapper around XMLHTTPRequest object to make
>>> asynchronous requests - does that answer your question ?
>>>
>>> Kind regards
>>>
>>>
>>> aziz-2 wrote:
>>> >
>>> > Hi Defence ,
>>> >
>>> > Is'nt the way, you've written, standart ajax building methot ??
>>> > What does DOJO.io.bind mean here?
>>> >
>>> > Thanks,
>>> >
>>> >
>>> > ----- Original Message -----
>>> > From: "D-Fens" <joerg-d.schneider at db.com>
>>> > To: <dojo-interest at dojotoolkit.org>
>>> > Sent: Monday, January 29, 2007 3:56 PM
>>> > Subject: Re: [Dojo-interest] Parse XML from dojo.io.bind
>>> >
>>> >
>>> >>
>>> >> Hi Penny,
>>> >>
>>> >> actually, I dont get your point - as far as I know, "data" is already
>>> an
>>> >> xml/dom object, so nothing needs to be done indeed. Try this :
>>> >>
>>> >> dojo.io.bind({
>>> >> formNode: "initForm",
>>> >> url: "returnXML.php",
>>> >> mimetype: "text/xml",
>>> >> load: function(type, data, http) {
>>> >>   if(typeof data == 'object') {
>>> >>      dojo.debug("data returned is object");
>>> >>      if(dojo.render.html.ie) {
>>> >>         if(xmlDocument instanceof ActiveXObject) {
>>> >> dojo.debug("data instance is ActiveXObject");
>>> >>         } else {
>>> >>                dojo.debug("data instance is not ActiveXObject");
>>> >>         }
>>> >>      }
>>> >>      if(dojo.render.html.moz) {
>>> >>         if(xmlDocument instanceof Document) {
>>> >> dojo.debug("data instance is Document");
>>> >>         } else {
>>> >>                dojo.debug("data instance is not Document");
>>> >>         }
>>> >>      }
>>> >>   }
>>> >>   if(typeof data == 'string') dojo.debug("data returned is string");
>>> >>
>>> >> // do sth in there
>>> >> }
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> Penny Tso wrote:
>>> >>>
>>> >>> Dear all,
>>> >>>
>>> >>> I want to return the XML from dojo.io.bind. The code as below:-
>>> >>>
>>> >>> dojo.io.bind({
>>> >>> formNode: "initForm",
>>> >>> url: "returnXML.php",
>>> >>> mimetype: "text/xml",
>>> >>> load: function(type, data, http) {
>>> >>> var xml =
>>> >>> dojo.dom.createDocumentFromText(data,'text/xml').documentElement;
>>> >>> // do sth in there
>>> >>> }
>>> >>> How to change the data to XML object in IE and FF?
>>> >>>
>>> >>> Please help!
>>> >>>
>>> >>> --
>>> >>> Best Regards,
>>> >>>
>>> >>> S.L.Tso, Penny
>>> >>> pennytso at gmail.com
>>> >>>
>>> >>> _______________________________________________
>>> >>> Dojo FAQ: http://dojo.jot.com/FAQ
>>> >>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>>> >>> Dojo-interest at dojotoolkit.org
>>> >>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>> >>>
>>> >>>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/Parse-XML-from-dojo.io.bind-tf3135917.html#a8689655
>>> >> Sent from the Dojo mailing list archive at Nabble.com.
>>> >>
>>> >> _______________________________________________
>>> >> Dojo FAQ: http://dojo.jot.com/FAQ
>>> >> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>>> >> Dojo-interest at dojotoolkit.org
>>> >> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>> >
>>> > _______________________________________________
>>> > Dojo FAQ: http://dojo.jot.com/FAQ
>>> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>>> > Dojo-interest at dojotoolkit.org
>>> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Parse-XML-from-dojo.io.bind-tf3135917.html#a8690014
>>> Sent from the Dojo mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>>> Dojo-interest at dojotoolkit.org
>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>>
>> 
>> 
>> 
>> -- 
>> Best Regards,
>> 
>> S.L.Tso, Penny
>> pennytso at gmail.com
>> 
>> _______________________________________________
>> Dojo FAQ: http://dojo.jot.com/FAQ
>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>> Dojo-interest at dojotoolkit.org
>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Parse-XML-from-dojo.io.bind-tf3135917.html#a8829664
Sent from the Dojo mailing list archive at Nabble.com.



More information about the Dojo-interest mailing list