axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/utils XMLUtils.java
Date Mon, 15 Oct 2001 16:31:28 GMT
dug         01/10/15 09:31:27

  Modified:    java/src/org/apache/axis/utils XMLUtils.java
  Log:
  Remove some evil tabs
  
  Revision  Changes    Path
  1.26      +41 -41    xml-axis/java/src/org/apache/axis/utils/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/XMLUtils.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XMLUtils.java	2001/10/11 21:04:47	1.25
  +++ XMLUtils.java	2001/10/15 16:31:27	1.26
  @@ -194,20 +194,20 @@
       }
   
       public static Document newDocument(InputSource inp) {
  -        try {
  +        try {
               return( dbf.newDocumentBuilder().parse( inp ) );
           }
           catch( Exception e ) {
               e.printStackTrace();
           }
  -        return( null );
  +        return( null );
       }
   
  -    public static Document newDocument(InputStream inp) {
  +    public static Document newDocument(InputStream inp) {
           return XMLUtils.newDocument(new InputSource(inp));
       }
   
  -    public static Document newDocument(String uri) {
  +    public static Document newDocument(String uri) {
           return XMLUtils.newDocument(new InputSource(uri));
       }
   
  @@ -314,27 +314,27 @@
        */
       private static Hashtable getPrefixes(Document d)
       {
  -    	Hashtable result = new Hashtable();
  +        Hashtable result = new Hashtable();
   
  -    	NodeList list = d.getElementsByTagName("*");
  +        NodeList list = d.getElementsByTagName("*");
   
  -    	for (int i=0; i<list.getLength(); i++)
  -    	{
  -    		Element e = (Element)list.item(i);
  -    		NamedNodeMap attrs = e.getAttributes();
  -    		for (int n = 0; n < attrs.getLength(); n++)
  -    		{
  -    		    Attr a = (Attr)attrs.item(n);
  -    		    String name;
  -    		    if ((name = a.getName()).startsWith("xmlns:"))
  -    			{
  -    			// do *not* store nsUri for lookup, as a prefix might be
  -    			//   one-many in the document as a whole
  -    		        result.put(name.substring(6), "");
  -    		    }
  -    		}
  -    	}
  -    	return result;
  +        for (int i=0; i<list.getLength(); i++)
  +        {
  +            Element e = (Element)list.item(i);
  +            NamedNodeMap attrs = e.getAttributes();
  +            for (int n = 0; n < attrs.getLength(); n++)
  +            {
  +                Attr a = (Attr)attrs.item(n);
  +                String name;
  +                if ((name = a.getName()).startsWith("xmlns:"))
  +                    {
  +                    // do *not* store nsUri for lookup, as a prefix might be
  +                    //   one-many in the document as a whole
  +                    result.put(name.substring(6), "");
  +                }
  +            }
  +        }
  +        return result;
       }
   
       /**
  @@ -344,25 +344,25 @@
        */
       public static String getNewPrefix(Document d, String nsUri)
       {
  -    	Hashtable extantPrefixes = getPrefixes(d);
  +        Hashtable extantPrefixes = getPrefixes(d);
  +
  +        // Now try to pick one that isn't extant
  +        String winner = null;
  +        for (int j=0; winner == null; j++)
  +        {
  +                String candidate = "ns" + j;
  +                if (! extantPrefixes.containsKey(candidate))
  +                {
  +                        winner = candidate;
  +                }
  +        }
   
  -    	// Now try to pick one that isn't extant
  -    	String winner = null;
  -    	for (int j=0; winner == null; j++)
  -    	{
  -    		String candidate = "ns" + j;
  -    		if (! extantPrefixes.containsKey(candidate))
  -    		{
  -    			winner = candidate;
  -    		}
  -    	}
  -
  -    	// Install the winner at the top of the document
  -    	d.getDocumentElement().setAttributeNS(
  -    			Constants.NS_URI_XMLNS,
  -    			"xmlns:" + winner,
  -    			nsUri);
  +        // Install the winner at the top of the document
  +        d.getDocumentElement().setAttributeNS(
  +                        Constants.NS_URI_XMLNS,
  +                        "xmlns:" + winner,
  +                        nsUri);
   
  -    	return winner;
  +        return winner;
       }
    }
  
  
  

Mime
View raw message