You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2002/04/15 21:51:22 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom DOMAdapter.java DOMImpl.java MultiDOM.java

santiagopg    02/04/15 12:51:22

  Modified:    java/src/org/apache/xalan/xsltc/dom Tag:
                        jaxp-ri-1_2_0-fcs-branch DOMAdapter.java
                        DOMImpl.java MultiDOM.java
  Log:
  New implementation of xsl:element
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.8.1  +6 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMAdapter.java
  
  Index: DOMAdapter.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMAdapter.java,v
  retrieving revision 1.11
  retrieving revision 1.11.8.1
  diff -u -r1.11 -r1.11.8.1
  --- DOMAdapter.java	26 Nov 2001 14:03:09 -0000	1.11
  +++ DOMAdapter.java	15 Apr 2002 19:51:22 -0000	1.11.8.1
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DOMAdapter.java,v 1.11 2001/11/26 14:03:09 morten Exp $
  + * @(#)$Id: DOMAdapter.java,v 1.11.8.1 2002/04/15 19:51:22 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -278,4 +278,9 @@
   	return(_domImpl.isAttribute(node));
       }
   
  +    public String lookupNamespace(int node, String prefix) 
  +	throws TransletException 
  +    {
  +	return _domImpl.lookupNamespace(node, prefix);
  +    }
   }
  
  
  
  1.66.4.2  +32 -1     xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
  
  Index: DOMImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
  retrieving revision 1.66.4.1
  retrieving revision 1.66.4.2
  diff -u -r1.66.4.1 -r1.66.4.2
  --- DOMImpl.java	3 Apr 2002 19:26:50 -0000	1.66.4.1
  +++ DOMImpl.java	15 Apr 2002 19:51:22 -0000	1.66.4.2
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DOMImpl.java,v 1.66.4.1 2002/04/03 19:26:50 tmiller Exp $
  + * @(#)$Id: DOMImpl.java,v 1.66.4.2 2002/04/15 19:51:22 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -172,6 +172,37 @@
   
       public void setupMapping(String[] names, String[] namespaces) {
   	// This method only has a function in DOM adapters
  +    }
  +
  +    /**
  +     * Lookup a namespace URI from a prefix starting at node. This method 
  +     * is used in the execution of xsl:element when the prefix is not known 
  +     * at compile time.
  +     */
  +    public String lookupNamespace(int node, String prefix) 
  +	throws TransletException 
  +    {
  +	int anode, nsnode;
  +	final AncestorIterator ancestors = new AncestorIterator();
  +	
  +	if (isElement(node)) {
  +	    ancestors.includeSelf();
  +	}
  +
  +	ancestors.setStartNode(node);
  +	while ((anode = ancestors.next()) != NULL) {
  +	    final NodeIterator namespaces = 
  +		new NamespaceIterator().setStartNode(anode);
  +
  +	    while ((nsnode = namespaces.next()) != NULL) {
  +		if (_prefixArray[_prefix[nsnode]].equals(prefix)) {
  +		    return getNodeValue(nsnode);
  +		}
  +	    }
  +	}
  +
  +	// TODO: Internationalization?
  +	throw new TransletException("Namespace prefix '" + prefix + "' is undeclared.");
       }
   
       /**
  
  
  
  1.16.8.1  +6 -1      xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java
  
  Index: MultiDOM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java,v
  retrieving revision 1.16
  retrieving revision 1.16.8.1
  diff -u -r1.16 -r1.16.8.1
  --- MultiDOM.java	4 Dec 2001 10:30:07 -0000	1.16
  +++ MultiDOM.java	15 Apr 2002 19:51:22 -0000	1.16.8.1
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: MultiDOM.java,v 1.16 2001/12/04 10:30:07 morten Exp $
  + * @(#)$Id: MultiDOM.java,v 1.16.8.1 2002/04/15 19:51:22 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -453,4 +453,9 @@
   	return(_adapters[node>>>24].isAttribute(node & CLR));
       }
   
  +    public String lookupNamespace(int node, String prefix) 
  +	throws TransletException
  +    {
  +	return _adapters[node>>>24].lookupNamespace(node, prefix);
  +    }
   }
  
  
  

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