2006-10-06

Sarissa: XML parsing (take 2)

Use the .getText() method goddamnit! Bit of a glitch there earlier.. Parsing and then (re-)serializing does not make that much sense in retrospect. 8-]

var oDomDoc = Sarissa.getDomDocument( );
oDomDoc = ( new DOMParser()).parseFromString( responseText, "text/xml");
if( oDomDoc.parseError != 0)
  {
    alert( "Virhe. Palvelin lähetti epäkelvon vastauksen. (parse error)");
    critical( );
  }

oDomDoc.setProperty( "SelectionLanguage", "XPath");
var oElem = oDomDoc.selectSingleNode( "//@some_attribute");

var str =Sarissa.getText( oElem);

...