Jump to content

japisoft

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by japisoft

  1. var document = ... // XML document var root = document.documentElement;var children = root.childNodes();for ( var i = 0; i < children.length; i++ ) {  var node = children[ i ];  if ( node.nodeName == "myName" ) {    ....  }}

    You can repeat at any level this kind of loop, you may also use nodeType for filtering elements. Best regards

  2. hi,You must use length() on your string for it. compareTo is for sorting an array of object. Note that your sort is not usual, you should do that

    ArrayList l = new ArrayList(); l.add( myCountry );Collections.sort( l );

  3. Hello, This instruction is very dangerous x.childNodes[0]; Because you wait for an element node at the first index therefore it could bea text node and it can depend on the navigator. You may use the getElementsByTagName forfiltering the good one. Best wishes

    • Like 1
×
×
  • Create New...