mmidy 01/09/20 08:53:43
Modified: java/src/org/apache/xalan/processor StylesheetHandler.java
java/src/org/apache/xalan/templates ElemLiteralResult.java
Log:
Bugzilla 1803: Handle version attribute on a litteral element.
Revision Changes Path
1.45 +23 -3
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- StylesheetHandler.java 2001/08/03 17:06:05 1.44
+++ StylesheetHandler.java 2001/09/20 15:53:43 1.45
@@ -406,9 +406,11 @@
if (null == elemProcessor
&& ((null == getStylesheet()
|| Double.valueOf(getStylesheet().getVersion()).doubleValue()
- > Constants.XSLTVERSUPPORTED) ||
-
(!uri.equals(Constants.S_XSLNAMESPACEURL) &&
- currentProcessor instanceof ProcessorStylesheetElement)))
+ > Constants.XSLTVERSUPPORTED)
+ ||(!uri.equals(Constants.S_XSLNAMESPACEURL) &&
+ currentProcessor instanceof ProcessorStylesheetElement)
+ || getElemVersion() > Constants.XSLTVERSUPPORTED
+ ))
{
elemProcessor = def.getProcessorForUnknown(uri, localName);
}
@@ -1612,6 +1614,24 @@
}
m_spacePreserveStack.push(m_spacePreserveStack.peek());
}
+ }
+
+ private double getElemVersion()
+ {
+ ElemTemplateElement elem = getElemTemplateElement();
+ double version = -1;
+ while ((version == -1 || version == Constants.XSLTVERSUPPORTED) && elem != null)
+ {
+ try{
+ version = Double.valueOf(elem.getVersion()).doubleValue();
+ }
+ catch (Exception ex)
+ {
+ version = -1;
+ }
+ elem = elem.getParentElem();
+ }
+ return (version == -1)? Constants.XSLTVERSUPPORTED : version;
}
}
1.27 +11 -0
xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java
Index: ElemLiteralResult.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ElemLiteralResult.java 2001/06/12 19:15:10 1.26
+++ ElemLiteralResult.java 2001/09/20 15:53:43 1.27
@@ -552,6 +552,17 @@
{
m_version = v;
}
+
+ /**
+ * Get the "version" property.
+ * @see <a href="http://www.w3.org/TR/xslt#forwards">forwards in XSLT
Specification</a>
+ *
+ * @return Version property value
+ */
+ public String getVersion()
+ {
+ return m_version;
+ }
/**
* The "exclude-result-prefixes" property.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]