/[classpath]/classpath/gnu/xml/transform/ApplyTemplatesNode.java
ViewVC logotype

Diff of /classpath/gnu/xml/transform/ApplyTemplatesNode.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mark, Sat Jul 2 20:32:16 2005 UTC revision 1.4 by dog, Sat Jul 9 20:38:35 2005 UTC
# Line 41  import java.util.ArrayList; Line 41  import java.util.ArrayList;
41  import java.util.Collection;  import java.util.Collection;
42  import java.util.Collections;  import java.util.Collections;
43  import java.util.Iterator;  import java.util.Iterator;
44    import java.util.LinkedList;
45  import java.util.List;  import java.util.List;
46  import javax.xml.namespace.QName;  import javax.xml.namespace.QName;
47  import javax.xml.transform.TransformerException;  import javax.xml.transform.TransformerException;
# Line 111  final class ApplyTemplatesNode Line 112  final class ApplyTemplatesNode
112        {        {
113          if (withParams != null)          if (withParams != null)
114            {            {
115              // push the parameter context              // compute the parameter values
116              stylesheet.bindings.push(false);              LinkedList values = new LinkedList();
             // set the parameters  
117              for (Iterator i = withParams.iterator(); i.hasNext(); )              for (Iterator i = withParams.iterator(); i.hasNext(); )
118                {                {
119                  WithParam p = (WithParam) i.next();                  WithParam p = (WithParam) i.next();
120                  Object value = p.getValue(stylesheet, mode, context, pos, len);                  Object value = p.getValue(stylesheet, mode, context, pos, len);
121                  stylesheet.bindings.set(p.name, value, false);                  Object[] pair = new Object[2];
122                    pair[0] = p.name;
123                    pair[1] = value;
124                    values.add(pair);
125                  }
126                // push the parameter context
127                stylesheet.bindings.push(Bindings.WITH_PARAM);
128                // set the parameters
129                for (Iterator i = values.iterator(); i.hasNext(); )
130                  {
131                    Object[] pair = (Object[]) i.next();
132                    QName name = (QName) pair[0];
133                    Object value = pair[1];
134                    stylesheet.bindings.set(name, value, Bindings.WITH_PARAM);
135                }                }
136            }            }
137          Collection ns = (Collection) ret;          Collection ns = (Collection) ret;
# Line 154  final class ApplyTemplatesNode Line 167  final class ApplyTemplatesNode
167          if (withParams != null)          if (withParams != null)
168            {            {
169              // pop the variable context              // pop the variable context
170              stylesheet.bindings.pop(false);              stylesheet.bindings.pop(Bindings.WITH_PARAM);
171            }            }
172        }        }
173      // apply-templates doesn't have processable children      // apply-templates doesn't have processable children
# Line 165  final class ApplyTemplatesNode Line 178  final class ApplyTemplatesNode
178                     parent, nextSibling);                     parent, nextSibling);
179        }        }
180    }    }
181    
182      public boolean references(QName var)
183      {
184        if (select != null && select.references(var))
185          {
186            return true;
187          }
188        if (withParams != null)
189          {
190            for (Iterator i = withParams.iterator(); i.hasNext(); )
191              {
192                if (((WithParam) i.next()).references(var))
193                  {
194                    return true;
195                  }
196              }
197          }
198        if (sortKeys != null)
199          {
200            for (Iterator i = sortKeys.iterator(); i.hasNext(); )
201              {
202                if (((SortKey) i.next()).references(var))
203                  {
204                    return true;
205                  }
206              }
207          }
208        return super.references(var);
209      }
210        
211    public String toString()    public String toString()
212    {    {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26