1. #1
    Ext User
    Join Date
    Feb 2008
    Location
    Chilangolandia (Mexico City)
    Posts
    6
    Vote Rating
    0
    phreakermex is on a distinguished road

      0  

    Default Convert DOM XML Document to string

    Convert DOM XML Document to string


    Hi everyone!

    I've using the next function in order to convert a javascript XML object to string

    Code:
    function XMLtoString(elem){
    	
    	var serialized;
    	
    	try {
    		// XMLSerializer exists in current Mozilla browsers
    		serializer = new XMLSerializer();
    		serialized = serializer.serializeToString(elem);
    	} 
    	catch (e) {
    		// Internet Explorer has a different approach to serializing XML
    		serialized = elem.xml;
    	}
    	
    	return serialized;
    }
    Is there an easier way to perform the above function using ExtJS?
    And, also, when making an Ext.Ajax.request the params need to be string? Or can I pass directly a XML DOM object?

    Greetings!

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,828
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    1) No, there isn't currently anything that does this.

    2) They can either be a string or a JS object.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,501
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You shoujld just be able to specify a document as the data using the xmlData option of http://extjs.com/deploy/dev/docs/?cl...member=request

    the XHR will convert it:

    http://www.w3.org/TR/XMLHttpRequest/#entity-body

  4. #4
    Ext User
    Join Date
    Feb 2009
    Posts
    18
    Vote Rating
    0
    LordLuky is on a distinguished road

      0  

    Talking Thanks!

    Thanks!


    Thank you for source code phreakermex :-). I'm using EXT GWT actually, but for XSLT transformation on Client I need JavaScript. In which I'm less then newbie.
    I could not handle JavaScriptObject in Java, but String is hunky-dory.

    Thanks!

  5. #5
    Ext User
    Join Date
    Dec 2010
    Posts
    1
    Vote Rating
    0
    Appeloappelo is on a distinguished road

      0  

    Default In Javascript for Selenium IDE reading XML from DOM to XMLString

    In Javascript for Selenium IDE reading XML from DOM to XMLString


    ...when you are reading/displaying a xml file in a browser:

    function loadXMLFromDOM2XMLString( xmlString, xmltag, currentChildNode ) {

    var nodes = currentChildNode.childNodes;
    var i = 0 ;
    var node = nodes[i];
    while ( i < nodes.length) {
    if (node.data == null) {xmltag = '<'+node.localName+'>';} else {xmltag = node.data;};
    xmlString = xmlString + xmltag;
    xmlString = loadXMLFromDOM2XMLString( xmlString, xmltag, node );
    if (node.data == null) {xmltag = '<'+'/'+node.localName+'>';} else {xmltag = "";};
    xmlString = xmlString + xmltag;
    i++;
    node = nodes[i];
    }
    return xmlString ;
    } ;

    var xmlString = "";
    var xmltag = "";
    var currentChildNode = window.document;

    xmlString = loadXMLFromDOM2XMLString( xmlString, xmltag, currentChildNode );
    xmlString;

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi