xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zong...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
Date Wed, 13 Nov 2002 17:03:40 GMT
zongaro     2002/11/13 09:03:40

  Modified:    java/src/org/apache/xalan/xsltc/dom Tag: XSLTC_DTM
                        LoadDocument.java
               java/src/org/apache/xalan/xsltc/runtime Tag: XSLTC_DTM
                        BasisLibrary.java
  Log:
  1) Turn off node indexing for XSLTC's DTM objects.  No iterators or traversers
  that XSLTC uses take advantage of it, so it's pure overhead.
  
  2) Renamed getNodeValue method in XSLTC's DOM to getStringValueX - meaning "get
  the string value of a node according to XPath's definition."  The old
  getNodeValue overrode DTM's getNodeValue with slightly different semantics and
  a slightly higher cost in terms of performance.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.10.6 +3 -3      xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java
  
  Index: LoadDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java,v
  retrieving revision 1.11.10.5
  retrieving revision 1.11.10.6
  diff -u -r1.11.10.5 -r1.11.10.6
  --- LoadDocument.java	17 Sep 2002 21:08:56 -0000	1.11.10.5
  +++ LoadDocument.java	13 Nov 2002 17:03:28 -0000	1.11.10.6
  @@ -171,7 +171,7 @@
                                                  .getDOMImpl()).m_mgr;
               newdom = (SAXImpl)dtmManager.getDTM(
                                    new SAXSource(reader, new InputSource(uri)),
  -                                 false, null, true, true);
  +                                 false, null, true, false);
   
               translet.prepassDocument(newdom);
   
  @@ -241,7 +241,7 @@
   		int node;
   
   		while ((node = iterator.next()) != DTM.NULL) {
  -		    String uri = dom.getNodeValue(node);
  +		    String uri = dom.getStringValueX(node);
   		    // Get the URI from this node if no xml URI base is set
   		    if ((xmlURI == null) || xmlURI.equals("")) {
   			xmlURI = dom.getDocumentURI(node);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.35.2.11 +26 -26    xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
  
  Index: BasisLibrary.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
  retrieving revision 1.35.2.10
  retrieving revision 1.35.2.11
  diff -u -r1.35.2.10 -r1.35.2.11
  --- BasisLibrary.java	5 Nov 2002 10:41:47 -0000	1.35.2.10
  +++ BasisLibrary.java	13 Nov 2002 17:03:32 -0000	1.35.2.11
  @@ -135,7 +135,7 @@
   	    double result = 0.0;
   	    int node;
   	    while ((node = iterator.next()) != DTMAxisIterator.END) {
  -		result += Double.parseDouble(dom.getNodeValue(node));
  +		result += Double.parseDouble(dom.getStringValueX(node));
   	    }
   	    return result;
   	}
  @@ -148,7 +148,7 @@
        * XSLT Standard function string()
        */
       public static String stringF(int node, DOM dom) {
  -	return dom.getNodeValue(node);
  +	return dom.getStringValueX(node);
       }
   
       /**
  @@ -156,10 +156,10 @@
        */
       public static String stringF(Object obj, DOM dom) {
   	if (obj instanceof DTMAxisIterator) {
  -	    return dom.getNodeValue(((DTMAxisIterator)obj).reset().next());
  +	    return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
   	}
   	else if (obj instanceof Node) {
  -	    return dom.getNodeValue(((Node)obj).node);
  +	    return dom.getStringValueX(((Node)obj).node);
   	}
   	else if (obj instanceof DOM) {
   	    return ((DOM)obj).getStringValue();
  @@ -174,15 +174,15 @@
        */
       public static String stringF(Object obj, int node, DOM dom) {
   	if (obj instanceof DTMAxisIterator) {
  -	    return dom.getNodeValue(((DTMAxisIterator)obj).reset().next());
  +	    return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
   	}
   	else if (obj instanceof Node) {
  -	    return dom.getNodeValue(((Node)obj).node);
  +	    return dom.getStringValueX(((Node)obj).node);
   	}
   	else if (obj instanceof DOM) {
   	    // When the first argument is a DOM we want the whole fecking
   	    // DOM and not just a single node - that would not make sense.
  -	    //return ((DOM)obj).getNodeValue(node);
  +	    //return ((DOM)obj).getStringValueX(node);
   	    return ((DOM)obj).getStringValue();
   	}
   	else if (obj instanceof Double) {
  @@ -207,7 +207,7 @@
        * XSLT Standard function number()
        */
       public static double numberF(int node, DOM dom) {
  -	return stringToReal(dom.getNodeValue(node));
  +	return stringToReal(dom.getStringValueX(node));
       }
   
       /**
  @@ -228,10 +228,10 @@
   	}
   	else if (obj instanceof DTMAxisIterator) {
   	    DTMAxisIterator iter = (DTMAxisIterator) obj;
  -	    return stringToReal(dom.getNodeValue(iter.reset().next()));
  +	    return stringToReal(dom.getStringValueX(iter.reset().next()));
   	}
   	else if (obj instanceof Node) {
  -	    return stringToReal(dom.getNodeValue(((Node) obj).node));
  +	    return stringToReal(dom.getStringValueX(((Node) obj).node));
   	}
   	else if (obj instanceof DOM) {
   	    return stringToReal(((DOM) obj).getStringValue());
  @@ -379,7 +379,7 @@
        * XSLT Standard function normalize-space(). 
        */
       public static String normalize_spaceF(int node, DOM dom) {
  -	return normalize_spaceF(dom.getNodeValue(node));
  +	return normalize_spaceF(dom.getStringValueX(node));
       }
   
       /**
  @@ -558,12 +558,12 @@
   	left.reset();
   	
   	while ((lnode = left.next()) != DTMAxisIterator.END) {
  -	    final String lvalue = dom.getNodeValue(lnode);
  +	    final String lvalue = dom.getStringValueX(lnode);
   	    
   	    int rnode;
   	    right.reset();
   	    while ((rnode = right.next()) != DTMAxisIterator.END) {
  -		if (compareStrings(lvalue, dom.getNodeValue(rnode), op, dom)) {
  +		if (compareStrings(lvalue, dom.getStringValueX(rnode), op, dom)) {
   		    return true;
   		}
   	    }
  @@ -580,15 +580,15 @@
   
   	switch(op) {
   	case EQ:
  -	    value = dom.getNodeValue(node);
  +	    value = dom.getStringValueX(node);
   	    while ((rnode = iterator.next()) != DTMAxisIterator.END) {
  -		if (value.equals(dom.getNodeValue(rnode))) return true;
  +		if (value.equals(dom.getStringValueX(rnode))) return true;
   	    }
   	    break;
   	case NE:
  -	    value = dom.getNodeValue(node);
  +	    value = dom.getStringValueX(node);
   	    while ((rnode = iterator.next()) != DTMAxisIterator.END) {
  -		if (!value.equals(dom.getNodeValue(rnode))) return true;
  +		if (!value.equals(dom.getStringValueX(rnode))) return true;
   	    }
   	    break;
   	case LT:
  @@ -618,42 +618,42 @@
   	switch (op) {
   	case EQ:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) == rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) == rnumber)
   		    return true;
   	    }
   	    break;
   
   	case NE:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) != rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) != rnumber)
   		    return true;
   	    }
   	    break;
   
   	case GT:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) > rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) > rnumber)
   		    return true;
   	    }
   	    break;
   
   	case LT:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) < rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) < rnumber)
   		    return true;
   	    }
   	    break;
   
   	case GE:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) >= rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) >= rnumber)
   		    return true;
   	    }
   	    break;
   
   	case LE:
   	    while ((node = left.next()) != DTMAxisIterator.END) {
  -		if (numberF(dom.getNodeValue(node), dom) <= rnumber)
  +		if (numberF(dom.getStringValueX(node), dom) <= rnumber)
   		    return true;
   	    }
   	    break;
  @@ -673,7 +673,7 @@
   	int node;
   	//left.reset();
   	while ((node = left.next()) != DTMAxisIterator.END) {
  -	    if (compareStrings(dom.getNodeValue(node), rstring, op, dom)) {
  +	    if (compareStrings(dom.getStringValueX(node), rstring, op, dom)) {
   		return true;
   	    }
   	}
  @@ -1159,7 +1159,7 @@
   	           org.apache.xpath.objects.XMLStringFactoryImpl.getFactory());
   
   	DOMImpl idom = (DOMImpl)dtmManager.getDTM(new DOMSource(doc), false,
  -                                                  null, true, true);
  +                                                  null, true, false);
   
   	if (dom instanceof MultiDOM) {
               final MultiDOM multiDOM = (MultiDOM) dom;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message