head 1.5; access; symbols; locks; strict; comment @# @; 1.5 date 2001.05.11.18.53.17; author linus; state Exp; branches; next 1.4; 1.4 date 2001.05.03.16.35.32; author linus; state Exp; branches; next 1.3; 1.3 date 2001.05.03.06.42.35; author linus; state Exp; branches; next 1.2; 1.2 date 2001.05.02.23.52.24; author linus; state Exp; branches; next 1.1; 1.1 date 2001.05.01.20.02.17; author linus; state Exp; branches; next ; desc @init @ 1.5 log @rm msglog @ text @import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.io.FileInputStream; import java.util.ArrayList; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.DocumentBuilder; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.w3c.dom.Document; import org.w3c.dom.DOMException; /** * read a services xml doc in and pick out the necessary bits of info */ public class svcgrp { protected int servicenum; protected ArrayList servicename = new ArrayList(); protected ArrayList serviceport = new ArrayList(); protected ArrayList servicetype = new ArrayList(); protected ArrayList serviceprotocol = new ArrayList(); protected ArrayList serviceexternal = new ArrayList(); String getDataFromNode( org.w3c.dom.Node nod ) { org.w3c.dom.NodeList nodes = nod.getChildNodes(); for ( int i=0; i< nodes.getLength(); i++ ) { org.w3c.dom.Node node = nodes.item(i); int type = node.getNodeType(); String val = node.getNodeValue(); String name = node.getNodeName(); if ( type == 3 ) { if ( val != null ) { return( val ); } } } return( null ); } String getDataFromNode( org.w3c.dom.Node nod, String str ) { org.w3c.dom.NodeList nodes = nod.getChildNodes(); for ( int i=0; i< nodes.getLength(); i++ ) { org.w3c.dom.Node node = nodes.item(i); int type = node.getNodeType(); String val = node.getNodeValue(); String name = node.getNodeName(); // System.out.println( "type: " + type + " nodename: " + name + " value: " + val ); if ( type == 1 && name != null ) { if ( name.equals( str )) { if ( node.hasChildNodes() ) { org.w3c.dom.NodeList nads = node.getChildNodes(); for ( int j = 0; j < nads.getLength(); j++ ) { node = nads.item(j); type = node.getNodeType(); val = node.getNodeValue(); name = node.getNodeName(); if ( type == 3 && val != null ) { return( val ); } } } } } } return( null ); } void recurseNodes( org.w3c.dom.NodeList nodes ) throws IOException { for (int i=0; i