sboag 00/12/27 14:26:25
Modified: java/src/org/apache/xalan/templates AVT.java AVTPart.java
AVTPartXPath.java
Log:
Support for canTraverseOutsideSubtree.
Revision Changes Path
1.12 +34 -6 xml-xalan/java/src/org/apache/xalan/templates/AVT.java
Index: AVT.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVT.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AVT.java 2000/12/05 22:29:21 1.11
+++ AVT.java 2000/12/27 22:26:25 1.12
@@ -72,6 +72,7 @@
import org.apache.xml.utils.PrefixResolver;
import org.apache.xalan.res.XSLMessages;
import org.apache.xalan.processor.StylesheetHandler;
+
import javax.xml.transform.ErrorListener;
/**
@@ -105,7 +106,7 @@
{
return m_rawName;
}
-
+
/**
* Get the raw name of the attribute, with the prefix unprocessed.
*
@@ -130,7 +131,7 @@
{
return m_name;
}
-
+
/**
* Set the local name of the attribute.
*
@@ -155,7 +156,7 @@
{
return m_uri;
}
-
+
/**
* Get the namespace URI of the attribute.
*
@@ -370,10 +371,11 @@
{
handler.warn(XSLTErrorResources.WG_FOUND_CURLYBRACE,
null); //"Found \"}\" but no attribute template open!");
}
- catch(org.xml.sax.SAXException se)
+ catch (org.xml.sax.SAXException se)
{
throw new TransformerException(se);
}
+
buffer.append("}");
// leave the lookahead to be processed by the next round.
@@ -403,10 +405,11 @@
handler.warn(XSLTErrorResources.WG_ATTR_TEMPLATE,
new Object[]{ error }); //"Attr Template,
"+error);
}
- catch(org.xml.sax.SAXException se)
+ catch (org.xml.sax.SAXException se)
{
throw new TransformerException(se);
}
+
break;
}
} // end while(tokenizer.hasMoreTokens())
@@ -480,7 +483,7 @@
/**
* Evaluate the AVT and return a String.
*
- * @param xctxt Te XPathContext to use to evaluate this.
+ * @param xctxt Te XPathContext to use to evaluate this.
* @param context The current source tree context.
* @param nsNode The current namespace context (stylesheet tree context).
* @param NodeList The current Context Node List.
@@ -542,5 +545,30 @@
public boolean isContextInsensitive()
{
return null != m_simpleString;
+ }
+
+ /**
+ * Tell if this expression or it's subexpressions can traverse outside
+ * the current subtree.
+ *
+ * @return true if traversal outside the context node's subtree can occur.
+ */
+ public boolean canTraverseOutsideSubtree()
+ {
+
+ if (null != m_parts)
+ {
+ int n = m_parts.size();
+
+ for (int i = 0; i < n; i++)
+ {
+ AVTPart part = (AVTPart) m_parts.elementAt(i);
+
+ if (part.canTraverseOutsideSubtree())
+ return true;
+ }
+ }
+
+ return false;
}
}
1.9 +12 -0
xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java
Index: AVTPart.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPart.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AVTPart.java 2000/12/05 22:29:22 1.8
+++ AVTPart.java 2000/12/27 22:26:25 1.9
@@ -104,4 +104,16 @@
* @param support XPathContext to set.
*/
public void setXPathSupport(XPathContext support){}
+
+ /**
+ * Tell if this expression or it's subexpressions can traverse outside
+ * the current subtree.
+ *
+ * @return true if traversal outside the context node's subtree can occur.
+ */
+ public boolean canTraverseOutsideSubtree()
+ {
+ return false;
+ }
+
}
1.10 +11 -0
xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java
Index: AVTPartXPath.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/AVTPartXPath.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AVTPartXPath.java 2000/12/13 19:47:20 1.9
+++ AVTPartXPath.java 2000/12/27 22:26:25 1.10
@@ -75,6 +75,17 @@
* Simple string value;
*/
private XPath m_xpath;
+
+ /**
+ * Tell if this expression or it's subexpressions can traverse outside
+ * the current subtree.
+ *
+ * @return true if traversal outside the context node's subtree can occur.
+ */
+ public boolean canTraverseOutsideSubtree()
+ {
+ return m_xpath.getExpression().canTraverseOutsideSubtree();
+ }
/**
* Construct a simple AVT part.