Is there an xml.toString() method ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there an xml.toString() method ?

Mr. Hericus
Hi All,

We've been working very successfully with qooxdoo, and are nearing the
end of our dev cycle for our first product.  Thanks to everyone on the
list for all of your insights.

Unfortunately now we get into the cross-browser stickyness.  Most of
this we have avoided by using the qooxdoo provided functions.  However,
there is one function I can't seem to find, and that is a toString()
method or equivalent on an XML document object.

Given that we create xml documents like this:

// First build the request XML Document
var requestDoc = qx.xml.Document.create(null, "ExecuteNamedQuery");
var requestRoot = requestDoc.documentElement;
requestRoot.setAttribute("queryname", queryName);
...

We also need a way to serialize the XML Document object into a string to
send to the server.  I haven't found anything in the qooxdoo framework,
but perhaps I've overlooked something.  At the moment I'm using a
function that looks like this:

xmlDocToString : function (xml_doc) {
        // code for IE
        if(window.ActiveXObject){
                return xml_doc.xml;
        } else {
                // code for Mozilla, Firefox, Opera, etc.
                return (new XMLSerializer()).serializeToString( xml_doc );
        }
}

But I'm having problems in both IE6 and IE7.  Is there a qooxdoo
function that will do this for me that I have missed?

--
Sincerely,

Mr. Hericus
[hidden email]
http://www.hericus.com



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there an xml.toString() method ?

level420
The xml serializer is in can be found in qx.xml.Element. Method serialize.

I'm doing:

      var xmlString = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' +
qx.xml.Element.serialize(xml);


Mr. Hericus schrieb:

> Hi All,
>
> We've been working very successfully with qooxdoo, and are nearing the
> end of our dev cycle for our first product.  Thanks to everyone on the
> list for all of your insights.
>
> Unfortunately now we get into the cross-browser stickyness.  Most of
> this we have avoided by using the qooxdoo provided functions.  However,
> there is one function I can't seem to find, and that is a toString()
> method or equivalent on an XML document object.
>
> Given that we create xml documents like this:
>
> // First build the request XML Document
> var requestDoc = qx.xml.Document.create(null, "ExecuteNamedQuery");
> var requestRoot = requestDoc.documentElement;
> requestRoot.setAttribute("queryname", queryName);
> ...
>
> We also need a way to serialize the XML Document object into a string to
> send to the server.  I haven't found anything in the qooxdoo framework,
> but perhaps I've overlooked something.  At the moment I'm using a
> function that looks like this:
>
> xmlDocToString : function (xml_doc) {
> // code for IE
> if(window.ActiveXObject){
> return xml_doc.xml;
> } else {
> // code for Mozilla, Firefox, Opera, etc.
> return (new XMLSerializer()).serializeToString( xml_doc );
> }
> }
>
> But I'm having problems in both IE6 and IE7.  Is there a qooxdoo
> function that will do this for me that I have missed?
>
>  

--
Mit freundlichen Grüßen
Dietrich Streifert
--
Visionet GmbH
Firmensitz: Am Weichselgarten 7, 91058 Erlangen
Registergericht: Handelsregister Fürth, HRB 6573
Geschäftsführer: Stefan Lindner




-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is there an xml.toString() method ?

Mr. Hericus
Thanks, Dietrich!  I knew it had to be in there and I was just missing
it.

On Wed, 2008-07-02 at 17:29 +0200, Dietrich Streifert wrote:
> The xml serializer is in can be found in qx.xml.Element. Method serialize.
>
> I'm doing:
>
>       var xmlString = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' +
> qx.xml.Element.serialize(xml);
>
>




-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel