XML Server Getting Started    
        NodeList children = node.getChildNodes(); 
        if (children!=null) { 
           //The only kid of the node with text: 
           Node textNode = children.item(0);  
           if (textNode!=null) result = textNode.getNodeValue(); 
        } 
     } 
     return result; 
  } 
%><% 
  String result=""; 
  try { 
      InputSource in = new InputSource(request.getInputStream()); 
      XPathAPI xp = new XPathAPI(); 
      DOMParser parser = new DOMParser(); 
      parser.parse(in); 
      Node requestRoot = parser.getDocument().getDocumentElement(); 
      String userid = getNodeValue(xp.selectSingleNode(requestRoot, "//userid"));  
      String password = getNodeValue(xp.selectSingleNode(requestRoot, "//password"));  
//      NodeList details = xp.selectNodeList(requestRoot, "//deltaDetails/*");  
      if (userid.equals(password)) 
          result = ""; 
      else 
          result = "Could not validate user "" + userid + """; 
   } catch (Exception e) { 
     StringBuffer sb = new StringBuffer(getStackTraceAsString(e)); 
      StringFunctions.replaceAll(sb, "&", "&"); 
      StringFunctions.replaceAll(sb, "<", "<"); 
      StringFunctions.replaceAll(sb, "\"", """); 
      result = "" + sb.toString() +  "" ; 
   } finally { 
      out.print(result); 
   } 
%> 
 2000 2002 Computer Technology Inc. All rights reserved. 
Page 51 




J2EE Web Hosting Tundra XML Server Pages J2EE Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.