You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@locus.apache.org on 2000/02/24 22:11:13 UTC
cvs commit: xml-xalan/src/org/apache/xalan/xslt AVT.java AVTPart.java AVTPartSimple.java AVTPartXPath.java Arg.java Constants.java Counter.java CountersTable.java DecimalToRoman.java ElemApplyImport.java ElemApplyTemplates.java ElemAttribute.java ElemAttributeSet.java ElemCallTemplate.java ElemChoose.java ElemComment.java ElemCopy.java ElemCopyOf.java ElemDecimalFormat.java ElemElement.java ElemEmpty.java ElemExtensionCall.java ElemFallback.java ElemForEach.java ElemIf.java ElemLiteralResult.java ElemMessage.java ElemNumber.java ElemOtherwise.java ElemPI.java ElemParam.java ElemSort.java ElemTemplate.java ElemTemplateElement.java ElemText.java ElemTextLiteral.java ElemUse.java ElemValueOf.java ElemVariable.java ElemWhen.java ElemWithParam.java Expression.java ExtensionNSHandler.java FuncDocument.java FuncFormatNumb.java KeyTable.java NodeSortKey.java NodeSorter.java NumeratorFormatter.java Process.java ResultTreeFrag.java SerializableAttrListImpl.java Stylesheet.java StylesheetHandler.java StylesheetRoot.java StylesheetSpec.java TemplateList.java XMLSourceInfo.java XSLProcessorException.java XSLProcessorVersion.java XSLTEngineImpl.java XSLTInputSource.java XSLTProcessor.java XSLTProcessorFactory.java XSLTResultTarget.java
dleslie 00/02/24 13:11:12
Modified: src/org/apache/xalan/xslt AVT.java AVTPart.java
AVTPartSimple.java AVTPartXPath.java Arg.java
Constants.java Counter.java CountersTable.java
DecimalToRoman.java ElemApplyImport.java
ElemApplyTemplates.java ElemAttribute.java
ElemAttributeSet.java ElemCallTemplate.java
ElemChoose.java ElemComment.java ElemCopy.java
ElemCopyOf.java ElemDecimalFormat.java
ElemElement.java ElemEmpty.java
ElemExtensionCall.java ElemFallback.java
ElemForEach.java ElemIf.java ElemLiteralResult.java
ElemMessage.java ElemNumber.java ElemOtherwise.java
ElemPI.java ElemParam.java ElemSort.java
ElemTemplate.java ElemTemplateElement.java
ElemText.java ElemTextLiteral.java ElemUse.java
ElemValueOf.java ElemVariable.java ElemWhen.java
ElemWithParam.java Expression.java
ExtensionNSHandler.java FuncDocument.java
FuncFormatNumb.java KeyTable.java NodeSortKey.java
NodeSorter.java NumeratorFormatter.java
Process.java ResultTreeFrag.java
SerializableAttrListImpl.java Stylesheet.java
StylesheetHandler.java StylesheetRoot.java
StylesheetSpec.java TemplateList.java
XMLSourceInfo.java XSLProcessorException.java
XSLProcessorVersion.java XSLTEngineImpl.java
XSLTInputSource.java XSLTProcessor.java
XSLTProcessorFactory.java XSLTResultTarget.java
Log:
javadoc cleanup
Revision Changes Path
1.6 +1 -1 xml-xalan/src/org/apache/xalan/xslt/AVT.java
Index: AVT.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/AVT.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AVT.java 2000/01/14 22:01:13 1.5
+++ AVT.java 2000/02/24 21:10:58 1.6
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/AVTPart.java
Index: AVTPart.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/AVTPart.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AVTPart.java 1999/11/28 04:25:13 1.2
+++ AVTPart.java 2000/02/24 21:10:58 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.2 +1 -1 xml-xalan/src/org/apache/xalan/xslt/AVTPartSimple.java
Index: AVTPartSimple.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/AVTPartSimple.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AVTPartSimple.java 1999/11/08 20:56:14 1.1
+++ AVTPartSimple.java 2000/02/24 21:10:59 1.2
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/AVTPartXPath.java
Index: AVTPartXPath.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/AVTPartXPath.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AVTPartXPath.java 2000/02/13 16:42:44 1.3
+++ AVTPartXPath.java 2000/02/24 21:10:59 1.4
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/Arg.java
Index: Arg.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Arg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Arg.java 2000/02/21 08:14:27 1.2
+++ Arg.java 2000/02/24 21:10:59 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.11 +1 -1 xml-xalan/src/org/apache/xalan/xslt/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Constants.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Constants.java 2000/01/14 16:17:58 1.10
+++ Constants.java 2000/02/24 21:10:59 1.11
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/Counter.java
Index: Counter.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Counter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Counter.java 2000/02/13 16:42:44 1.3
+++ Counter.java 2000/02/24 21:10:59 1.4
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/CountersTable.java
Index: CountersTable.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/CountersTable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CountersTable.java 2000/02/13 16:42:44 1.2
+++ CountersTable.java 2000/02/24 21:10:59 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.2 +1 -1 xml-xalan/src/org/apache/xalan/xslt/DecimalToRoman.java
Index: DecimalToRoman.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/DecimalToRoman.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DecimalToRoman.java 1999/11/08 20:56:16 1.1
+++ DecimalToRoman.java 2000/02/24 21:10:59 1.2
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemApplyImport.java
Index: ElemApplyImport.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemApplyImport.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemApplyImport.java 2000/02/21 08:14:27 1.5
+++ ElemApplyImport.java 2000/02/24 21:10:59 1.6
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.8 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemApplyTemplates.java
Index: ElemApplyTemplates.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemApplyTemplates.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemApplyTemplates.java 2000/02/23 06:07:04 1.7
+++ ElemApplyTemplates.java 2000/02/24 21:10:59 1.8
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.9 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemAttribute.java
Index: ElemAttribute.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemAttribute.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemAttribute.java 2000/02/14 18:04:24 1.8
+++ ElemAttribute.java 2000/02/24 21:10:59 1.9
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.5 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemAttributeSet.java
Index: ElemAttributeSet.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemAttributeSet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemAttributeSet.java 2000/01/05 23:05:30 1.4
+++ ElemAttributeSet.java 2000/02/24 21:10:59 1.5
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.10 +2 -7 xml-xalan/src/org/apache/xalan/xslt/ElemCallTemplate.java
Index: ElemCallTemplate.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemCallTemplate.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemCallTemplate.java 2000/02/24 16:45:07 1.9
+++ ElemCallTemplate.java 2000/02/24 21:10:59 1.10
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
@@ -86,17 +86,12 @@
String aname = atts.getName(i);
if(aname.equals(Constants.ATTRNAME_NAME))
{
- m_templateName = new QName(atts.getValue(i), m_stylesheet.m_namespaces);
+ m_templateName = new QName(atts.getValue(i), m_stylesheet.m_namespaces);
}
else if(!isAttrOK(aname, atts, i))
{
processor.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE,new Object[] {name, aname}); //name+" has an illegal attribute: "+aname);
}
- }
- if (null == m_templateName)
- {
- if(null != processor)
- processor.error(XSLTErrorResources.ER_NO_NAME_ATTRIB, new Object[] {name}); //name+" requires a name attribute.");
}
}
1.7 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemChoose.java
Index: ElemChoose.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemChoose.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElemChoose.java 2000/02/21 08:14:27 1.6
+++ ElemChoose.java 2000/02/24 21:10:59 1.7
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemComment.java
Index: ElemComment.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemComment.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemComment.java 2000/01/05 23:05:30 1.2
+++ ElemComment.java 2000/02/24 21:10:59 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemCopy.java
Index: ElemCopy.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemCopy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemCopy.java 2000/01/05 23:05:30 1.3
+++ ElemCopy.java 2000/02/24 21:10:59 1.4
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.9 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemCopyOf.java
Index: ElemCopyOf.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemCopyOf.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ElemCopyOf.java 2000/02/23 21:09:44 1.8
+++ ElemCopyOf.java 2000/02/24 21:10:59 1.9
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +20 -20 xml-xalan/src/org/apache/xalan/xslt/ElemDecimalFormat.java
Index: ElemDecimalFormat.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemDecimalFormat.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemDecimalFormat.java 2000/02/23 21:41:15 1.5
+++ ElemDecimalFormat.java 2000/02/24 21:10:59 1.6
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
@@ -83,8 +83,8 @@
public String m_zeroDigit_avt = null;
public String m_digit_avt = null;
public String m_patternSeparator_avt = null;
-
+
private XSLTResourceBundle thisBundle;
public int getXSLToken()
@@ -106,7 +106,7 @@
String aname = atts.getName(i);
if(aname.equals(Constants.ATTRNAME_NAME))
{
- m_name_avt = atts.getValue(i);
+ m_name_avt = atts.getValue(i);
}
else if(aname.equals(Constants.ATTRNAME_DECIMALSEPARATOR))
{
@@ -157,33 +157,33 @@
m_infinity_avt = Constants.ATTRVAL_INFINITY;
if (null == m_NaN_avt)
m_NaN_avt = Constants.ATTRVAL_NAN;
-
- // Look for the default decimal-format element
+
+ // Look for the default decimal-format element
if (null == m_name_avt)
- {
- if (null != m_stylesheet.getDecimalFormatElem(Constants.DEFAULT_DECIMAL_FORMAT))
+ {
+ if (null != m_stylesheet.getDecimalFormatElem(Constants.DEFAULT_DECIMAL_FORMAT))
processor.warn(XSLTErrorResources.WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED); //Only one default Decimal format is allowed
- m_name_avt = Constants.DEFAULT_DECIMAL_FORMAT;
+ m_name_avt = Constants.DEFAULT_DECIMAL_FORMAT;
}
// Look for duplicate decimal-format names
else
- {
- if (null != m_stylesheet.getDecimalFormatElem(m_name_avt))
- processor.warn(XSLTErrorResources.WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE); // All declarations have to be unique
- }
+ {
+ if (null != m_stylesheet.getDecimalFormatElem(m_name_avt))
+ processor.warn(XSLTErrorResources.WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE); // All declarations have to be unique
+ }
}
-
+
/*
* Return the name of the decimal format
*/
public String getName()
{
return m_name_avt;
- }
-
+ }
+
/*
* Return the decimal format Symbols for this element
- */
+ */
public DecimalFormatSymbols getDecimalFormatSymbols()
{
DecimalFormatSymbols dfs = new java.text.DecimalFormatSymbols();
@@ -208,8 +208,8 @@
if (m_zeroDigit_avt != null)
dfs.setZeroDigit(m_zeroDigit_avt.charAt(0));
return dfs;
- }
-
+ }
+
/* do I need this??
public void execute(XSLTEngineImpl processor,
Node sourceTree,
@@ -236,6 +236,6 @@
error(XSLTErrorResources.ER_CANNOT_ADD, new Object[] {((ElemTemplateElement)newChild).m_elemName, this.m_elemName}); //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
//" to " + this.m_elemName);
return null;
- }
-
+ }
+
}
1.10 +37 -37 xml-xalan/src/org/apache/xalan/xslt/ElemElement.java
Index: ElemElement.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemElement.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemElement.java 2000/02/24 20:15:11 1.9
+++ ElemElement.java 2000/02/24 21:10:59 1.10
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -75,7 +75,7 @@
public ElemElement (XSLTEngineImpl processor,
Stylesheet stylesheetTree,
- String name,
+ String name,
AttributeList atts,
int lineNumber, int columnNumber)
throws SAXException
@@ -108,20 +108,20 @@
}
}
- public void execute(XSLTEngineImpl processor,
- Node sourceTree,
+ public void execute(XSLTEngineImpl processor,
+ Node sourceTree,
Node sourceNode,
QName mode)
- throws XSLProcessorException,
- java.net.MalformedURLException,
- java.io.FileNotFoundException,
+ throws XSLProcessorException,
+ java.net.MalformedURLException,
+ java.io.FileNotFoundException,
java.io.IOException,
SAXException
- {
+ {
XPathSupport execContext = processor.getXMLProcessorLiaison();
String elemName = m_name_avt.evaluate(execContext, sourceNode, this,
new StringBuffer());
- // make sure that if a prefix is specified on the attribute name, it is valid
+ // make sure that if a prefix is specified on the attribute name, it is valid
int indexOfNSSep = elemName.indexOf(':');
String ns ="" ;
if(indexOfNSSep >= 0)
@@ -132,27 +132,27 @@
ns = getNamespaceForPrefix(nsprefix);
// Check if valid QName. Assuming that if the prefix is defined,
// it is valid.
- if ( indexOfNSSep+1 == elemName.length() ||
+ if ( indexOfNSSep+1 == elemName.length() ||
!isValidNCName(elemName.substring(indexOfNSSep + 1)))
- {
+ {
processor.warn(XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_NAME, new Object[]{elemName});
elemName = null;
- }
+ }
}
- catch(Exception ex)
+ catch(Exception ex)
{
// Could not resolve prefix
ns = null;
- processor.warn(XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{nsprefix});
+ processor.warn(XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{nsprefix});
}
-
+
}
// Check if valid QName
else if (elemName.length() == 0 || !isValidNCName(elemName))
- {
- processor.warn(XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_NAME, new Object[]{elemName});
+ {
+ processor.warn(XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_NAME, new Object[]{elemName});
elemName = null;
- }
+ }
// Only do this if name is valid
if(null != elemName && null != ns)
{
@@ -163,45 +163,45 @@
if(null != elemNameSpace && elemNameSpace.length()>0)
{
if (m_prefix == null)
- {
+ {
String prefix = processor.getResultPrefixForNamespace(elemNameSpace);
if(null == prefix)
{
prefix = "ns"+String.valueOf(processor.m_uniqueNSValue);
processor.m_uniqueNSValue++;
String nsDecl = "xmlns:"+prefix;
- processor.addResultAttribute(
- processor.m_pendingAttributes,
- nsDecl, elemNameSpace);
+ processor.addResultAttribute(
+ processor.m_pendingAttributes,
+ nsDecl, elemNameSpace);
}
m_prefix = prefix;
}
- if(indexOfNSSep >= 0)
+ if(indexOfNSSep >= 0)
elemName = elemName.substring(indexOfNSSep+1);
elemName = (m_prefix + ":"+elemName);
}
}
-
+
processor.m_resultTreeHandler.startElement(elemName);
- }
+ }
// Instantiate content of xsl:element. Note that if startElement was not
// called(ie: if invalid element name, the element's attributes will be
// excluded because processor.m_pendingElementName will be null.
- {
+ {
super.execute(processor, sourceTree, sourceNode, mode);
-
- // Handle namespaces(including those on the ancestor chain
+
+ // Handle namespaces(including those on the ancestor chain
// and stylesheet root declarations).
- processResultNS(processor);
-
- executeChildren(processor, sourceTree,
+ processResultNS(processor);
+
+ executeChildren(processor, sourceTree,
sourceNode, mode);
}
// Now end the element if name was valid
if(null != elemName && null != ns)
- {
+ {
processor.m_resultTreeHandler.endElement(elemName);
}
}
-
+
}
1.2 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemEmpty.java
Index: ElemEmpty.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemEmpty.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElemEmpty.java 1999/11/08 20:56:21 1.1
+++ ElemEmpty.java 2000/02/24 21:10:59 1.2
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.8 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemExtensionCall.java
Index: ElemExtensionCall.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemExtensionCall.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElemExtensionCall.java 2000/02/21 08:14:27 1.7
+++ ElemExtensionCall.java 2000/02/24 21:11:00 1.8
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemFallback.java
Index: ElemFallback.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemFallback.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemFallback.java 2000/01/05 23:05:30 1.2
+++ ElemFallback.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemForEach.java
Index: ElemForEach.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemForEach.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemForEach.java 2000/02/22 02:19:14 1.5
+++ ElemForEach.java 2000/02/24 21:11:00 1.6
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemIf.java
Index: ElemIf.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemIf.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemIf.java 2000/01/05 23:05:30 1.2
+++ ElemIf.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.17 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemLiteralResult.java
Index: ElemLiteralResult.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemLiteralResult.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ElemLiteralResult.java 2000/02/21 08:14:27 1.16
+++ ElemLiteralResult.java 2000/02/24 21:11:00 1.17
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.5 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemMessage.java
Index: ElemMessage.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemMessage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemMessage.java 2000/01/05 23:05:31 1.4
+++ ElemMessage.java 2000/02/24 21:11:00 1.5
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.10 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java
Index: ElemNumber.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ElemNumber.java 2000/02/14 16:35:12 1.9
+++ ElemNumber.java 2000/02/24 21:11:00 1.10
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
-* 4. The names "XSLT4J" and "Apache Software Foundation" must
+* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemOtherwise.java
Index: ElemOtherwise.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemOtherwise.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemOtherwise.java 2000/01/05 23:05:31 1.2
+++ ElemOtherwise.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemPI.java
Index: ElemPI.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemPI.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemPI.java 2000/01/05 23:05:31 1.2
+++ ElemPI.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemParam.java
Index: ElemParam.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemParam.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemParam.java 2000/02/21 08:14:27 1.2
+++ ElemParam.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.5 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemSort.java
Index: ElemSort.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemSort.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemSort.java 2000/02/04 15:59:42 1.4
+++ ElemSort.java 2000/02/24 21:11:00 1.5
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemTemplate.java
Index: ElemTemplate.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemTemplate.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemTemplate.java 2000/01/31 20:52:30 1.5
+++ ElemTemplate.java 2000/02/24 21:11:00 1.6
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.22 +2 -2 xml-xalan/src/org/apache/xalan/xslt/ElemTemplateElement.java
Index: ElemTemplateElement.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemTemplateElement.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ElemTemplateElement.java 2000/02/23 06:07:04 1.21
+++ ElemTemplateElement.java 2000/02/24 21:11:00 1.22
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
@@ -313,7 +313,7 @@
* I'm not sure that it's spending too much time here anyway.
* @param node a probable xsl:xxx element.
* @return Constants.ELEMNAME_XXX token, or -1 if in xsl
- * or the XSLT4J namespace, -2 if not in known namespace.
+ * or the Xalan namespace, -2 if not in known namespace.
*/
final int getAttrTok(String name)
throws XSLProcessorException
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemText.java
Index: ElemText.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemText.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemText.java 2000/01/05 23:05:32 1.2
+++ ElemText.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemTextLiteral.java
Index: ElemTextLiteral.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemTextLiteral.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemTextLiteral.java 2000/01/24 23:06:25 1.3
+++ ElemTextLiteral.java 2000/02/24 21:11:00 1.4
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.2 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemUse.java
Index: ElemUse.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemUse.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElemUse.java 1999/11/08 20:56:28 1.1
+++ ElemUse.java 2000/02/24 21:11:00 1.2
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.5 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemValueOf.java
Index: ElemValueOf.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemValueOf.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemValueOf.java 2000/02/13 16:42:44 1.4
+++ ElemValueOf.java 2000/02/24 21:11:00 1.5
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.5 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemVariable.java
Index: ElemVariable.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemVariable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ElemVariable.java 2000/02/21 08:14:27 1.4
+++ ElemVariable.java 2000/02/24 21:11:00 1.5
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemWhen.java
Index: ElemWhen.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemWhen.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemWhen.java 2000/01/05 23:05:32 1.2
+++ ElemWhen.java 2000/02/24 21:11:00 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemWithParam.java
Index: ElemWithParam.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemWithParam.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemWithParam.java 2000/01/05 23:05:32 1.2
+++ ElemWithParam.java 2000/02/24 21:11:01 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.2 +9 -9 xml-xalan/src/org/apache/xalan/xslt/Expression.java
Index: Expression.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Expression.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Expression.java 1999/11/08 20:56:31 1.1
+++ Expression.java 2000/02/24 21:11:01 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -76,20 +76,20 @@
int m_tokenQueueSize = 0;
/**
- * TokenStack is the queue of used tokens. The current token is the token at the
+ * TokenStack is the queue of used tokens. The current token is the token at the
* end of the m_tokenQueue. The idea is that the queue can be marked and a sequence
* of tokens can be reused.
*/
String[] m_tokenQueue;
-
+
/**
* This holds a map to the m_tokenQueue that tells where the top-level elements are.
* It is used for pattern matching so the m_tokenQueue can be walked backwards.
- * Each element that is a 'target', (right-most top level element name) has
+ * Each element that is a 'target', (right-most top level element name) has
* TARGETEXTRA added to it.
*/
int m_patternMap[];
-
+
/**
* The number of elements in m_patternMap;
*/
1.7 +61 -61 xml-xalan/src/org/apache/xalan/xslt/ExtensionNSHandler.java
Index: ExtensionNSHandler.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ExtensionNSHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExtensionNSHandler.java 2000/02/21 08:14:27 1.6
+++ ExtensionNSHandler.java 2000/02/24 21:11:01 1.7
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -68,14 +68,14 @@
import org.apache.xalan.xpath.XPathProcessorException;
/**
- * Class representing an extension namespace. Provides functions
+ * Represents an extension namespace. Provides functions
* to call into the extension via both element syntax and function
* syntax. Extends XPath's extension function capability to a full
* namespace extension model.
*
* @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
*/
-public class ExtensionNSHandler extends ExtensionFunctionHandler
+public class ExtensionNSHandler extends ExtensionFunctionHandler
{
XSLTEngineImpl xslp; // xsl processor for whom I'm working
Hashtable elements = new Hashtable (); // ext. elements of this namespace
@@ -94,11 +94,11 @@
/**
* Construct a new extension namespace handler for a given extension NS.
* This doesn't do anything - just hang on to the namespace URI.
- *
+ *
* @param xslp handle to the XSL processor that I'm working for
* @param namespaceUri the extension namespace URI that I'm implementing
*/
- public ExtensionNSHandler (XSLTEngineImpl xslp, String namespaceUri)
+ public ExtensionNSHandler (XSLTEngineImpl xslp, String namespaceUri)
{
super (namespaceUri);
this.xslp = xslp;
@@ -108,8 +108,8 @@
/**
* Construct a new extension namespace handler given all the information
- * needed.
- *
+ * needed.
+ *
* @param xslp handle to the XSL processor that I'm working for
* @param namespaceUri the extension namespace URI that I'm implementing
* @param elemNames string containing list of elements of extension NS
@@ -122,7 +122,7 @@
*/
public ExtensionNSHandler (XSLTEngineImpl xslp, String namespaceUri,
String elemNames, String funcNames,
- String lang, String srcURL, String src)
+ String lang, String srcURL, String src)
{
super (namespaceUri, funcNames, lang, srcURL, src);
this.xslp = xslp;
@@ -141,12 +141,12 @@
* @param functions whitespace separated list of function names defined
* by this extension namespace.
*/
- public void setFunctions (String funcNames)
+ public void setFunctions (String funcNames)
{
super.setFunctions (funcNames);
componentDescLoaded = true;
}
-
+
/////////////////////////////////////////////////////////////////////////
/**
@@ -159,11 +159,11 @@
* srcURL is not null, then scriptSrc is ignored.
* @param scriptSrc the actual script code (if any)
*/
- public void setScript (String lang, String srcURL, String scriptSrc)
+ public void setScript (String lang, String srcURL, String scriptSrc)
{
super.setScript (lang, srcURL, scriptSrc);
componentDescLoaded = true;
- }
+ }
/////////////////////////////////////////////////////////////////////////
@@ -173,22 +173,22 @@
* @param elemNames whitespace separated list of element names defined
* by this extension namespace.
*/
- public void setElements (String elemNames)
+ public void setElements (String elemNames)
{
- if (elemNames == null)
+ if (elemNames == null)
{
return;
}
StringTokenizer st = new StringTokenizer (elemNames, " \t\n\r", false);
Object junk = new Object ();
- while (st.hasMoreTokens ())
+ while (st.hasMoreTokens ())
{
String tok = st.nextToken ();
elements.put (tok, junk); // just stick it in there basically
}
componentDescLoaded = true;
}
-
+
/////////////////////////////////////////////////////////////////////////
/**
@@ -198,7 +198,7 @@
*
* @return true if its known, false if not.
*/
- public boolean isElementAvailable (String element)
+ public boolean isElementAvailable (String element)
{
return (elements.get (element) != null);
}
@@ -218,7 +218,7 @@
* it's a Document).
* @param sourceNode The current context node.
*
- * @exception XSLProcessorException thrown if something goes wrong
+ * @exception XSLProcessorException thrown if something goes wrong
* while running the extension handler.
* @exception MalformedURLException if loading trouble
* @exception FileNotFoundException if loading trouble
@@ -226,33 +226,33 @@
* @exception SAXException if parsing trouble
*/
public void processElement (String localPart, Element element,
- XSLTEngineImpl processor,
- Stylesheet stylesheetTree,
+ XSLTEngineImpl processor,
+ Stylesheet stylesheetTree,
Node sourceTree, Node sourceNode, QName mode,
Class classObj, Object methodKey)
- throws XSLProcessorException,
- MalformedURLException,
- FileNotFoundException,
+ throws XSLProcessorException,
+ MalformedURLException,
+ FileNotFoundException,
IOException,
- SAXException
+ SAXException
{
- if (!componentStarted)
+ if (!componentStarted)
{
- try
+ try
{
startupComponent (classObj);
}
- catch (XPathProcessorException e)
+ catch (XPathProcessorException e)
{
// e.printStackTrace ();
throw new XSLProcessorException (e.getMessage (), e);
- }
+ }
}
Object result = null;
- try
+ try
{
- XSLProcessorContext xpc =
+ XSLProcessorContext xpc =
new XSLProcessorContext (processor, stylesheetTree,
sourceTree, sourceNode, mode);
Vector argv = new Vector (2);
@@ -260,13 +260,13 @@
argv.addElement (element);
result = super.callFunction (localPart, argv, methodKey, classObj);
}
- catch (XPathProcessorException e)
+ catch (XPathProcessorException e)
{
// e.printStackTrace ();
throw new XSLProcessorException (e.getMessage (), e);
}
- if (result != null)
+ if (result != null)
{
processor.outputToResultTree (stylesheetTree, result);
}
@@ -275,15 +275,15 @@
/////////////////////////////////////////////////////////////////////////
// Private/Protected Functions
/////////////////////////////////////////////////////////////////////////
-
+
/**
* Start the component up by executing any script that needs to run
* at startup time. This needs to happen before any functions can be
* called on the component.
- *
+ *
* @exception XPathProcessorException if something bad happens.
*/
- protected void startupComponent (Class classObj) throws XPathProcessorException
+ protected void startupComponent (Class classObj) throws XPathProcessorException
{
if(!bsfInitialized)
{
@@ -296,13 +296,13 @@
}
}
- if (!componentDescLoaded)
+ if (!componentDescLoaded)
{
- try
+ try
{
loadComponentDescription ();
}
- catch (Exception e)
+ catch (Exception e)
{
throw new XPathProcessorException (e.getMessage (), e);
}
@@ -315,7 +315,7 @@
/**
* Load the component spec for this extension namespace taking the URI
* of this namespace as the URL to read from.
- *
+ *
* @exception XSLProcessorException if something bad happens.
* @exception MalformedURLException if loading trouble
* @exception FileNotFoundException if loading trouble
@@ -323,17 +323,17 @@
* @exception SAXException if parsing trouble
*/
private void loadComponentDescription ()
- throws XSLProcessorException,
- MalformedURLException,
+ throws XSLProcessorException,
+ MalformedURLException,
FileNotFoundException,
IOException,
- SAXException
+ SAXException
{
// first try treaing the URI of the extension as a fully qualified
// class name; if it works then go with treating this an extension
// implemented in "javaclass" for with that class being the srcURL.
// forget about setting elements and functions in that case - so if
- // u do extension-{element,function}-available then u get false,
+ // u do extension-{element,function}-available then u get false,
// but that's ok.
try {
String cname = namespaceUri.startsWith ("class:") ?
@@ -353,7 +353,7 @@
org.apache.xalan.xpath.xml.XMLParserLiaison liaison = xslp.m_parserLiaison;
if(liaison instanceof org.apache.xalan.xpath.dtm.DTMLiaison)
{
- // There ought to be a better way. At least if we know we
+ // There ought to be a better way. At least if we know we
// have the DTM, we ought to have Xerces.
liaison = new org.apache.xalan.xpath.xdom.XercesLiaison();
liaison.setErrorHandler(new ExtErrorHandler(url.toString()));
@@ -374,7 +374,7 @@
// is there an lxslt:script element child? [NOTE THAT THIS IS NOT
// PROPER NAMESPACE-WISE .. I'll FIX IT LATER. .. Sanjiva 8/20/99.]
NodeList nl = componentElement.getElementsByTagName ("lxslt:script");
- switch (nl.getLength ())
+ switch (nl.getLength ())
{
case 0:
break;
@@ -394,11 +394,11 @@
}
catch(org.xml.sax.SAXException se)
{
-
+
}
catch(java.net.UnknownHostException uhe)
{
-
+
}
*/
}
@@ -410,18 +410,18 @@
* elem and return as a string. Any other types of node children
* are ignored
*
- * @param elem element whose text and cdata children are to be
+ * @param elem element whose text and cdata children are to be
* concatenated together.
*
* @return string resulting from concatanating the text/cdata child
* nodes' values.
*/
- private String getScriptString (Element elem)
+ private String getScriptString (Element elem)
{
StringBuffer strBuf = new StringBuffer();
- for (Node n = elem.getFirstChild (); n != null; n = n.getNextSibling ())
+ for (Node n = elem.getFirstChild (); n != null; n = n.getNextSibling ())
{
- switch (n.getNodeType())
+ switch (n.getNodeType())
{
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
@@ -433,12 +433,12 @@
}
return strBuf.toString();
}
-
-
+
+
/**
* Implement SAX error handler for default reporting.
*/
- class ExtErrorHandler implements ErrorHandler
+ class ExtErrorHandler implements ErrorHandler
{
String m_xmlID = null;
@@ -462,7 +462,7 @@
* SAX parse exception.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
- * @see org.xml.sax.SAXParseException
+ * @see org.xml.sax.SAXParseException
*/
public void warning (SAXParseException exception)
throws SAXException
@@ -491,7 +491,7 @@
* SAX parse exception.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
- * @see org.xml.sax.SAXParseException
+ * @see org.xml.sax.SAXParseException
*/
public void error (SAXParseException exception)
throws SAXException
@@ -514,7 +514,7 @@
* other events once this method has been invoked.</p>
*
* @param exception The error information encapsulated in a
- * SAX parse exception.
+ * SAX parse exception.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
* @see org.xml.sax.SAXParseException
1.11 +1 -1 xml-xalan/src/org/apache/xalan/xslt/FuncDocument.java
Index: FuncDocument.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/FuncDocument.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FuncDocument.java 2000/02/23 08:50:49 1.10
+++ FuncDocument.java 2000/02/24 21:11:01 1.11
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.8 +26 -26 xml-xalan/src/org/apache/xalan/xslt/FuncFormatNumb.java
Index: FuncFormatNumb.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/FuncFormatNumb.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FuncFormatNumb.java 2000/01/05 23:05:32 1.7
+++ FuncFormatNumb.java 2000/02/24 21:11:01 1.8
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -68,7 +68,7 @@
public class FuncFormatNumb extends Function
{
/**
- * Execute the function. The function must return
+ * Execute the function. The function must return
* a valid object.
* @param path The executing xpath.
* @param context The current context.
@@ -76,14 +76,14 @@
* @param args A list of XObject arguments.
* @return A valid XObject.
*/
- public XObject execute(XPath path, XPathSupport execContext,
- Node context, int opPos, Vector args)
+ public XObject execute(XPath path, XPathSupport execContext,
+ Node context, int opPos, Vector args)
throws org.xml.sax.SAXException
{
// A bit of an ugly hack to get our context.
ElemTemplateElement templElem = (ElemTemplateElement)execContext.getNamespaceContext();
Stylesheet ss = templElem.m_stylesheet;
-
+
java.text.DecimalFormat formatter = null;
java.text.DecimalFormatSymbols dfs = null;
double num = ((XObject)args.elementAt(0)).num();
@@ -93,33 +93,33 @@
ss.error(XSLTErrorResources.ER_CURRENCY_SIGN_ILLEGAL); // currency sign not allowed
int nArgs = args.size();
// this third argument is not a locale name. It is the name of a
- // decimal-format declared in the stylesheet!(xsl:decimal-format
+ // decimal-format declared in the stylesheet!(xsl:decimal-format
try
{
if(nArgs == 3)
{
- String formatStr = ((XObject)args.elementAt(2)).str();
- dfs = ss.getDecimalFormatElem(formatStr);
+ String formatStr = ((XObject)args.elementAt(2)).str();
+ dfs = ss.getDecimalFormatElem(formatStr);
if (null == dfs)
- {
- warn(execContext, XSLTErrorResources.WG_NO_DECIMALFORMAT_DECLARATION, new Object[]{formatStr}); //"not found!!!
+ {
+ warn(execContext, XSLTErrorResources.WG_NO_DECIMALFORMAT_DECLARATION, new Object[]{formatStr}); //"not found!!!
//formatter = new java.text.DecimalFormat(patternStr);
- }
+ }
else
- {
+ {
//formatter = new java.text.DecimalFormat(patternStr, dfs);
formatter = new java.text.DecimalFormat();
formatter.setDecimalFormatSymbols(dfs);
formatter.applyLocalizedPattern(patternStr);
- }
-
+ }
+
}
//else
if (null == formatter)
{
// Try for default decimal-format
- dfs = ss.getDecimalFormatElem(Constants.DEFAULT_DECIMAL_FORMAT);
- if (null == dfs)
+ dfs = ss.getDecimalFormatElem(Constants.DEFAULT_DECIMAL_FORMAT);
+ if (null == dfs)
formatter = new java.text.DecimalFormat(patternStr);
else
//formatter = new java.text.DecimalFormat(patternStr, dfs);
@@ -132,11 +132,11 @@
catch(Exception iae)
{
ss.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{patternStr});
- return new XString("");
+ return new XString("");
//throw new XSLProcessorException(iae);
}
}
-
+
/**
* Warn the user of a problem.
* @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
@@ -146,17 +146,17 @@
throws org.xml.sax.SAXException
{
String formattedMsg = XSLMessages.createWarning(msg, args);
-
+
XMLParserLiaison parserLiaison = (XMLParserLiaison)execContext;
boolean shouldThrow = parserLiaison.getProblemListener().problem(ProblemListener.XSLPROCESSOR,
ProblemListener.WARNING,
null, null, formattedMsg,
- null, 0, 0);
-
+ null, 0, 0);
+
if(shouldThrow)
{
throw new XSLProcessorException(formattedMsg);
}
}
-
+
}
1.10 +1 -1 xml-xalan/src/org/apache/xalan/xslt/KeyTable.java
Index: KeyTable.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/KeyTable.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- KeyTable.java 2000/02/22 04:36:09 1.9
+++ KeyTable.java 2000/02/24 21:11:01 1.10
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +15 -16 xml-xalan/src/org/apache/xalan/xslt/NodeSortKey.java
Index: NodeSortKey.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/NodeSortKey.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NodeSortKey.java 2000/01/31 20:52:30 1.5
+++ NodeSortKey.java 2000/02/24 21:11:01 1.6
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -61,39 +61,38 @@
import java.text.Collator;
import org.apache.xalan.xpath.*;
import org.apache.xalan.xslt.res.XSLTErrorResources;
-
+
/**
- * Simple data structure class for use by the
- * NodeSorter class.
+ * Data structure for use by the NodeSorter class.
*/
public class NodeSortKey
{
XPath m_selectPat;
- boolean m_treatAsNumbers;
+ boolean m_treatAsNumbers;
boolean m_descending;
boolean m_caseOrderUpper;
Collator m_col;
Locale m_locale;
org.apache.xalan.xpath.xml.PrefixResolver m_namespaceContext;
XSLTEngineImpl m_processor; // needed for error reporting.
-
- NodeSortKey(XSLTEngineImpl processor, XPath selectPat,
- boolean treatAsNumbers,
+
+ NodeSortKey(XSLTEngineImpl processor, XPath selectPat,
+ boolean treatAsNumbers,
boolean descending, String langValue,
boolean caseOrderUpper,
- org.apache.xalan.xpath.xml.PrefixResolver namespaceContext)
+ org.apache.xalan.xpath.xml.PrefixResolver namespaceContext)
throws org.xml.sax.SAXException
{
m_processor = processor;
m_namespaceContext = namespaceContext;
m_selectPat = selectPat;
- m_treatAsNumbers = treatAsNumbers;
+ m_treatAsNumbers = treatAsNumbers;
m_descending = descending;
m_caseOrderUpper = caseOrderUpper;
if(null != langValue && m_treatAsNumbers == false)
{
- m_locale = new Locale(langValue.toUpperCase(),
+ m_locale = new Locale(langValue.toUpperCase(),
Locale.getDefault().getDisplayCountry());
if(null == m_locale)
{
@@ -105,7 +104,7 @@
{
m_locale = Locale.getDefault();
}
-
+
m_col = Collator.getInstance(m_locale);
if(null == m_col)
{
1.8 +1 -1 xml-xalan/src/org/apache/xalan/xslt/NodeSorter.java
Index: NodeSorter.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/NodeSorter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NodeSorter.java 2000/02/09 21:16:20 1.7
+++ NodeSorter.java 2000/02/24 21:11:01 1.8
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.2 +125 -127 xml-xalan/src/org/apache/xalan/xslt/NumeratorFormatter.java
Index: NumeratorFormatter.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/NumeratorFormatter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NumeratorFormatter.java 1999/11/08 20:56:33 1.1
+++ NumeratorFormatter.java 2000/02/24 21:11:01 1.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -63,10 +63,8 @@
import java.util.*;
/**
- * Class to help in converting enumerated numbers
- * into strings, using the XSL conversion attributes.
- * Having this in a class helps to not have to extract
- * the attributes everytime.
+ * Converts enumerated numbers into strings, using the XSL conversion attributes.
+ * Having this in a class helps avoid being forced to extract the attributes repeatedly.
*/
public class NumeratorFormatter
{
@@ -75,96 +73,96 @@
Locale m_locale;
java.text.NumberFormat m_formatter;
XSLTEngineImpl m_processor;
-
+
/**
* Table to help in converting decimals to roman numerals.
* @see XSLTEngineImpl#DecimalToRoman
* @see XSLTEngineImpl#long2roman
*/
- private final static DecimalToRoman m_romanConvertTable[] =
+ private final static DecimalToRoman m_romanConvertTable[] =
{
- new DecimalToRoman(1000, "M", 900, "CM"),
+ new DecimalToRoman(1000, "M", 900, "CM"),
new DecimalToRoman(500, "D", 400, "CD"),
- new DecimalToRoman(100L, "C", 90L, "XC"),
+ new DecimalToRoman(100L, "C", 90L, "XC"),
new DecimalToRoman(50L, "L", 40L, "XL"),
- new DecimalToRoman(10L, "X", 9L, "IX"),
+ new DecimalToRoman(10L, "X", 9L, "IX"),
new DecimalToRoman(5L, "V", 4L, "IV"),
- new DecimalToRoman(1L, "I", 1L, "I")
+ new DecimalToRoman(1L, "I", 1L, "I")
};
-
+
/**
* Chars for converting integers into alpha counts.
* @see XSLTEngineImpl#int2alphaCount
*/
- private final static char[] m_alphaCountTable =
+ private final static char[] m_alphaCountTable =
{
- 'Z', // z for zero
'A' , 'B' , 'C' , 'D' , 'E' , 'F' ,
- 'G' , 'H' , 'I' , 'J' , 'K' , 'L' ,
- 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' ,
- 'S' , 'T' , 'U' , 'V' , 'W' , 'X' ,
+ 'Z', // z for zero
'A' , 'B' , 'C' , 'D' , 'E' , 'F' ,
+ 'G' , 'H' , 'I' , 'J' , 'K' , 'L' ,
+ 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' ,
+ 'S' , 'T' , 'U' , 'V' , 'W' , 'X' ,
'Y'
};
-
+
/**
- * Construct a NumeratorFormatter using an element
- * that contains XSL number conversion attributes -
- * format, letter-value, xml:lang, digit-group-sep,
+ * Construct a NumeratorFormatter using an element
+ * that contains XSL number conversion attributes -
+ * format, letter-value, xml:lang, digit-group-sep,
* n-digits-per-group, and sequence-src.
*/
NumeratorFormatter(Element xslNumberElement, XSLTEngineImpl processor)
{
m_xslNumberElement = xslNumberElement;
m_processor = processor;
-
+
} // end NumeratorFormatter(Element) constructor
-
+
/**
- * Process the attributes of the node with number formatting
- * attributes. I'd like to
- * do this at construction time, but I have to do it every
- * time because the elements may have attribute templates embedded
- * in them, and so must be processed only when the node is
+ * Process the attributes of the node with number formatting
+ * attributes. I'd like to
+ * do this at construction time, but I have to do it every
+ * time because the elements may have attribute templates embedded
+ * in them, and so must be processed only when the node is
* actually called.
* TODO: Can I just do NumeratorFormatter.processAttributes up front now?
*/
void processAttributes(Node contextNode)
- throws XSLProcessorException,
- java.net.MalformedURLException,
- java.io.FileNotFoundException,
+ throws XSLProcessorException,
+ java.net.MalformedURLException,
+ java.io.FileNotFoundException,
java.io.IOException
{
/*
- // See http://www.w3.org/TR/WD-xsl#convert for the form
- // of the format string, which tells how the numbers should be
+ // See http://www.w3.org/TR/WD-xsl#convert for the form
+ // of the format string, which tells how the numbers should be
// formatted.
- String formatValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- Constants.ATTRNAME_FORMAT,
+ String formatValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ Constants.ATTRNAME_FORMAT,
contextNode);
if(null == formatValue) formatValue = "1";
m_formatTokenizer = new NumberFormatStringTokenizer(formatValue);
- // The letter-value attribute disambiguates between numbering schemes
- // that use letters. A value of "alphabetic" specifies the alphabetic
+ // The letter-value attribute disambiguates between numbering schemes
+ // that use letters. A value of "alphabetic" specifies the alphabetic
// sequence; a value of "other" specifies the other sequence.
// TODO: Handle letter-value attribute.
- String letterValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- Constants.ATTRNAME_LETTERVALUE,
+ String letterValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ Constants.ATTRNAME_LETTERVALUE,
contextNode);
if(null != letterValue)
{
m_processor.warn(null, contextNode, Constants.ATTRNAME_LETTERVALUE+" not supported yet!");
}
-
- // When numbering with an alphabetic sequence, the xml:lang
+
+ // When numbering with an alphabetic sequence, the xml:lang
// attribute specifies which language's alphabet is to be used.
String langValue = m_processor.getAttrVal(m_xslNumberElement, "lang");
if(null != langValue)
{
// Not really sure what to do about the country code, so I use the
- // default from the system.
+ // default from the system.
// TODO: fix xml:lang handling.
- m_locale = new Locale(langValue.toUpperCase(),
+ m_locale = new Locale(langValue.toUpperCase(),
Locale.getDefault().getDisplayCountry());
if(null == m_locale)
{
@@ -176,51 +174,51 @@
{
m_locale = Locale.getDefault();
}
-
+
// Helper to format local specific numbers to strings.
m_formatter = java.text.NumberFormat.getNumberInstance(m_locale);
-
- // The digit-group-sep attribute gives the separator between groups
- // of digits, and the optional n-digits-per-group specifies the
- // number of digits per group. For example, digit-group-sep=","
+
+ // The digit-group-sep attribute gives the separator between groups
+ // of digits, and the optional n-digits-per-group specifies the
+ // number of digits per group. For example, digit-group-sep=","
// and n-digits-per-group="3" would produce numbers of the form 1,000,000.
- String digitGroupSepValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- "grouping-seperator",
+ String digitGroupSepValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ "grouping-seperator",
contextNode);
if(null == digitGroupSepValue)
{
- digitGroupSepValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- Constants.ATTRNAME_DIGITGROUPSEP,
+ digitGroupSepValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ Constants.ATTRNAME_DIGITGROUPSEP,
contextNode);
if(null != digitGroupSepValue)
m_processor.warn("Old syntax: digit-group-sep has been renamed to grouping-seperator");
}
-
- String nDigitsPerGroupValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- "grouping-size",
+
+ String nDigitsPerGroupValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ "grouping-size",
contextNode);
if(null == nDigitsPerGroupValue)
{
- nDigitsPerGroupValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- Constants.ATTRNAME_NDIGITSPERGROUP,
+ nDigitsPerGroupValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ Constants.ATTRNAME_NDIGITSPERGROUP,
contextNode);
if(null != nDigitsPerGroupValue)
m_processor.warn("Old syntax: digit-group-sep has been renamed to grouping-seperator");
}
// int nDigitsPerGroup = Integer.valueOf(nDigitsPerGroupValue).intValue();
-
+
// TODO: Handle digit-group attributes
if((null != digitGroupSepValue) || (null != nDigitsPerGroupValue))
{
m_formatter.setGroupingUsed(true);
}
-
- // The sequence-src attribute gives the URI of a text resource
- // that contains a whitespace separated list of the members of
+
+ // The sequence-src attribute gives the URI of a text resource
+ // that contains a whitespace separated list of the members of
// the numbering sequence.
// (Used with letter-value="other", I think.)
- String sequenceSrcValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
- Constants.ATTRNAME_SEQUENCESRC,
+ String sequenceSrcValue = m_processor.getProcessedAttrVal(m_xslNumberElement,
+ Constants.ATTRNAME_SEQUENCESRC,
contextNode);
if(null != sequenceSrcValue)
{
@@ -229,12 +227,12 @@
}
*/
}
-
+
/**
* Format a vector of numbers into a formatted string.
* @param xslNumberElement Element that takes %conversion-atts; attributes.
* @param list Array of one or more integer numbers.
- * @return String that represents list according to
+ * @return String that represents list according to
* %conversion-atts; attributes.
* TODO: Optimize formatNumberList so that it caches the last count and
* reuses that info for the next count.
@@ -260,7 +258,7 @@
formatToken = lookahead;
lookahead = null;
}
- else
+ else
{
formatToken = m_formatTokenizer.nextToken();
}
@@ -289,8 +287,8 @@
if(!m_formatTokenizer.hasMoreTokens())
{
lastSepString = sepString;
-
- // crufty bit to strip whitespace off of separator
+
+ // crufty bit to strip whitespace off of separator
// if it is the end string.
// This probably isn't right.
int lastPos = sepString.length() - 1;
@@ -304,10 +302,10 @@
}
sepString = sepString.substring(0, k+1);
}
-
+
}
} // end while
-
+
switch(numberType)
{
case 'A':
@@ -333,7 +331,7 @@
formattedNumber += numString;
}
}
-
+
// Check to see if we finished up the format string...
if(null == lastSepString)
{
@@ -349,54 +347,54 @@
{
lastSepString = "";
}
- }
+ }
}
if(null != lastSepString)
{
formattedNumber += lastSepString;
}
-
+
return formattedNumber;
} // end formatNumberList method
/**
- * Convert a long integer into alphabetic counting, in other words
+ * Convert a long integer into alphabetic counting, in other words
* count using the sequence A B C ... Z AA AB AC.... etc.
* @param val Value to convert -- must be greater than zero.
* @param table a table containing one character for each digit in the radix
* @return String representing alpha count of number.
* @see XSLTEngineImpl#DecimalToRoman
- *
+ *
* Note that the radix of the conversion is inferred from the size
* of the table.
*/
protected String int2alphaCount(int val, char [] table)
{
-
+
int radix = table.length;
-
+
// Create a buffer to hold the result
// TODO: size of the table can be detereined by computing
- // logs of the radix. For now, we fake it.
+ // logs of the radix. For now, we fake it.
char buf[] = new char[100];
-
+
// next character to set in the buffer
int charPos = buf.length -1 ; // work backward through buf[]
-
+
// index in table of the last character that we stored
int lookupIndex = 1; // start off with anything other than zero to make correction work
-
+
// Correction number
//
// Correction can take on exactly two values:
//
// 0 if the next character is to be emitted is usual
//
- // radix - 1
+ // radix - 1
// if the next char to be emitted should be one less than
- // you would expect
- //
+ // you would expect
+ //
// For example, consider radix 10, where 1="A" and 10="J"
//
// In this scheme, we count: A, B, C ... H, I, J (not A0 and certainly
@@ -405,42 +403,42 @@
// So, how do we keep from emitting AJ for 10? After correctly emitting the
// J, lookupIndex is zero. We now compute a correction number of 9 (radix-1).
// In the following line, we'll compute (val+correction) % radix, which is,
- // (val+9)/10. By this time, val is 1, so we compute (1+9) % 10, which
+ // (val+9)/10. By this time, val is 1, so we compute (1+9) % 10, which
// is 10 % 10 or zero. So, we'll prepare to emit "JJ", but then we'll
- // later suppress the leading J as representing zero (in the mod system,
+ // later suppress the leading J as representing zero (in the mod system,
// it can represent either 10 or zero). In summary, the correction value of
- // "radix-1" acts like "-1" when run through the mod operator, but with the
+ // "radix-1" acts like "-1" when run through the mod operator, but with the
// desireable characteristic that it never produces a negative number.
-
+
int correction = 0;
-
+
// TODO: throw error on out of range input
-
+
do
{
// most of the correction calculation is explained above, the reason for the
// term after the "|| " is that it correctly propagates carries across
- // multiple columns.
- correction = ((lookupIndex == 0) ||
+ // multiple columns.
+ correction = ((lookupIndex == 0) ||
(correction != 0 && lookupIndex == radix-1 )) ? (radix-1) : 0;
-
+
// index in "table" of the next char to emit
- lookupIndex = (val+correction) % radix;
-
+ lookupIndex = (val+correction) % radix;
+
// shift input by one "column"
val = (val / radix);
-
+
// if the next value we'd put out would be a leading zero, we're done.
if (lookupIndex == 0 && val == 0)
break;
-
+
// put out the next character of output
buf[charPos--] = table[lookupIndex];
}
while (val > 0);
return new String(buf, charPos+1, (buf.length - charPos -1));
- }
+ }
/**
* Convert a long integer into roman numerals.
@@ -462,22 +460,22 @@
int place = 0;
if (val <= 3999L)
{
- do
+ do
{
- while (val >= m_romanConvertTable[place].m_postValue)
+ while (val >= m_romanConvertTable[place].m_postValue)
{
roman += m_romanConvertTable[place].m_postLetter;
val -= m_romanConvertTable[place].m_postValue;
}
- if (prefixesAreOK)
+ if (prefixesAreOK)
{
- if (val >= m_romanConvertTable[place].m_preValue)
+ if (val >= m_romanConvertTable[place].m_preValue)
{
roman += m_romanConvertTable[place].m_preLetter;
val -= m_romanConvertTable[place].m_preValue;
}
- }
- place++;
+ }
+ place++;
}
while (val > 0);
}
@@ -487,10 +485,10 @@
}
return roman;
} // end long2roman
-
+
/**
- * This class returns tokens using non-alphanumberic
- * characters as delimiters.
+ * This class returns tokens using non-alphanumberic
+ * characters as delimiters.
*/
class NumberFormatStringTokenizer
{
@@ -514,21 +512,21 @@
* @exception NoSuchElementException if there are no more tokens in this
* tokenizer's string.
*/
- public String nextToken()
+ public String nextToken()
{
- if (currentPosition >= maxPosition)
+ if (currentPosition >= maxPosition)
{
throw new NoSuchElementException();
}
int start = currentPosition;
- while ((currentPosition < maxPosition) &&
- Character.isLetterOrDigit(str.charAt(currentPosition)))
+ while ((currentPosition < maxPosition) &&
+ Character.isLetterOrDigit(str.charAt(currentPosition)))
{
currentPosition++;
}
if ((start == currentPosition) &&
- (!Character.isLetterOrDigit(str.charAt(currentPosition))))
+ (!Character.isLetterOrDigit(str.charAt(currentPosition))))
{
currentPosition++;
}
@@ -539,41 +537,41 @@
*
* @return true if <code>nextToken</code> can be called
* without throwing an exception.
*/
- public boolean hasMoreTokens()
+ public boolean hasMoreTokens()
{
return (currentPosition >= maxPosition) ? false : true;
}
/**
- * Calculates the number of times that this tokenizer's
- * <code>nextToken</code> method can be called before it generates an
- * exception.
+ * Calculates the number of times that this tokenizer's
+ * <code>nextToken</code> method can be called before it generates an
+ * exception.
*
* @return the number of tokens remaining in the string using the current
* delimiter set.
* @see java.util.StringTokenizer#nextToken()
*/
- public int countTokens()
+ public int countTokens()
{
int count = 0;
int currpos = currentPosition;
- while (currpos < maxPosition)
+ while (currpos < maxPosition)
{
int start = currpos;
- while ((currpos < maxPosition) &&
- Character.isLetterOrDigit(str.charAt(currpos)))
+ while ((currpos < maxPosition) &&
+ Character.isLetterOrDigit(str.charAt(currpos)))
{
currpos++;
}
if ((start == currpos) &&
- (Character.isLetterOrDigit(str.charAt(currpos)) == false))
+ (Character.isLetterOrDigit(str.charAt(currpos)) == false))
{
currpos++;
}
count++;
}
return count;
- }
+ }
} // end NumberFormatStringTokenizer
-
+
}
1.13 +80 -80 xml-xalan/src/org/apache/xalan/xslt/Process.java
Index: Process.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Process.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Process.java 2000/02/23 15:16:17 1.12
+++ Process.java 2000/02/24 21:11:01 1.13
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -75,13 +75,13 @@
// import org.apache.xalan.xpath.xml.xml4j.ProcessXSL;
/**
- * This class handles the command line interface for XSLT4J.
+ * Handles the Xerces command-line interface.
*/
public class Process
{
/**
- * Print argument options.
- */
+ * Prints argument options.
+ */
protected static void printArgOptions(XSLTErrorResources resbundle)
{
System.out.println(resbundle.getString("xslProc_option")); //"xslproc options: ");
@@ -113,44 +113,44 @@
System.out.println("[-MEDIA use media attribute to find stylesheet associated with a document.]"); //" [-PARAM name expression (Set a stylesheet parameter)]");
System.out.println("[-SX (User Xerces Serializers]"); //" [-PARAM name expression (Set a stylesheet parameter)]");
}
-
+
/**
- * Command line interfact to transform the XML according to
- * the instructions found in the XSL document.
+ * Command line interfact to transform the XML according to
+ * the instructions found in the XSL stylesheet.
* <pre>
* -in inputXMLURL
* -xsl XSLTransformationURL
* -out outputFileName
* </pre>
*/
- public static void main( String argv[] )
- {
+ public static void main( String argv[] )
+ {
Runtime.getRuntime().traceMethodCalls(false); // turns tracing off
boolean doStackDumpOnError = false;
boolean setQuietMode = false;
- // Runtime.getRuntime().traceMethodCalls(false);
+ // Runtime.getRuntime().traceMethodCalls(false);
// Runtime.getRuntime().traceInstructions(false);
/**
* The default diagnostic writer...
*/
java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
java.io.PrintWriter dumpWriter = diagnosticsWriter;
-
+
XSLTErrorResources resbundle = (XSLTErrorResources)(XSLMessages.loadResourceBundle(Constants.ERROR_RESOURCES));
-
+
if(argv.length < 1)
{
printArgOptions(resbundle);
}
else
- {
+ {
XMLParserLiaison xmlProcessorLiaison;
String parserLiaisonClassName = Constants.LIAISON_CLASS;
try
{
boolean usingDefault = true;
- for (int i = 0; i < argv.length; i ++)
+ for (int i = 0; i < argv.length; i ++)
{
if("-PARSER".equalsIgnoreCase(argv[i]))
{
@@ -159,11 +159,11 @@
usingDefault = false;
}
}
-
+
Class parserLiaisonClass = Class.forName(parserLiaisonClassName);
-
+
Constructor parserLiaisonCtor = parserLiaisonClass.getConstructor(null);
- xmlProcessorLiaison
+ xmlProcessorLiaison
= (XMLParserLiaison)parserLiaisonCtor.newInstance(null);
}
catch(Exception e)
@@ -171,10 +171,10 @@
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_CREATE_XML_PROC_LIAISON, new Object[] {parserLiaisonClassName})); //"Could not create XML Processor Liaison: "+parserLiaisonClassName);
return;
}
-
+
XSLTProcessor processor = XSLTProcessorFactory.getProcessor(xmlProcessorLiaison);
boolean formatOutput = false;
-
+
QName mode = null;
String inFileName = null;
String outFileName = null;
@@ -190,11 +190,11 @@
boolean useXercesSerializers = false;
PrintTraceListener tracer = null;
FileOutputStream compiledStylesheetOutputStream = null;
- ObjectOutputStream compiledStylesheetOutput = null;
+ ObjectOutputStream compiledStylesheetOutput = null;
String outputType = null;
String media = null;
-
- for (int i = 0; i < argv.length; i ++)
+
+ for (int i = 0; i < argv.length; i ++)
{
if("-TT".equalsIgnoreCase(argv[i]))
{
@@ -227,7 +227,7 @@
else if ("-TCLASS".equalsIgnoreCase(argv[i]))
{
if ( i+1 < argv.length)
- {
+ {
String className=argv[++i];
try
{
@@ -243,17 +243,17 @@
}
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-TCLASS"})); //"Missing argument for);
-
+
}
- else if ("-ESCAPE".equalsIgnoreCase(argv[i]))
+ else if ("-ESCAPE".equalsIgnoreCase(argv[i]))
{
- if ( i+1 < argv.length)
- xmlProcessorLiaison.setSpecialCharacters(argv[++i]);
+ if ( i+1 < argv.length)
+ xmlProcessorLiaison.setSpecialCharacters(argv[++i]);
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-ESCAPE"})); //"Missing argument for);
-
+
}
- else if ("-INDENT".equalsIgnoreCase(argv[i]))
+ else if ("-INDENT".equalsIgnoreCase(argv[i]))
{
int indentAmount;
if(((i+1) < argv.length) && (argv[i+1].charAt(0) != '-'))
@@ -265,39 +265,39 @@
indentAmount = 0;
}
xmlProcessorLiaison.setIndent(indentAmount);
- }
- else if ("-IN".equalsIgnoreCase(argv[i]))
+ }
+ else if ("-IN".equalsIgnoreCase(argv[i]))
{
if ( i+1 < argv.length)
inFileName = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-IN"})); //"Missing argument for);
-
+
}
- else if ("-MEDIA".equalsIgnoreCase(argv[i]))
+ else if ("-MEDIA".equalsIgnoreCase(argv[i]))
{
if ( i+1 < argv.length)
media = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-MEDIA"})); //"Missing argument for);
-
+
}
-
- else if ("-OUT".equalsIgnoreCase(argv[i]))
+
+ else if ("-OUT".equalsIgnoreCase(argv[i]))
{
if ( i+1 < argv.length)
outFileName = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-OUT"})); //"Missing argument for);
-
+
}
- else if ("-XSL".equalsIgnoreCase(argv[i]))
+ else if ("-XSL".equalsIgnoreCase(argv[i]))
{
- if ( i+1 < argv.length)
+ if ( i+1 < argv.length)
xslFileName = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-XSL"})); //"Missing argument for);
-
+
}
else if("-LXCIN".equalsIgnoreCase(argv[i]))
{
@@ -305,7 +305,7 @@
compiledStylesheetFileNameIn = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-LXCIN"})); //"Missing argument for);
-
+
}
else if("-LXCOUT".equalsIgnoreCase(argv[i]))
{
@@ -313,27 +313,27 @@
compiledStylesheetFileNameOut = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-LXCOUT"})); //"Missing argument for);
-
+
}
- else if ("-PARAM".equalsIgnoreCase(argv[i]))
+ else if ("-PARAM".equalsIgnoreCase(argv[i]))
{
if ( i+2 < argv.length)
- {
+ {
String name = argv[++i];
String expression = argv[++i];
processor.setStylesheetParam(name, expression);
}
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-PARAM"})); //"Missing argument for);
-
+
}
- else if ("-treedump".equalsIgnoreCase(argv[i]))
+ else if ("-treedump".equalsIgnoreCase(argv[i]))
{
if ( i+1 < argv.length)
treedumpFileName = argv[++i];
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[] {"-treedump"})); //"Missing argument for);
-
+
}
else if("-F".equalsIgnoreCase(argv[i]))
{
@@ -345,7 +345,7 @@
}
else if("-V".equalsIgnoreCase(argv[i]))
{
- diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> XSLT4J Version "
+ diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version "
+XSLProcessorVersion.S_VERSION+", "+
xmlProcessorLiaison.getParserDescription()+
resbundle.getString("version2"));// "<<<<<<<");
@@ -369,7 +369,7 @@
{
shouldValidate = "yes";
}
-
+
xmlProcessorLiaison.setUseValidation(shouldValidate.equalsIgnoreCase("yes"));
}
else if("-PARSER".equalsIgnoreCase(argv[i]))
@@ -411,29 +411,29 @@
}
else
System.err.println(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_OPTION, new Object[] {argv[i]})); //"Invalid argument:);
-
+
}
-
+
// The main XSL transformation occurs here!
try
{
processor.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter );
// processor.pushTime(processor);
-
+
if(null != dumpFileName)
{
dumpWriter = new PrintWriter( new FileWriter(dumpFileName) );
}
-
+
StylesheetRoot stylesheet = null;
-
+
if(null != compiledStylesheetFileNameIn)
{
try
{
- FileInputStream fileInputStream
+ FileInputStream fileInputStream
= new FileInputStream(compiledStylesheetFileNameIn);
- ObjectInputStream objectInput
+ ObjectInputStream objectInput
= new ObjectInputStream(fileInputStream);
stylesheet = (StylesheetRoot)objectInput.readObject();
objectInput.close();
@@ -449,30 +449,30 @@
{
stylesheet = processor.processStylesheet(xslFileName);
}
-
+
PrintWriter resultWriter;
String mimeEncoding = null;
-
+
OutputStream outputStream = null;
if(null != outFileName)
{
outputStream = new FileOutputStream(outFileName);
// processor.setOutputFileName(outFileName);
}
-
+
if (null == outputStream)
outputStream = System.out;
-
+
if(null != stylesheet)
{
if(null != outputType)
stylesheet.setOutputMethod(outputType);
stylesheet.m_useXercesSerializers = useXercesSerializers;
}
-
+
if(null != tracer)
processor.addTraceListener(tracer);
-
+
if(null != inFileName)
{
if(null != stylesheet)
@@ -486,8 +486,8 @@
media, null);
if(null != spec)
{
- processor.process(new XSLTInputSource(inFileName),
- spec,
+ processor.process(new XSLTInputSource(inFileName),
+ spec,
new XSLTResultTarget(outputStream));
}
else
@@ -497,8 +497,8 @@
}
else
{
- processor.process(new XSLTInputSource(inFileName),
- (XSLTInputSource)null,
+ processor.process(new XSLTInputSource(inFileName),
+ (XSLTInputSource)null,
new XSLTResultTarget(outputStream));
}
}
@@ -518,14 +518,14 @@
{
if(null != compiledStylesheetFileNameOut)
{
- compiledStylesheetOutputStream
+ compiledStylesheetOutputStream
= new FileOutputStream(compiledStylesheetFileNameOut);
- compiledStylesheetOutput
+ compiledStylesheetOutput
= new ObjectOutputStream(compiledStylesheetOutputStream);
-
+
compiledStylesheetOutput.writeObject(stylesheet);
}
- }
+ }
}
catch(TooManyListenersException tmle)
{
@@ -539,8 +539,8 @@
{
if(doStackDumpOnError)
xpe.printStackTrace(dumpWriter);
-
- if((null != xpe.m_styleNode)
+
+ if((null != xpe.m_styleNode)
&& xpe.m_styleNode instanceof ElemTemplateElement)
{
ElemTemplateElement elem = (ElemTemplateElement)xpe.m_styleNode;
@@ -655,7 +655,7 @@
{
}
}
-
+
if(null != dumpFileName)
{
dumpWriter.close();
@@ -665,9 +665,9 @@
// diagnosticsWriter.close();
}
if(!setQuietMode)
- diagnosticsWriter.println(resbundle.getString("xsldone")); //"XSLT4J: done");
+ diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
else
- diagnosticsWriter.println(""); //"XSLT4J: done");
+ diagnosticsWriter.println(""); //"Xalan: done");
}
- }
+ }
}
1.4 +98 -98 xml-xalan/src/org/apache/xalan/xslt/ResultTreeFrag.java
Index: ResultTreeFrag.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ResultTreeFrag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ResultTreeFrag.java 2000/01/13 19:45:27 1.3
+++ ResultTreeFrag.java 2000/02/24 21:11:02 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -64,13 +64,13 @@
import org.apache.xalan.xpath.xml.XSLMessages;
/**
- * The holder of result tree fragments.
+ * Container of a result tree fragment.
*/
public class ResultTreeFrag implements DocumentFragment
{
Document m_docFactory;
MutableNodeList m_children;
- XPathSupport m_xsupport;
+ XPathSupport m_xsupport;
public ResultTreeFrag(Document docFactory, XPathSupport support)
{
@@ -86,7 +86,7 @@
m_docFactory = docFactory;
m_children = children;
}
-
+
/**
* Throw an error.
*/
@@ -94,30 +94,30 @@
{
throw new RuntimeException(XSLMessages.createMessage(msg, null));
}
-
+
/**
* Throw an error.
*/
void error(int msg, Object[]args)
{
- throw new RuntimeException(XSLMessages.createMessage(msg, args));
+ throw new RuntimeException(XSLMessages.createMessage(msg, args));
}
/**
- * The name of this node, depending on its type; see the table above.
+ * The name of this node, depending on its type; see the table above.
*/
- public final String getNodeName()
+ public final String getNodeName()
{
return "#document-fragment";
}
-
+
/**
* The value of this node, depending on its type; see the table above.
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
* @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
+ * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
+ * fit in a <code>DOMString</code> variable on the implementation
* platform.
*/
public String getNodeValue()
@@ -125,54 +125,54 @@
{
return "";
}
-
+
/**
* DocumentFragments never have a nodeValue.
* @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
*/
- public void setNodeValue(String x)
- throws DOMException
+ public void setNodeValue(String x)
+ throws DOMException
{
// No action.
}
-
+
/**
* A code representing the type of the underlying object, as defined above.
*/
- public final short getNodeType()
+ public final short getNodeType()
{
return Node.DOCUMENT_FRAGMENT_NODE;
}
-
+
/**
- * The parent of this node. All nodes, except <code>Document</code>,
- * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent.
- * However, if a node has just been created and not yet added to the tree,
+ * The parent of this node. All nodes, except <code>Document</code>,
+ * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent.
+ * However, if a node has just been created and not yet added to the tree,
* or if it has been removed from the tree, this is <code>null</code>.
*/
public Node getParentNode()
{
return null;
}
-
+
/**
- * A <code>NodeList</code> that contains all children of this node. If there
- * are no children, this is a <code>NodeList</code> containing no nodes.
- * The content of the returned <code>NodeList</code> is "live" in the sense
- * that, for instance, changes to the children of the node object that
- * it was created from are immediately reflected in the nodes returned by
- * the <code>NodeList</code> accessors; it is not a static snapshot of the
- * content of the node. This is true for every <code>NodeList</code>,
- * including the ones returned by the <code>getElementsByTagName</code>
+ * A <code>NodeList</code> that contains all children of this node. If there
+ * are no children, this is a <code>NodeList</code> containing no nodes.
+ * The content of the returned <code>NodeList</code> is "live" in the sense
+ * that, for instance, changes to the children of the node object that
+ * it was created from are immediately reflected in the nodes returned by
+ * the <code>NodeList</code> accessors; it is not a static snapshot of the
+ * content of the node. This is true for every <code>NodeList</code>,
+ * including the ones returned by the <code>getElementsByTagName</code>
* method.
*/
public NodeList getChildNodes()
{
return m_children;
}
-
+
/**
- * The first child of this node. If there is no such node, this returns
+ * The first child of this node. If there is no such node, this returns
* <code>null</code>.
*/
public Node getFirstChild()
@@ -180,9 +180,9 @@
int nChildren = m_children.getLength();
return (nChildren > 0) ? m_children.item(0) : null;
}
-
+
/**
- * The last child of this node. If there is no such node, this returns
+ * The last child of this node. If there is no such node, this returns
* <code>null</code>.
*/
public Node getLastChild()
@@ -190,18 +190,18 @@
int nChildren = m_children.getLength();
return (nChildren > 0) ? m_children.item(nChildren-1) : null;
}
-
+
/**
- * The node immediately preceding this node. If there is no such node, this
+ * The node immediately preceding this node. If there is no such node, this
* returns <code>null</code>.
*/
public Node getPreviousSibling()
{
return null;
}
-
+
/**
- * The node immediately following this node. If there is no such node, this
+ * The node immediately following this node. If there is no such node, this
* returns <code>null</code>.
*/
public Node getNextSibling()
@@ -210,74 +210,74 @@
}
/**
- * A <code>NamedNodeMap</code> containing the attributes of this node (if it
- * is an <code>Element</code>) or <code>null</code> otherwise.
+ * A <code>NamedNodeMap</code> containing the attributes of this node (if it
+ * is an <code>Element</code>) or <code>null</code> otherwise.
*/
public NamedNodeMap getAttributes()
{
return null;
}
-
+
/**
- * The <code>Document</code> object associated with this node. This is also
- * the <code>Document</code> object used to create new nodes. When this
+ * The <code>Document</code> object associated with this node. This is also
+ * the <code>Document</code> object used to create new nodes. When this
* node is a <code>Document</code> this is <code>null</code>.
*/
public Document getOwnerDocument()
{
return m_docFactory;
}
-
+
/**
- * Inserts the node <code>newChild</code> before the existing child node
- * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
+ * Inserts the node <code>newChild</code> before the existing child node
+ * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
* insert <code>newChild</code> at the end of the list of children.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * all of its children are inserted, in the same order, before
- * <code>refChild</code>. If the <code>newChild</code> is already in the
+ * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
+ * all of its children are inserted, in the same order, before
+ * <code>refChild</code>. If the <code>newChild</code> is already in the
* tree, it is first removed.
* @param newChild The node to insert.
- * @param refChild The reference node, i.e., the node before which the new
+ * @param refChild The reference node, i.e., the node before which the new
* node must be inserted.
* @return The node being inserted.
* @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
+ * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+ * allow children of the type of the <code>newChild</code> node, or if
* the node to insert is one of this node's ancestors.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+ * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
* from a different document than the one that created this node.
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
+ * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
* this node.
*/
- public Node insertBefore(Node newChild,
+ public Node insertBefore(Node newChild,
Node refChild)
throws DOMException
{
MutableNodeListImpl mnl = (MutableNodeListImpl)m_children;
- int refIndex = (null == refChild)
+ int refIndex = (null == refChild)
? mnl.getLength() : mnl.indexOf(refChild);
return newChild;
}
-
+
/**
- * Replaces the child node <code>oldChild</code> with <code>newChild</code>
- * in the list of children, and returns the <code>oldChild</code> node. If
+ * Replaces the child node <code>oldChild</code> with <code>newChild</code>
+ * in the list of children, and returns the <code>oldChild</code> node. If
* the <code>newChild</code> is already in the tree, it is first removed.
* @param newChild The new node to put in the child list.
* @param oldChild The node being replaced in the list.
* @return The node replaced.
* @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or it
+ * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+ * allow children of the type of the <code>newChild</code> node, or it
* the node to put in is one of this node's ancestors.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+ * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
* from a different document than the one that created this node.
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
+ * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
* this node.
*/
- public Node replaceChild(Node newChild,
+ public Node replaceChild(Node newChild,
Node oldChild)
throws DOMException
{
@@ -291,7 +291,7 @@
{
// throw exception.
}
- int refIndex = (null == oldChild)
+ int refIndex = (null == oldChild)
? -1 : mnl.indexOf(oldChild);
if(refIndex > -1)
{
@@ -304,15 +304,15 @@
}
return oldChild;
}
-
+
/**
- * Removes the child node indicated by <code>oldChild</code> from the list
+ * Removes the child node indicated by <code>oldChild</code> from the list
* of children, and returns it.
* @param oldChild The node being removed.
* @return The node removed.
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
+ * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
* this node.
*/
public Node removeChild(Node oldChild)
@@ -322,20 +322,20 @@
mnl.removeElement(oldChild);
return oldChild;
}
-
+
/**
- * Adds the node <code>newChild</code> to the end of the list of children of
- * this node. If the <code>newChild</code> is already in the tree, it is
+ * Adds the node <code>newChild</code> to the end of the list of children of
+ * this node. If the <code>newChild</code> is already in the tree, it is
* first removed.
- * @param newChild The node to add.If it is a <code>DocumentFragment</code>
- * object, the entire contents of the document fragment are moved into
+ * @param newChild The node to add.If it is a <code>DocumentFragment</code>
+ * object, the entire contents of the document fragment are moved into
* the child list of this node
* @return The node added.
* @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
+ * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+ * allow children of the type of the <code>newChild</code> node, or if
* the node to append is one of this node's ancestors.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+ * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
* from a different document than the one that created this node.
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
*/
@@ -346,31 +346,31 @@
mnl.addElement(newChild);
return newChild;
}
-
+
/**
- * This is a convenience method to allow easy determination of whether a
+ * This is a convenience method to allow easy determination of whether a
* node has any children.
- * @return <code>true</code> if the node has any children,
+ * @return <code>true</code> if the node has any children,
* <code>false</code> if the node has no children.
*/
public boolean hasChildNodes()
{
return m_children.getLength() > 0;
}
-
+
/**
- * Returns a duplicate of this node, i.e., serves as a generic copy
+ * Returns a duplicate of this node, i.e., serves as a generic copy
* constructor for nodes. The duplicate node has no parent (
* <code>parentNode</code> returns <code>null</code>.).
- * <br>Cloning an <code>Element</code> copies all attributes and their
- * values, including those generated by the XML processor to represent
- * defaulted attributes, but this method does not copy any text it contains
- * unless it is a deep clone, since the text is contained in a child
- * <code>Text</code> node. Cloning any other type of node simply returns a
- * copy of this node.
- * @param deep If <code>true</code>, recursively clone the subtree under the
- * specified node; if <code>false</code>, clone only the node itself (and
- * its attributes, if it is an <code>Element</code>).
+ * <br>Cloning an <code>Element</code> copies all attributes and their
+ * values, including those generated by the XML processor to represent
+ * defaulted attributes, but this method does not copy any text it contains
+ * unless it is a deep clone, since the text is contained in a child
+ * <code>Text</code> node. Cloning any other type of node simply returns a
+ * copy of this node.
+ * @param deep If <code>true</code>, recursively clone the subtree under the
+ * specified node; if <code>false</code>, clone only the node itself (and
+ * its attributes, if it is an <code>Element</code>).
* @return The duplicate node.
*/
public Node cloneNode(boolean deep)
@@ -386,15 +386,15 @@
}
return newFrag;
}
-
+
/** Unimplemented. */
public void normalize()
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"normalize not supported!");
}
-
+
/** Unimplemented. */
- public boolean supports(String feature,
+ public boolean supports(String feature,
String version)
{
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"supports not supported!");
@@ -407,7 +407,7 @@
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNamespaceURI not supported!");
return null;
}
-
+
/** Unimplemented. */
public String getPrefix()
{
@@ -428,5 +428,5 @@
error(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLocalName not supported!");
return null;
}
-
+
}
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/SerializableAttrListImpl.java
Index: SerializableAttrListImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/SerializableAttrListImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SerializableAttrListImpl.java 2000/02/17 13:06:26 1.2
+++ SerializableAttrListImpl.java 2000/02/24 21:11:02 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.31 +232 -232 xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java
Index: Stylesheet.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/Stylesheet.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Stylesheet.java 2000/02/23 08:52:59 1.30
+++ Stylesheet.java 2000/02/24 21:11:02 1.31
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -69,28 +69,28 @@
import org.apache.xalan.xslt.res.XSLTErrorResources;
/**
- * This class represents the base stylesheet or an
- * "import" stylesheet. "include" stylesheets are
+ * Represents the base stylesheet or an
+ * "import" stylesheet; "include" stylesheets are
* combined with the including stylesheet.
- * At the moment these stylesheets can not be reused within the
- * stylesheet tree or between trees. This needs to be fixed
+ * At the moment these stylesheets can not be reused within the
+ * stylesheet tree or between trees. This needs to be fixed
* in the future.
*/
-public class Stylesheet extends UnImplNode
+public class Stylesheet extends UnImplNode
implements java.io.Serializable, Document, PrefixResolver
-{
+{
/**
- * The full XSLT Namespace URL. To be replaced by the one actually
+ * The full XSLT Namespace URL. To be replaced by the one actually
* found.
*/
String m_XSLNameSpaceURL = "http://www.w3.org/1999/XSL/Transform";
-
+
/**
* A vector of the -imported- XSL Stylesheets.
* @serial
*/
Vector m_imports = new Vector();
-
+
/**
* Get vector of the -imported- XSL Stylesheets.
*/
@@ -112,7 +112,7 @@
* @serial
*/
private Vector m_attributeSets = null;
-
+
/**
* Set table of attribute sets, keyed by set name.
*/
@@ -134,7 +134,7 @@
* @serial
*/
String m_baseIdent = null;
-
+
/**
* Get the base identifier with which this stylesheet is associated.
*/
@@ -142,7 +142,7 @@
{
return m_baseIdent;
}
-
+
/**
* Get the base identifier with which this stylesheet is associated.
*/
@@ -150,28 +150,28 @@
{
m_baseIdent = baseIdent;
}
-
+
/**
* Tells if the stylesheet tables need to be rebuilt.
* @serial
*/
boolean m_tablesAreInvalid = true;
-
+
/**
* A dummy value for use in hash tables that have no use for the value.
* @serial
*/
static Boolean dummyVal = new Boolean(true);
-
+
/**
- * The root of the stylesheet, where all the tables common
+ * The root of the stylesheet, where all the tables common
* to all stylesheets are kept.
* @serial
*/
public StylesheetRoot m_stylesheetRoot;
-
+
/**
- * Get the root of the stylesheet, where all the tables common
+ * Get the root of the stylesheet, where all the tables common
* to all stylesheets are kept.
*/
public StylesheetRoot getStylesheetRoot()
@@ -180,23 +180,23 @@
}
/**
- * Set the root of the stylesheet, where all the tables common
+ * Set the root of the stylesheet, where all the tables common
* to all stylesheets are kept.
*/
public void setStylesheetRoot(StylesheetRoot v)
{
m_stylesheetRoot = v;
}
-
+
/**
- * The parent of the stylesheet. This will be null if this
+ * The parent of the stylesheet. This will be null if this
* is the root stylesheet.
* @serial
*/
public Stylesheet m_stylesheetParent;
-
+
/**
- * Get the parent of the stylesheet. This will be null if this
+ * Get the parent of the stylesheet. This will be null if this
* is the root stylesheet.
*/
public Stylesheet getStylesheetParent()
@@ -205,7 +205,7 @@
}
/**
- * Set the parent of the stylesheet. This should be null if this
+ * Set the parent of the stylesheet. This should be null if this
* is the root stylesheet.
*/
public void setStylesheetParent(Stylesheet v)
@@ -218,12 +218,12 @@
* @serial
*/
Hashtable m_extensionNamespaces = new Hashtable();
-
+
/**
* The list of templates, and findTemplate support.
- */
+ */
private TemplateList m_templateList;
-
+
/**
* Get the list of templates.
*/
@@ -241,21 +241,21 @@
}
/**
- * A stack of who's including who is needed in order to support
- * "It is an error if a stylesheet directly or indirectly
+ * A stack of who's including who is needed in order to support
+ * "It is an error if a stylesheet directly or indirectly
* includes itself."
* @serial
*/
transient Stack m_includeStack;
-
- /**
+
+ /**
* Tell if this stylesheet has the default space handling
* turned off or on according to the xml:space attribute.
* @serial
*/
boolean m_defaultSpace = true;
-
- /**
+
+ /**
* Get if this stylesheet has the default space handling
* turned off or on according to the xml:space attribute.
*/
@@ -264,7 +264,7 @@
return m_defaultSpace;
}
- /**
+ /**
* Set if this stylesheet has the default space handling
* turned off or on according to the xml:space attribute.
*/
@@ -278,7 +278,7 @@
* @serial
*/
Vector m_whitespacePreservingElements = null;
-
+
/**
* Get lookup table of all space preserving elements.
*/
@@ -300,7 +300,7 @@
* @serial
*/
Vector m_whitespaceStrippingElements = null;
-
+
/**
* Set lookup table of all space stripping elements.
*/
@@ -321,7 +321,7 @@
* A lookup table of exclude-result-prefixes.
*/
StringToStringTable m_excludeResultPrefixes = null;
-
+
/**
* Set lookup table of exclude-result-prefixes.
*/
@@ -337,12 +337,12 @@
{
m_excludeResultPrefixes = v;
}
-
+
/**
- * Process the exclude-result-prefixes attribute or xsl:exclude-result-prefixes
+ * Process the exclude-result-prefixes attribute or xsl:exclude-result-prefixes
* attribute.
*/
- StringToStringTable processExcludeResultPrefixes(String val,
+ StringToStringTable processExcludeResultPrefixes(String val,
StringToStringTable excludeResultPrefixes)
throws SAXException
{
@@ -351,7 +351,7 @@
excludeResultPrefixes = new StringToStringTable();
}
StringTokenizer tokenizer = new StringTokenizer(val, " \t\n\r", false);
- while(tokenizer.hasMoreTokens ())
+ while(tokenizer.hasMoreTokens ())
{
String prefix = tokenizer.nextToken ();
if(prefix.equalsIgnoreCase("#default"))
@@ -360,7 +360,7 @@
if(null == ns)
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX, new Object[]{prefix}));
excludeResultPrefixes.put(prefix, ns);
- }
+ }
return excludeResultPrefixes;
}
@@ -369,7 +369,7 @@
* @serial
*/
Vector m_topLevelVariables = new Vector();
-
+
/**
* Get table for defined constants, keyed on the names.
*/
@@ -392,35 +392,35 @@
*/
transient Stack m_namespaces = new Stack();
- /**
+ /**
* The start of a linked list of namespace declarations,
* for mapping from prefix to namespace URI.
* @serial
*/
NameSpace m_namespaceDecls = null;
-
+
/* A table of aliases, where the key is the stylesheet uri and the
* value is the result uri
*/
- public StringToStringTable m_prefix_aliases = null;
+ public StringToStringTable m_prefix_aliases = null;
/**
- * This is pushed on the m_resultNameSpaces stack 'till a
+ * This is pushed on the m_resultNameSpaces stack 'till a
* xmlns attribute is found.
* @serial
*/
- final org.apache.xalan.xpath.xml.NameSpace m_emptyNamespace
+ final org.apache.xalan.xpath.xml.NameSpace m_emptyNamespace
= new org.apache.xalan.xpath.xml.NameSpace(null, null);
-
+
/**
- * Table of KeyDeclaration objects, which are set by the
+ * Table of KeyDeclaration objects, which are set by the
* xsl:key element.
* @serial
*/
Vector m_keyDeclarations = new Vector();
/**
- * Get table of KeyDeclaration objects, which are set by the
+ * Get table of KeyDeclaration objects, which are set by the
* xsl:key element.
*/
public Vector getKeyDeclarations()
@@ -429,25 +429,25 @@
}
/**
- * Set table of KeyDeclaration objects, which are set by the
+ * Set table of KeyDeclaration objects, which are set by the
* xsl:key element.
*/
public void setKeyDeclarations(Vector v)
{
m_keyDeclarations = v;
}
-
+
/**
* This is set to true if an xsl:key directive is found.
- * Mainly for use by the XMLParserLiaison classes for
+ * Mainly for use by the XMLParserLiaison classes for
* optimized processing of ids.
* @serial
*/
boolean m_needToBuildKeysTable = false;
-
+
/**
* Get if an xsl:key directive is found.
- * Mainly for use by the XMLParserLiaison classes for
+ * Mainly for use by the XMLParserLiaison classes for
* optimized processing of ids.
*/
public boolean getNeedToBuildKeysTable()
@@ -457,7 +457,7 @@
/**
* Set if an xsl:key directive is found.
- * Mainly for use by the XMLParserLiaison classes for
+ * Mainly for use by the XMLParserLiaison classes for
* optimized processing of ids.
*/
public void setNeedToBuildKeysTable(boolean v)
@@ -469,9 +469,9 @@
* Extension to be used when serializing to disk.
*/
public static final String STYLESHEET_EXT = ".lxc";
-
+
/**
- * The default template to use for xsl:apply-templates when
+ * The default template to use for xsl:apply-templates when
* a select attribute is not found.
*/
XPath m_defaultATXpath = null;
@@ -486,7 +486,7 @@
* @see ElemDecimalFormat.
*/
Stack m_DecimalFormatDeclarations = new Stack();
-
+
/**
* Get table of tables of element decimal-format.
* @see ElemDecimalFormat.
@@ -504,7 +504,7 @@
{
m_DecimalFormatDeclarations = v;
}
-
+
/**
* Read the stylesheet from a serialization stream.
*/
@@ -531,18 +531,18 @@
stream.defaultWriteObject();
// System.out.println("Done writing Stylesheet");
}
+
-
/**
* Constructor for a Stylesheet needs a Document.
- * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
+ * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
- public Stylesheet(StylesheetRoot root,
- XSLTEngineImpl processor,
+ public Stylesheet(StylesheetRoot root,
+ XSLTEngineImpl processor,
String baseIdentifier)
- throws XSLProcessorException,
- MalformedURLException,
+ throws XSLProcessorException,
+ MalformedURLException,
FileNotFoundException,
IOException,
SAXException
@@ -551,7 +551,7 @@
m_baseIdent = baseIdentifier;
init(processor);
}
-
+
/**
* Tell if this is the root of the stylesheet tree.
*/
@@ -559,13 +559,13 @@
{
return false;
}
-
+
/**
* Do common initialization.
*/
protected void init(XSLTEngineImpl processor)
- throws XSLProcessorException,
- MalformedURLException,
+ throws XSLProcessorException,
+ MalformedURLException,
FileNotFoundException,
IOException,
SAXException
@@ -575,12 +575,12 @@
m_includeStack.push(processor.m_parserLiaison.getURLFromString(this.m_baseIdent, null));
initXPath(processor, null);
}
-
+
/**
- * This recursive function is called starting from the
- * stylesheet root, and tries to find a match for the
- * passed stylesheet, and then will return the previous
- * sibling, or, it will return which if it found the stylesheet
+ * This recursive function is called starting from the
+ * stylesheet root, and tries to find a match for the
+ * passed stylesheet, and then will return the previous
+ * sibling, or, it will return which if it found the stylesheet
* but there was no previous sibling.
*/
Stylesheet getPreviousImport(Stylesheet which)
@@ -600,20 +600,20 @@
}
return prev;
}
-
+
/**
* Process the xsl:decimal-format element.
*/
- void processDecimalFormatElement(ElemTemplateElement edf, AttributeList atts)
+ void processDecimalFormatElement(ElemTemplateElement edf, AttributeList atts)
{
- m_DecimalFormatDeclarations.push(edf);
+ m_DecimalFormatDeclarations.push(edf);
}
-
+
/**
* Process the xsl:namespace-alias element.
*/
- void processNSAliasElement(String name, AttributeList atts)
- {
+ void processNSAliasElement(String name, AttributeList atts)
+ {
int nAttrs = atts.getLength();
String ns = null;
String ns2 = null;
@@ -624,13 +624,13 @@
if(aname.equals(Constants.ATTRNAME_STYLESHEET_PREFIX))
{
prefix = atts.getValue(i).equals(Constants.ATTRVAL_DEFAULT_PREFIX)? "" : atts.getValue(i);
- ns = getNamespaceForPrefix(prefix);
+ ns = getNamespaceForPrefix(prefix);
}
else if(aname.equals(Constants.ATTRNAME_RESULT_PREFIX))
{
prefix = atts.getValue(i).equals(Constants.ATTRVAL_DEFAULT_PREFIX)? "" : atts.getValue(i);
- ns2 = getNamespaceForPrefix(prefix);
- }
+ ns2 = getNamespaceForPrefix(prefix);
+ }
else if(!isAttrOK(aname, atts, i))
{
error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE, new Object[] {name, aname}); //name+" has an illegal attribute: "+aname);
@@ -642,18 +642,18 @@
{
if (null == m_prefix_aliases)
m_prefix_aliases = new StringToStringTable();
- m_prefix_aliases.put(ns, ns2);
+ m_prefix_aliases.put(ns, ns2);
}
- else
- error(XSLTErrorResources.ER_MISSING_NS_URI);
+ else
+ error(XSLTErrorResources.ER_MISSING_NS_URI);
}
-
+
/**
* Return the alias namespace uri for a given namespace uri if one is found.
*
* @param uri the URI of the namespace.
*/
- public String lookForAlias (String uri)
+ public String lookForAlias (String uri)
{
String s = null;
if (null != m_prefix_aliases)
@@ -679,23 +679,23 @@
}
}
}
- // If no alias was found, return the original uri
- return s == null ? uri : s;
+ // If no alias was found, return the original uri
+ return s == null ? uri : s;
}
-
+
/**
* Process the xsl:key element.
- *
+ *
* (Notes to myself)
* What we need to do is:
* 1) As this function is called, build a table of KeyDeclarations.
- * 2) During either XML processing, or upon request, walk the XML
+ * 2) During either XML processing, or upon request, walk the XML
* document tree, and build a hash table:
* a) keyed by name,
- * b) each with a value of a hashtable, keyed by the value returned by
+ * b) each with a value of a hashtable, keyed by the value returned by
* the use attribute,
* c) each with a value that is a nodelist.
- * Thus, for a given key or keyref, look up hashtable by name,
+ * Thus, for a given key or keyref, look up hashtable by name,
* look up the nodelist by the given reference.
*/
void processKeyElement(ElemTemplateElement nsContext, AttributeList atts)
@@ -704,7 +704,7 @@
String nameAttr = null;
XPath matchAttr = null;
XPath useAttr = null;
-
+
int nAttrs = atts.getLength();
for(int i = 0; i < nAttrs; i++)
{
@@ -738,10 +738,10 @@
m_keyDeclarations.addElement(new KeyDeclaration(nameAttr, matchAttr, useAttr));
m_needToBuildKeysTable = true;
}
-
-
+
+
/**
- * Push the namespace declarations from the current attribute
+ * Push the namespace declarations from the current attribute
* list onto the namespace stack.
*/
void pushNamespaces(AttributeList atts)
@@ -753,7 +753,7 @@
String aname = atts.getName(i);
String value = atts.getValue(i);
boolean isPrefix = aname.startsWith("xmlns:");
- if (isPrefix || aname.equals("xmlns"))
+ if (isPrefix || aname.equals("xmlns"))
{
String p = isPrefix ? aname.substring(6) : "";
NameSpace ns = new NameSpace(p, value);
@@ -770,24 +770,24 @@
}
m_namespaces.push(nslist);
}
-
+
void popNamespaces()
{
m_namespaces.pop();
}
-
- /**
+
+ /**
* See if this is a xmlns attribute or in a non-XSLT namespace.
- *
+ *
* @param attrName Qualified name of attribute.
- * @param atts The attribute list where the element comes from (not used at
+ * @param atts The attribute list where the element comes from (not used at
* this time).
* @param which The index into the attribute list (not used at this time).
* @return True if this attribute should not be flagged as an error.
*/
boolean isAttrOK(String attrName, AttributeList atts, int which)
{
- boolean isAttrOK = attrName.equals("xmlns") ||
+ boolean isAttrOK = attrName.equals("xmlns") ||
attrName.startsWith("xmlns:");
if(!isAttrOK)
{
@@ -802,12 +802,12 @@
{
isAttrOK = true; // default namespace, flag it as OK
}
- }
-
+ }
+
// TODO: Well, process it...
return isAttrOK;
}
-
+
/**
* Get the namespace from a qualified name.
*/
@@ -817,7 +817,7 @@
String prefix = (indexOfNSSep >= 0) ? nodeName.substring(0, indexOfNSSep) : "";
return getNamespaceForPrefixFromStack(prefix);
}
-
+
/**
* Given a namespace, get the corrisponding prefix.
@@ -837,7 +837,7 @@
return null;
}
}
-
+
/**
* Get the namespace from a prefix.
*/
@@ -863,7 +863,7 @@
}
return namespace;
}
-
+
/**
* Get the namespace from a prefix. Returns null if not found.
*/
@@ -898,7 +898,7 @@
}
return namespace;
}
-
+
/**
* Process an attribute that has the value of 'yes' or 'no'.
*/
@@ -918,9 +918,9 @@
throw new XSLProcessorException(val+" is unknown value for "+aname);
}
}
-
+
/**
- * Set a top level variable, to be serialized with the rest of
+ * Set a top level variable, to be serialized with the rest of
* the stylesheet.
* @param var A top-level variable declared with xsl:variable or xsl:param-variable.
*/
@@ -928,7 +928,7 @@
{
m_topLevelVariables.addElement(var);
}
-
+
/**
* Push top-level variables onto the variable stack.
*/
@@ -961,7 +961,7 @@
if(null != a.m_expression)
{
XPath selectPattern = createXPath(a.m_expression, this);
- a.m_val = selectPattern.execute(transformContext.getExecContext(),
+ a.m_val = selectPattern.execute(transformContext.getExecContext(),
transformContext.m_rootDoc, this);
a.m_expression = null;
}
@@ -981,36 +981,36 @@
// Turn it into a runtime exception.
throw new XSLProcessorException(e);
}
-
+
}
-
-
+
+
/**
- * Given a target element, find the template that best
- * matches in the given XSL document, according
- * to the rules specified in the xsl draft.
+ * Given a target element, find the template that best
+ * matches in the given XSL document, according
+ * to the rules specified in the xsl draft.
* @param stylesheetTree Where the XSL rules are to be found.
* @param sourceTree Where the targetElem is to be found.
* @param targetElem The element that needs a rule.
* @return Rule that best matches targetElem.
- * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
+ * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
ElemTemplate findTemplate(XSLTEngineImpl transformContext,
- Node sourceTree,
+ Node sourceTree,
Node targetNode)
- throws SAXException,
- java.net.MalformedURLException,
- java.io.FileNotFoundException,
+ throws SAXException,
+ java.net.MalformedURLException,
+ java.io.FileNotFoundException,
java.io.IOException
{
return getTemplateList().findTemplate(transformContext, sourceTree, targetNode, null, false);
}
/**
- * Given a target element, find the template that best
- * matches in the given XSL document, according
- * to the rules specified in the xsl draft.
+ * Given a target element, find the template that best
+ * matches in the given XSL document, according
+ * to the rules specified in the xsl draft.
* @param stylesheetTree Where the XSL rules are to be found.
* @param sourceTree Where the targetElem is to be found.
* @param targetElem The element that needs a rule.
@@ -1019,24 +1019,24 @@
* @param foundStylesheet If non-null, the Stylesheet that the found template
* belongs to will be returned in the foundStylesheet[0].
* @return Rule that best matches targetElem.
- * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
+ * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
public ElemTemplate findTemplate(XSLTEngineImpl transformContext,
- Node sourceTree,
- Node targetNode,
+ Node sourceTree,
+ Node targetNode,
QName mode,
boolean useImports)
throws SAXException
{
return getTemplateList().findTemplate(transformContext,
- sourceTree, targetNode,
+ sourceTree, targetNode,
mode, useImports);
}
-
+
/**
* Locate a macro via the "name" attribute.
- * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
+ * @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
ElemTemplateElement findNamedTemplate(QName qname)
@@ -1044,7 +1044,7 @@
{
return getTemplateList().findNamedTemplate(qname);
}
-
+
/**
* Add an attribute set to the list.
*/
@@ -1056,22 +1056,22 @@
}
m_attributeSets.addElement(attrSet);
}
-
+
/**
* Add the attributes from the named attribute sets to the attribute list.
- * TODO: Error handling for: "It is an error if there are two attribute sets
- * with the same expanded-name and with equal import precedence and that both
- * contain the same attribute unless there is a definition of the attribute
+ * TODO: Error handling for: "It is an error if there are two attribute sets
+ * with the same expanded-name and with equal import precedence and that both
+ * contain the same attribute unless there is a definition of the attribute
* set with higher import precedence that also contains the attribute."
*/
- void applyAttrSets(QName attributeSetsNames[],
- XSLTEngineImpl processor,
- Node sourceTree,
+ void applyAttrSets(QName attributeSetsNames[],
+ XSLTEngineImpl processor,
+ Node sourceTree,
Node sourceNode,
QName mode)
- throws XSLProcessorException,
- java.net.MalformedURLException,
- java.io.FileNotFoundException,
+ throws XSLProcessorException,
+ java.net.MalformedURLException,
+ java.io.FileNotFoundException,
java.io.IOException,
SAXException
{
@@ -1082,7 +1082,7 @@
for(int i = 0; i < nImports; i++)
{
Stylesheet stylesheet = (Stylesheet)m_imports.elementAt(i);
- stylesheet.applyAttrSets(attributeSetsNames,
+ stylesheet.applyAttrSets(attributeSetsNames,
processor, sourceTree, sourceNode, mode);
}
int nNames = attributeSetsNames.length;
@@ -1103,12 +1103,12 @@
}
}
}
- }
-
+ }
+
/**
* Given a valid element key, return the corresponding node list.
*/
- public NodeList getNodeSetByKey(XSLTEngineImpl tcontext, Node doc, String name,
+ public NodeList getNodeSetByKey(XSLTEngineImpl tcontext, Node doc, String name,
String ref, PrefixResolver nscontext)
throws org.xml.sax.SAXException
{
@@ -1127,13 +1127,13 @@
{
KeyTable kt = (KeyTable)tcontext.m_key_tables.elementAt(i);
if(doc == kt.m_docKey)
- {
+ {
nl = kt.getNodeSetByKey(name, ref);
if (nl != null && nl.getLength() > 0)
- {
+ {
foundDoc = true;
break;
- }
+ }
}
}
}
@@ -1145,14 +1145,14 @@
if(doc == kt.m_docKey)
{
foundDoc = true;
- nl = kt.getNodeSetByKey(name, ref);
+ nl = kt.getNodeSetByKey(name, ref);
}
}
}
-
- // If the nodelist is null at this point, it should
- // mean there wasn't an xsl:key declared with the
- // given name. So go up the import heiarchy and
+
+ // If the nodelist is null at this point, it should
+ // mean there wasn't an xsl:key declared with the
+ // given name. So go up the import heiarchy and
// see if one of the imported stylesheets declared it.
if(null == nl)
{
@@ -1183,16 +1183,16 @@
{
ElemDecimalFormat edf = (ElemDecimalFormat)m_DecimalFormatDeclarations.elementAt(i);
if (edf.getName().equals(name))
- {
+ {
dfs = edf.getDecimalFormatSymbols();
break;
- }
- }
+ }
+ }
}
-
- // If dfs is null at this point, it should
- // mean there wasn't an xsl:decimal-format declared with the
- // given name. So go up the import heirarchy and
+
+ // If dfs is null at this point, it should
+ // mean there wasn't an xsl:decimal-format declared with the
+ // given name. So go up the import heirarchy and
// see if one of the imported stylesheets declared it.
if(null == dfs)
{
@@ -1219,7 +1219,7 @@
* @param uri the URI of the extension namespace.
* @param nsh handler
*/
- public void addExtensionNamespace (String uri, ExtensionNSHandler nsh)
+ public void addExtensionNamespace (String uri, ExtensionNSHandler nsh)
{
m_extensionNamespaces.put (uri, nsh);
}
@@ -1229,33 +1229,33 @@
*
* @param uri the URI of the extension namespace.
*/
- public ExtensionNSHandler lookupExtensionNSHandler (String uri)
+ public ExtensionNSHandler lookupExtensionNSHandler (String uri)
{
return (ExtensionNSHandler) m_extensionNamespaces.get (uri);
}
-
+
/**
- * XPath object to use for short evaluations, so we don't have to
+ * XPath object to use for short evaluations, so we don't have to
* create one every time.
*/
private XPath m_xpath = null;
-
+
/**
* Factory for creating xpaths.
*/
transient private XPathFactory m_xpathFactory = null;
-
+
/**
* Statically init anything to do with XPath.
*/
void initXPath(XSLTEngineImpl processor)
{
m_xpathFactory = processor.getXMLProcessorLiaison().getDefaultXPathFactory();
-
+
// m_parserLiaison.setProcessorOwner(this);
m_xpathProcessor = new XPathProcessorImpl(processor.getXMLProcessorLiaison());
}
-
+
/**
* Init anything to do with XPath.
*/
@@ -1265,10 +1265,10 @@
m_xpathFactory = xpathFactory;
else
m_xpathFactory = processor.getXMLProcessorLiaison().getDefaultXPathFactory();
-
+
// m_parserLiaison.setProcessorOwner(this);
m_xpathProcessor = new XPathProcessorImpl(processor.getXMLProcessorLiaison());
-
+
m_xpath = m_xpathFactory.create();
m_xpath.installFunction("document", new FuncDocument());
m_xpath.installFunction("format-number", new FuncFormatNumb());
@@ -1317,11 +1317,11 @@
// xpath.shrink();
return xpath;
}
-
+
/**
* Evaluate an xpath string and return the result.
*/
- public XObject evalXPathStr(XPathSupport execContext, String str,
+ public XObject evalXPathStr(XPathSupport execContext, String str,
Node context, PrefixResolver nsNode)
throws org.xml.sax.SAXException
{
@@ -1329,8 +1329,8 @@
XPath xpath = m_xpathFactory.create();
m_xpathProcessor.initXPath(xpath, str, nsNode);
return xpath.execute(execContext, context, nsNode);
- }
-
+ }
+
/**
* Get an Expression object from a select node. Does not cache!
*/
@@ -1340,7 +1340,7 @@
String val = attrs.getValue(key);
return (null != val) ? createXPath(val, nsContext) : null;
}
-
+
/**
* Get the type of the node. We'll pretend we're a Document.
*/
@@ -1348,28 +1348,28 @@
{
return Node.DOCUMENT_NODE;
}
-
+
/** Unimplemented. */
public DocumentType getDoctype()
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public DOMImplementation getImplementation()
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Element getDocumentElement()
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Element createElement(String tagName)
throws DOMException
@@ -1377,47 +1377,47 @@
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public DocumentFragment createDocumentFragment()
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Text createTextNode(String data)
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Comment createComment(String data)
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public CDATASection createCDATASection(String data)
throws DOMException
-
+
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
- public ProcessingInstruction createProcessingInstruction(String target,
+ public ProcessingInstruction createProcessingInstruction(String target,
String data)
throws DOMException
-
+
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Attr createAttribute(String name)
throws DOMException
@@ -1425,7 +1425,7 @@
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public EntityReference createEntityReference(String name)
throws DOMException
@@ -1433,16 +1433,16 @@
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public NodeList getElementsByTagName(String tagname)
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
- public Node importNode(Node importedNode,
+ public Node importNode(Node importedNode,
boolean deep)
throws DOMException
{
@@ -1451,7 +1451,7 @@
}
/** Unimplemented. */
- public Element createElementNS(String namespaceURI,
+ public Element createElementNS(String namespaceURI,
String qualifiedName)
throws DOMException
{
@@ -1460,53 +1460,53 @@
}
/** Unimplemented. */
- public Attr createAttributeNS(String namespaceURI,
+ public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
throws DOMException
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
- public NodeList getElementsByTagNameNS(String namespaceURI,
+ public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
/** Unimplemented. */
public Element getElementById(String elementId)
{
error(XSLTErrorResources.ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM);
return null;
}
-
+
//==========================================================
// SECTION: XSL directive handling functions
- //==========================================================
+ //==========================================================
private void ____XSL_INSTRUCTIONS____(){}
/**
* Hash table that can look up xslt element IDs via name.
*/
static Hashtable m_elementKeys = null;
-
+
/**
* Hash table that can look up xslt element IDs via name.
*/
static Hashtable m_attributeKeys = null;
/**
- * Hash table that can look up XSLT4J extensions element IDs via name.
+ * Hash table that can look up Xalan extensions element IDs via name.
*/
static Hashtable m_XSLT4JElementKeys = new Hashtable();
/**
* Init the XSLT hashtable.
*/
- void initXSLTKeys()
+ void initXSLTKeys()
{
if(null == m_elementKeys)
{
@@ -1522,7 +1522,7 @@
elementKeys.put(new StringKey(Constants.ELEMNAME_CONTENTS_STRING), new Integer(Constants.ELEMNAME_CONTENTS));
elementKeys.put(new StringKey(Constants.ELEMNAME_COPY_STRING), new Integer(Constants.ELEMNAME_COPY));
elementKeys.put(new StringKey(Constants.ELEMNAME_COPY_OF_STRING), new Integer(Constants.ELEMNAME_COPY_OF));
-
+
elementKeys.put(new StringKey(Constants.ELEMNAME_ATTRIBUTESET_STRING), new Integer(Constants.ELEMNAME_DEFINEATTRIBUTESET));
elementKeys.put(new StringKey(Constants.ELEMNAME_USE_STRING), new Integer(Constants.ELEMNAME_USE));
@@ -1555,15 +1555,15 @@
elementKeys.put(new StringKey(Constants.ELEMNAME_SORT_STRING), new Integer(Constants.ELEMNAME_SORT));
elementKeys.put(new StringKey(Constants.ELEMNAME_PI_STRING), new Integer(Constants.ELEMNAME_PI));
elementKeys.put(new StringKey(Constants.ELEMNAME_COMMENT_STRING), new Integer(Constants.ELEMNAME_COMMENT));
-
+
elementKeys.put(new StringKey(Constants.ELEMNAME_COUNTER_STRING), new Integer(Constants.ELEMNAME_COUNTER));
elementKeys.put(new StringKey(Constants.ELEMNAME_COUNTERS_STRING), new Integer(Constants.ELEMNAME_COUNTERS));
elementKeys.put(new StringKey(Constants.ELEMNAME_COUNTERINCREMENT_STRING), new Integer(Constants.ELEMNAME_COUNTERINCREMENT));
elementKeys.put(new StringKey(Constants.ELEMNAME_COUNTERRESET_STRING), new Integer(Constants.ELEMNAME_COUNTERRESET ));
elementKeys.put(new StringKey(Constants.ELEMNAME_COUNTERSCOPE_STRING), new Integer(Constants.ELEMNAME_COUNTERSCOPE ));
-
+
elementKeys.put(new StringKey(Constants.ELEMNAME_APPLY_IMPORTS_STRING), new Integer(Constants.ELEMNAME_APPLY_IMPORTS ));
-
+
elementKeys.put(new StringKey(Constants.ELEMNAME_EXTENSION_STRING), new Integer(Constants.ELEMNAME_EXTENSION));
elementKeys.put(new StringKey(Constants.ELEMNAME_MESSAGE_STRING), new Integer(Constants.ELEMNAME_MESSAGE));
@@ -1658,17 +1658,17 @@
}
}
}
-
+
/**
* Given an XSL tag name, return an integer token
- * that corresponds to ELEMNAME_XXX constants defined
+ * that corresponds to ELEMNAME_XXX constants defined
* in Constants.java.
- * Note: I tried to optimize this by caching the node to
+ * Note: I tried to optimize this by caching the node to
* id lookups in a hash table, but it helped not a bit.
* I'm not sure that it's spending too much time here anyway.
* @param node a probable xsl:xxx element.
- * @return Constants.ELEMNAME_XXX token, or -1 if in xsl
- * or XSLT4J namespace, -2 if not in known namespace.
+ * @return Constants.ELEMNAME_XXX token, or -1 if in xsl
+ * or Xalan namespace, -2 if not in known namespace.
*/
/*
final int getXSLToken(Node node)
@@ -1717,10 +1717,10 @@
return tok;
}
*/
-
+
/**
- * Find the type of an element using this method. This is slower
- * than it ought to be... I'll find a way to optimize down the
+ * Find the type of an element using this method. This is slower
+ * than it ought to be... I'll find a way to optimize down the
* line if need be.
* @param node a probable xsl:xxx element.
* @param tagType Constants.ELEMNAME_XXX token.
@@ -1733,7 +1733,7 @@
return (getXSLToken(node) == tagType);
}
*/
-
+
/**
* Set the factory for making XPaths.
*/
@@ -1749,7 +1749,7 @@
{
return m_xpathFactory;
}
-
+
/**
* Set the XPath processor object.
* @param processor A XPathProcessor interface.
@@ -1766,6 +1766,6 @@
public XPathProcessor getXPathProcessor()
{
return m_xpathProcessor;
- }
-
+ }
+
}
1.24 +212 -212 xml-xalan/src/org/apache/xalan/xslt/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/StylesheetHandler.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- StylesheetHandler.java 2000/02/21 08:14:27 1.23
+++ StylesheetHandler.java 2000/02/24 21:11:02 1.24
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -68,9 +68,9 @@
import org.apache.xalan.xpath.xml.XSLMessages;
/**
- * This class processes a stylesheet via SAX events, and inits
- * the given stylesheet. If you need to alter the code in here,
- * it is not for the faint-of-heart, due to the state tracking
+ * Initializes and processes a stylesheet via SAX events.
+ * If you need to alter the code in here,
+ * it is not for the faint-of-heart, due to the state tracking
* that has to be done due to the SAX event model.
*/
public class StylesheetHandler implements DocumentHandler
@@ -79,20 +79,20 @@
* The XSLT Processor for needed services.
*/
XSLTEngineImpl m_processor;
-
+
/**
* The owning stylesheet.
*/
Stylesheet m_stylesheet;
-
+
/**
* The stack of elements, pushed and popped as events occur.
*/
Stack m_elems = new Stack();
/**
- * Need to keep a stack of found whitespace elements so that
- * whitespace elements next to non-whitespace elements can
+ * Need to keep a stack of found whitespace elements so that
+ * whitespace elements next to non-whitespace elements can
* be merged. For instance: <out> <![CDATA[test]]> </out>
*/
Stack m_whiteSpaceElems = new Stack();
@@ -101,31 +101,31 @@
* The current template.
*/
ElemTemplate m_template = null;
-
+
/**
- * The last element popped from the stack. I'm not totally clear
+ * The last element popped from the stack. I'm not totally clear
* anymore as to why this is needed.
*/
ElemTemplateElement m_lastPopped = null;
-
+
/**
* True if the process is in a template context.
*/
boolean m_inTemplate = false;
-
+
/**
- * True if the stylesheet element was found, or if it was determined that
+ * True if the stylesheet element was found, or if it was determined that
* the stylesheet is wrapperless.
*/
boolean m_foundStylesheet = false;
-
+
/**
- * Flag to let us know when we've found an element inside the
- * stylesheet that is not an xsl:import, so we can restrict imports
+ * Flag to let us know when we've found an element inside the
+ * stylesheet that is not an xsl:import, so we can restrict imports
* to being the first elements.
*/
boolean m_foundNotImport = false;
-
+
// BEGIN SANJIVA CODE
boolean m_inLXSLTScript = false;
StringBuffer m_LXSLTScriptBody;
@@ -134,15 +134,15 @@
ExtensionNSHandler m_LXSLTExtensionNSH;
// boolean m_bsfIsInited = false;
// END SANJIVA CODE
-
+
/**
- * This will act as a stack of sorts to keep track of the
+ * This will act as a stack of sorts to keep track of the
* current include base.
*/
public String m_includeBase;
/**
- * FormatterToText instance constructor... it will add the DOM nodes
+ * FormatterToText instance constructor... it will add the DOM nodes
* to the document fragment.
*/
public StylesheetHandler(XSLTEngineImpl processor, Stylesheet stylesheetTree)
@@ -151,7 +151,7 @@
m_stylesheet = stylesheetTree;
m_includeBase = m_stylesheet.m_baseIdent;
}
-
+
/**
* Receive an object for locating the origin of SAX document events.
*
@@ -222,12 +222,12 @@
}
// m_stylesheet.m_extensionNamespaces.clear();
}
-
- /**
+
+ /**
* See if this is a xmlns attribute, and, if so, process it.
- *
+ *
* @param attrName Qualified name of attribute.
- * @param atts The attribute list where the element comes from (not used at
+ * @param atts The attribute list where the element comes from (not used at
* this time).
* @param which The index into the attribute list (not used at this time).
* @return True if this is a namespace name.
@@ -237,9 +237,9 @@
return m_stylesheet.isAttrOK(attrName, atts, which);
}
- /**
+ /**
* Tell whether or not this is a xml:space attribute and, if so, process it.
- *
+ *
* @param aname The name of the attribute in question.
* @param atts The attribute list that owns the attribute.
* @param which The index of the attribute into the attribute list.
@@ -267,18 +267,18 @@
}
return isSpaceAttr;
}
-
+
/**
- * If this is set to true, we've already warned about using the
+ * If this is set to true, we've already warned about using the
* older XSLT namespace URL.
*/
private boolean warnedAboutOldXSLTNamespace = false;
-
+
/**
* The old namespace that we must match as a minumum for XSLT.
*/
static final String m_oldXSLNameSpaceURL = "http://www.w3.org/XSL/Transform/1.0";
-
+
/**
* Tell if the given namespace is XSLT
*/
@@ -295,7 +295,7 @@
}
return isXSLT;
}
-
+
/**
* Get the local name, without the prefix, if there is one.
*/
@@ -304,18 +304,18 @@
int index = name.indexOf(':');
return (index < 0) ? name : name.substring(index+1);
}
-
+
/**
* Process xsl:strip-space and xsl:preserve-space.
*/
- private void processStripAndPreserve(String name, AttributeList atts,
+ private void processStripAndPreserve(String name, AttributeList atts,
int xslToken, int lineNumber, int columnNumber)
throws SAXException
{
ElemTemplateElement nsNode = new ElemEmpty(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
-
+
int nAttrs = atts.getLength();
boolean foundIt = false;
for(int i = 0; i < nAttrs; i++)
@@ -329,19 +329,19 @@
{
// Use only the root, at least for right now.
String wildcardName = tokenizer.nextToken();
-
+
/**
- * Creating a match pattern is too much overhead, but it's a reasonably
- * easy and safe way to do this right now. TODO: Validate the pattern
+ * Creating a match pattern is too much overhead, but it's a reasonably
+ * easy and safe way to do this right now. TODO: Validate the pattern
* to make sure it's a WildcardName.
*/
XPath matchPat = m_stylesheet.createMatchPattern(wildcardName, nsNode);
-
+
if(Constants.ELEMNAME_PRESERVESPACE == xslToken)
{
if(null == m_stylesheet.m_stylesheetRoot.m_whitespacePreservingElements)
{
- m_stylesheet.m_stylesheetRoot.m_whitespacePreservingElements
+ m_stylesheet.m_stylesheetRoot.m_whitespacePreservingElements
= new Vector();
}
m_stylesheet.m_stylesheetRoot.m_whitespacePreservingElements.addElement(matchPat);
@@ -350,7 +350,7 @@
{
if(null == m_stylesheet.m_stylesheetRoot.m_whitespaceStrippingElements)
{
- m_stylesheet.m_stylesheetRoot.m_whitespaceStrippingElements
+ m_stylesheet.m_stylesheetRoot.m_whitespaceStrippingElements
= new Vector();
}
m_stylesheet.m_stylesheetRoot.m_whitespaceStrippingElements.addElement(matchPat);
@@ -367,7 +367,7 @@
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_REQUIRES_ELEMENTS_ATTRIB, new Object[]{name, Constants.ATTRNAME_ELEMENTS})); //"(StylesheetHandler) "+name+" requires a "+Constants.ATTRNAME_ELEMENTS+" attribute!");
}
}
-
+
/**
* Receive notification of the beginning of an element.
*
@@ -388,15 +388,15 @@
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
* @see #endElement
- * @see org.xml.sax.AttributeList
+ * @see org.xml.sax.AttributeList
*/
public void startElement (String name, AttributeList atts)
throws SAXException
{
// XSLTErrorResources resbundle = XSLTErrorResources.loadResourceBundle(Constants.ERROR_RESOURCES);
m_whiteSpaceElems.removeAllElements();
- Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
- ? null :
+ Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
+ ? null :
((Locator)m_processor.m_stylesheetLocatorStack.peek());
int lineNumber = (null != locator) ? locator.getLineNumber() : 0;
int columnNumber = (null != locator) ? locator.getColumnNumber() : 0;
@@ -414,14 +414,14 @@
{
if(null != m_stylesheet.m_XSLNameSpaceURL)
m_stylesheet.m_XSLNameSpaceURL = ns;
-
+
if(false == m_foundStylesheet)
{
m_stylesheet.initXSLTKeys();
m_stylesheet.m_stylesheetRoot.initDefaultRule();
m_stylesheet.getTemplateList().setIsWrapperless(false);
}
-
+
Object obj = m_stylesheet.m_elementKeys.get(localName);
int xslToken = (null != obj) ? ((Integer)obj).intValue() : -2;
if(!m_inTemplate)
@@ -430,9 +430,9 @@
{
m_foundNotImport = true;
}
-
+
switch(xslToken)
- {
+ {
case Constants.ELEMNAME_TEMPLATE:
m_template = new ElemTemplate(m_processor,
m_stylesheet,
@@ -457,18 +457,18 @@
// m_processor.handleFunctionsInstruction((Element)child);
}
break;
-
+
case Constants.ELEMNAME_VARIABLE:
case Constants.ELEMNAME_PARAMVARIABLE:
{
- ElemVariable varelem = (Constants.ELEMNAME_PARAMVARIABLE == xslToken)
+ ElemVariable varelem = (Constants.ELEMNAME_PARAMVARIABLE == xslToken)
? new ElemParam(m_processor,
m_stylesheet,
- name, atts,
+ name, atts,
lineNumber, columnNumber)
: new ElemVariable(m_processor,
m_stylesheet,
- name, atts,
+ name, atts,
lineNumber, columnNumber);
m_elems.push(varelem);
m_inTemplate = true; // fake it out
@@ -476,61 +476,61 @@
varelem.m_isTopLevel = true;
}
break;
- // TODO: Remove this??
+ // TODO: Remove this??
case Constants.ELEMNAME_LOCALE:
m_processor.warn(XSLTErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"xsl:locale not yet supported!");
break;
-
+
case Constants.ELEMNAME_PRESERVESPACE:
case Constants.ELEMNAME_STRIPSPACE:
- processStripAndPreserve(name, atts, xslToken,
+ processStripAndPreserve(name, atts, xslToken,
lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_KEY:
{
ElemEmpty nsContext = new ElemEmpty(m_processor,
m_stylesheet,
- name, atts,
+ name, atts,
lineNumber, columnNumber);
m_stylesheet.processKeyElement(nsContext, atts);
}
break;
-
+
case Constants.ELEMNAME_DEFINEATTRIBUTESET:
m_inTemplate = true; // fake it out
ElemAttributeSet attrSet = new ElemAttributeSet(m_processor,
m_stylesheet,
- name, atts,
- lineNumber,
+ name, atts,
+ lineNumber,
columnNumber);
m_elems.push(attrSet);
break;
-
+
case Constants.ELEMNAME_INCLUDE:
processInclude(name, atts);
break;
-
+
case Constants.ELEMNAME_IMPORT:
processImport(name, atts);
break;
-
+
case Constants.ELEMNAME_OUTPUT:
m_stylesheet.m_stylesheetRoot.processOutputSpec(name, atts);
break;
-
+
case Constants.ELEMNAME_DECIMALFORMAT:
ElemDecimalFormat edf = new ElemDecimalFormat(m_processor,
m_stylesheet,
- name, atts,
+ name, atts,
lineNumber, columnNumber);
m_stylesheet.processDecimalFormatElement(edf, atts);
break;
-
- case Constants.ELEMNAME_NSALIAS:
+
+ case Constants.ELEMNAME_NSALIAS:
m_stylesheet.processNSAliasElement(name, atts);
- break;
-
+ break;
+
case Constants.ELEMNAME_WITHPARAM:
case Constants.ELEMNAME_ATTRIBUTE:
case Constants.ELEMNAME_APPLY_TEMPLATES:
@@ -593,14 +593,14 @@
else if(aname.equals(Constants.ATTRNAME_EXTENSIONELEMENTPREFIXES))
{
// BEGIN SANJIVA CODE
- StringTokenizer tokenizer =
+ StringTokenizer tokenizer =
new StringTokenizer (atts.getValue (i), " \t\n\r", false);
- while(tokenizer.hasMoreTokens ())
+ while(tokenizer.hasMoreTokens ())
{
String prefix = tokenizer.nextToken ();
// SANJIVA: ask Scott: is the line below correct?
String extns = m_stylesheet.getNamespaceForPrefixFromStack (prefix);
- if (null == extns)
+ if (null == extns)
extns = "";
ExtensionNSHandler nsh = new ExtensionNSHandler (m_processor, extns);
m_stylesheet.addExtensionNamespace (extns, nsh);
@@ -626,17 +626,17 @@
if(false == m_stylesheet.getTemplateList().getIsWrapperless())
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_ATTRIB, new Object[]{name, aname})); //"(StylesheetHandler) "+name+" has an illegal attribute: "+aname);
- }
+ }
}
if(!m_stylesheet.m_namespaces.empty())
{
m_stylesheet.m_namespaceDecls = (org.apache.xalan.xpath.xml.NameSpace)m_stylesheet.m_namespaces.peek();
}
-
+
/*
default:
- if((null != ns) && (ns.equalsIgnoreCase(m_processor.m_XSLNameSpaceURL) ||
+ if((null != ns) && (ns.equalsIgnoreCase(m_processor.m_XSLNameSpaceURL) ||
ns.equalsIgnoreCase(m_processor.m_XML4JNameSpaceURL)))
{
m_processor.warn(name
@@ -649,10 +649,10 @@
// Thanks to "Timm, Sean" <ST...@mailgo.com>
if(!didSpecifyVersion)
{
- m_processor.warn(XSLTErrorResources.WG_STYLESHEET_REQUIRES_VERSION_ATTRIB, null);
+ m_processor.warn(XSLTErrorResources.WG_STYLESHEET_REQUIRES_VERSION_ATTRIB, null);
// throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_REQUIRES_VERSION_ATTRIB, null)); // "xsl:stylesheet requires a 'version' attribute!");
}
-
+
break;
default:
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_UNKNOWN_XSL_ELEM, new Object[]{localName})); //"Unknown XSL element: "+localName);
@@ -661,31 +661,31 @@
else
{
switch(xslToken)
- {
+ {
case Constants.ELEMNAME_APPLY_TEMPLATES:
elem = new ElemApplyTemplates(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_CALLTEMPLATE:
elem = new ElemCallTemplate(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_WITHPARAM:
elem = new ElemWithParam(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_FOREACH:
elem = new ElemForEach(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_SORT:
try
{
@@ -694,7 +694,7 @@
ElemSort sortElem = new ElemSort(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
-
+
if(null == foreach.m_sortElems)
{
foreach.m_sortElems = new Vector();
@@ -707,13 +707,13 @@
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_XSLSORT_USE, null)); //"(StylesheetHandler) "+"xsl:sort can only be used with xsl:apply-templates or xsl:for-each.");
}
break;
-
+
case Constants.ELEMNAME_APPLY_IMPORTS:
elem = new ElemApplyImport(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_VALUEOF:
elem = new ElemValueOf(m_processor,
m_stylesheet,
@@ -725,7 +725,7 @@
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_VARIABLE:
elem = new ElemVariable(m_processor,
m_stylesheet,
@@ -737,7 +737,7 @@
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_IF:
elem = new ElemIf(m_processor,
m_stylesheet,
@@ -755,14 +755,14 @@
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_WHEN:
{
ElemTemplateElement parent = (ElemTemplateElement)m_elems.peek();
if(Constants.ELEMNAME_CHOOSE == parent.getXSLToken())
{
ElemTemplateElement lastChild = (ElemTemplateElement)parent.getLastChild();
- if((null == lastChild) ||
+ if((null == lastChild) ||
(Constants.ELEMNAME_WHEN == lastChild.getXSLToken()))
{
elem = new ElemWhen(m_processor,
@@ -780,14 +780,14 @@
}
}
break;
-
+
case Constants.ELEMNAME_OTHERWISE:
{
ElemTemplateElement parent = (ElemTemplateElement)m_elems.peek();
if(Constants.ELEMNAME_CHOOSE == parent.getXSLToken())
{
ElemTemplateElement lastChild = (ElemTemplateElement)parent.getLastChild();
- if((null == lastChild) ||
+ if((null == lastChild) ||
(Constants.ELEMNAME_WHEN == lastChild.getXSLToken()))
{
elem = new ElemOtherwise(m_processor,
@@ -843,7 +843,7 @@
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_PI:
elem = new ElemPI(m_processor,
m_stylesheet,
@@ -855,20 +855,20 @@
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_MESSAGE:
elem = new ElemMessage(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_DECIMALFORMAT:
elem = new ElemDecimalFormat(m_processor,
m_stylesheet,
name, atts, lineNumber, columnNumber);
break;
-
+
case Constants.ELEMNAME_TEMPLATE:
case Constants.ELEMNAME_LOCALE:
case Constants.ELEMNAME_DEFINEATTRIBUTESET:
@@ -898,24 +898,24 @@
|| ns.equals("http://xsl.lotus.com/")
|| ns.equals("http://xsl.lotus.com")))
{
- if (localName.equals ("component"))
+ if (localName.equals ("component"))
{
String prefix = null;
String elements = null;
String functions = null;
int nAttrs = atts.getLength ();
- for (int i = 0; i < nAttrs; i++)
+ for (int i = 0; i < nAttrs; i++)
{
String aname = atts.getName (i);
- if (aname.equals ("prefix"))
+ if (aname.equals ("prefix"))
{
prefix = atts.getValue (i);
}
- else if (aname.equals ("elements"))
+ else if (aname.equals ("elements"))
{
elements = atts.getValue (i);
}
- else if (aname.equals ("functions"))
+ else if (aname.equals ("functions"))
{
functions = atts.getValue (i);
}
@@ -924,60 +924,60 @@
m_stylesheet.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE, new Object[] {name, aname}); //name+" has an illegal attribute: "+aname);
}
}
- if (prefix == null)
+ if (prefix == null)
{
- throw new SAXException (XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_PREFIX_ATTRIB, new Object[]{name})); //"(StylesheetHandler) " + name +
+ throw new SAXException (XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_PREFIX_ATTRIB, new Object[]{name})); //"(StylesheetHandler) " + name +
//" attribute 'prefix' is missing");
}
// SCOTT: is the line below correct?
String extns = m_stylesheet.getNamespaceForPrefixFromStack (prefix);
- if (null == extns)
+ if (null == extns)
{
extns = "";
}
ExtensionNSHandler nsh = m_stylesheet.lookupExtensionNSHandler (extns);
- if (nsh == null)
+ if (nsh == null)
{
// xsl:extension-element-prefixes might not be known yet,
// see extend17.xsl.
- // if (elements != null)
- // throw new SAXException (XSLMessages.createMessage(XSLTErrorResources.ER_UNKNOWN_EXT_NS_PREFIX, new Object[]{name, prefix})); //"(StylesheetHandler) " + name +
-
- if (null == extns)
+ // if (elements != null)
+ // throw new SAXException (XSLMessages.createMessage(XSLTErrorResources.ER_UNKNOWN_EXT_NS_PREFIX, new Object[]{name, prefix})); //"(StylesheetHandler) " + name +
+
+ if (null == extns)
extns = "";
nsh = new ExtensionNSHandler (m_processor, extns);
m_stylesheet.addExtensionNamespace (extns, nsh);
}
-
+
nsh.setScript("javaclass", extns, null); // as default
- if (elements != null)
+ if (elements != null)
{
nsh.setElements (elements);
}
- if (functions != null)
+ if (functions != null)
{
nsh.setFunctions (functions);
}
- m_LXSLTExtensionNSH = nsh; // hang on to it for processing
+ m_LXSLTExtensionNSH = nsh; // hang on to it for processing
// endElement on lxslt:script
}
- else if (localName.equals ("script"))
+ else if (localName.equals ("script"))
{
- // process this in end element so that I can see whether I had
- // a body as well. The default pushing logic will save the
+ // process this in end element so that I can see whether I had
+ // a body as well. The default pushing logic will save the
// attributes for me. The body will be accumulated into the
// following string buffer
m_inLXSLTScript = true;
m_LXSLTScriptBody = new StringBuffer ();
int nAttrs = atts.getLength ();
- for (int i = 0; i < nAttrs; i++)
+ for (int i = 0; i < nAttrs; i++)
{
String aname = atts.getName (i);
- if (aname.equals ("lang"))
+ if (aname.equals ("lang"))
{
m_LXSLTScriptLang = atts.getValue (i);
}
- else if (aname.equals ("src"))
+ else if (aname.equals ("src"))
{
m_LXSLTScriptSrcURL = atts.getValue (i);
}
@@ -987,9 +987,9 @@
}
}
}
- else
+ else
{
- // other xslt4j: element. Not my business.
+ // other xalan: element. Not my business.
}
}
// END SANJIVA CODE
@@ -1003,11 +1003,11 @@
for(int i = 0; i < nAttrs; i++)
{
String aname = atts.getName(i);
-
+
String ans = m_stylesheet.getNamespaceFromStack(aname);
-
+
if(isXSLTNameSpace(ans))
- {
+ {
String lname = getLocalName(aname);
if(lname.equals("version"))
{
@@ -1019,7 +1019,7 @@
}
if(!didSpecifyVersion)
{
- m_processor.warn(XSLTErrorResources.WG_STYLESHEET_REQUIRES_VERSION_ATTRIB, null);
+ m_processor.warn(XSLTErrorResources.WG_STYLESHEET_REQUIRES_VERSION_ATTRIB, null);
//throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_REQUIRES_VERSION_ATTRIB, null)); // "xsl:stylesheet requires a 'version' attribute!");
}
@@ -1031,10 +1031,10 @@
// is this an extension element call?
ExtensionNSHandler nsh = null;
String theExtns = null;
-
+
if(null != ns)
{
- // Yuck, first we have to look at the current attributes for
+ // Yuck, first we have to look at the current attributes for
// a xsl:extension-element-prefixes attribute.
int nAtts = atts.getLength();
for(int i = 0; i < nAtts; i++)
@@ -1048,7 +1048,7 @@
if(!prefix.equals("xmlns"))
{
String attrNS = m_stylesheet.getNamespaceForPrefixFromStack (prefix);
- if((null != attrNS)
+ if((null != attrNS)
&& attrNS.equals( m_stylesheet.m_XSLNameSpaceURL ))
{
@@ -1085,10 +1085,10 @@
{
ElemExtensionCall extcall = (ElemExtensionCall)parent;
extensionElementPrefixes = extcall.m_extensionElementPrefixes;
-
+
}
else if(Constants.ELEMNAME_LITERALRESULT == tok)
- {
+ {
ElemLiteralResult extcall = (ElemLiteralResult)parent;
extensionElementPrefixes = extcall.m_extensionElementPrefixes;
}
@@ -1111,18 +1111,18 @@
}
}
}
-
- if ((ns != null) && (null == nsh))
+
+ if ((ns != null) && (null == nsh))
{
nsh = m_stylesheet.lookupExtensionNSHandler(ns);
theExtns = ns;
}
-
- if (nsh != null)
+
+ if (nsh != null)
{
if(null == theExtns)
theExtns = "";
-
+
elem = new ElemExtensionCall (m_processor,
m_stylesheet,
// nsh,
@@ -1134,11 +1134,11 @@
localName,
atts, lineNumber, columnNumber);
}
- else
+ else
{
elem = new ElemLiteralResult(m_processor,
m_stylesheet,
- name,
+ name,
atts, lineNumber, columnNumber);
}
// BEGIN SANJIVA CODE
@@ -1154,7 +1154,7 @@
}
m_elems.push(elem);
}
- // If for some reason something didn't get pushed, push an empty
+ // If for some reason something didn't get pushed, push an empty
// object.
if(origStackSize == m_elems.size())
{
@@ -1163,7 +1163,7 @@
name, atts, lineNumber, columnNumber));
}
}
-
+
/**
* Init the wrapperless template
*/
@@ -1173,16 +1173,16 @@
{
m_stylesheet.initXSLTKeys();
m_stylesheet.m_stylesheetRoot.initDefaultRule();
- MutableAttrListImpl templateAttrs
+ MutableAttrListImpl templateAttrs
= new MutableAttrListImpl();
templateAttrs.addAttribute("name", "CDATA", "simple");
m_template = new ElemTemplate(m_processor,
m_stylesheet,
- "xsl:template",
+ "xsl:template",
templateAttrs, lineNumber, columnNumber);
ElemTemplateElement elem = new ElemLiteralResult(m_processor,
m_stylesheet,
- name,
+ name,
atts, lineNumber, columnNumber);
m_template.appendChild(elem);
m_inTemplate = true;
@@ -1197,7 +1197,7 @@
}
return elem;
}
-
+
/**
* Process xsl:import.
*/
@@ -1212,40 +1212,40 @@
if(aname.equals(Constants.ATTRNAME_HREF))
{
foundIt = true;
-
+
if(m_foundNotImport)
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_IMPORTS_AS_FIRST_ELEM, null)); //"(StylesheetHandler) "+"Imports can only occur as the first elements in the stylesheet!");
}
-
+
String saved_XSLNameSpaceURL = m_stylesheet.m_XSLNameSpaceURL;
-
+
String href = atts.getValue(i);
URL hrefUrl = m_processor.getURLFromString(href, m_stylesheet.m_baseIdent);
if(stackContains(m_stylesheet.m_stylesheetRoot.m_importStack, hrefUrl))
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_IMPORTING_ITSELF, new Object[] {hrefUrl})); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!");
}
-
+
m_stylesheet.m_stylesheetRoot.m_importStack.push(hrefUrl);
-
+
try
{
- String[] stringHolder =
+ String[] stringHolder =
{
null};
-
- Stylesheet importedStylesheet
- = new Stylesheet(m_stylesheet.m_stylesheetRoot,
+
+ Stylesheet importedStylesheet
+ = new Stylesheet(m_stylesheet.m_stylesheetRoot,
m_processor, m_stylesheet.m_baseIdent);
StylesheetHandler tp = new StylesheetHandler(m_processor, importedStylesheet);
-
+
importedStylesheet.m_baseIdent = hrefUrl.toExternalForm();
-
- m_processor.parseXML(hrefUrl,
+
+ m_processor.parseXML(hrefUrl,
tp, importedStylesheet);
-
- // I'm going to insert the elements in backwards order,
+
+ // I'm going to insert the elements in backwards order,
// so I can walk them 0 to n.
m_stylesheet.m_imports.insertElementAt(importedStylesheet, 0);
importedStylesheet.m_stylesheetParent = m_stylesheet;
@@ -1262,9 +1262,9 @@
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_IOEXCEPTION, new Object[] {atts.getValue(i)}), ioe); //"Had IO Exception with stylesheet file: "+atts.getValue(i), ioe);
}
-
+
m_stylesheet.m_stylesheetRoot.m_importStack.pop();
-
+
m_stylesheet.m_XSLNameSpaceURL = saved_XSLNameSpaceURL;
}
else if(!isAttrOK(aname, atts, i))
@@ -1296,7 +1296,7 @@
}
return contains;
}
-
+
/**
* Process xsl:include.
*/
@@ -1311,7 +1311,7 @@
if(aname.equals(Constants.ATTRNAME_HREF))
{
foundIt = true;
-
+
// Save state, so this class can be reused.
Stack saved_elems = m_elems;
m_elems = new Stack();
@@ -1330,21 +1330,21 @@
m_stylesheet.m_namespaceDecls = null;
Stack saved_namespaces = m_stylesheet.m_namespaces;
m_stylesheet.m_namespaces = new Stack();
-
-
+
+
String href = atts.getValue(i);
- URL hrefUrl
- = m_processor.getURLFromString(href,
+ URL hrefUrl
+ = m_processor.getURLFromString(href,
((URL)m_stylesheet.m_includeStack.peek()).toString());
if(stackContains(m_stylesheet.m_includeStack, hrefUrl))
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_IMPORTING_ITSELF, new Object[] {hrefUrl})); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly including itself!");
}
-
+
m_stylesheet.m_includeStack.push(hrefUrl);
- // m_includeBase =
-
+ // m_includeBase =
+
try
{
m_processor.parseXML(hrefUrl,
@@ -1354,9 +1354,9 @@
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSINCLUDE_ERROR, null), ioe);//"StylesheetHandler.processInclude error", ioe);
}
-
+
m_stylesheet.m_includeStack.pop();
-
+
m_elems = saved_elems;
m_template = saved_template;
m_lastPopped = saved_lastPopped;
@@ -1377,7 +1377,7 @@
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_HREF_ATTRIB, new Object[] {name})); //"(StylesheetHandler) "+"Could not find href attribute for "+name);
}
}
-
+
/**
* Receive notification of the end of an element.
*
@@ -1419,13 +1419,13 @@
m_inTemplate = false;
}
// BEGIN SANJIVA CODE
- if (m_inLXSLTScript)
+ if (m_inLXSLTScript)
{
- if (m_LXSLTScriptLang == null)
+ if (m_LXSLTScriptLang == null)
{
- throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_LANG_ATTRIB, new Object[] {name})); //"(StylesheetHandler) " + name +
+ throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_LANG_ATTRIB, new Object[] {name})); //"(StylesheetHandler) " + name +
}
- if (m_LXSLTExtensionNSH == null)
+ if (m_LXSLTExtensionNSH == null)
{
throw new SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_MISSING_CONTAINER_ELEMENT_COMPONENT, new Object[] {name})); //"(StylesheetHandler) misplaced " + name +
// " element?? Missing container element " +
@@ -1452,7 +1452,7 @@
}
// END SANJIVA CODE
}
-
+
/**
* Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
* of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
@@ -1460,23 +1460,23 @@
* @param ch Character to check as XML whitespace.
* @return =true if <var>ch</var> is XML whitespace; otherwise =false.
*/
- public static boolean isSpace(char ch)
+ public static boolean isSpace(char ch)
{
return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA);
}
/**
- * Tell if the string is whitespace.
+ * Tell if the string is whitespace.
* @param string String to be trimmed.
* @return The trimmed string.
*/
- public boolean isWhiteSpace(char ch[], int start, int length)
- {
+ public boolean isWhiteSpace(char ch[], int start, int length)
+ {
boolean isWhiteSpace = true;
int end = start+length;
- for(int s = start; s < end; s++)
+ for(int s = start; s < end; s++)
{
- if (!isSpace(ch[s]))
+ if (!isSpace(ch[s]))
{
isWhiteSpace = false;
break;
@@ -1508,7 +1508,7 @@
* @param length The number of characters to read from the array.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
- * @see #ignorableWhitespace
+ * @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void characters (char ch[], int start, int length)
@@ -1525,15 +1525,15 @@
parent = (ElemTemplateElement)m_elems.elementAt(m_elems.size()-2);
preserveSpace = true;
}
- Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
- ? null :
+ Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
+ ? null :
((Locator)m_processor.m_stylesheetLocatorStack.peek());
int lineNumber = (null != locator) ? locator.getLineNumber() : 0;
int columnNumber = (null != locator) ? locator.getColumnNumber() : 0;
ElemTextLiteral elem = new ElemTextLiteral(m_processor,
m_stylesheet,
- ch, start, length,
- false, preserveSpace,
+ ch, start, length,
+ false, preserveSpace,
disableOutputEscaping,
lineNumber, columnNumber);
boolean isWhite = isWhiteSpace(ch, start, length);
@@ -1549,22 +1549,22 @@
else if(isWhite)
{
boolean shouldPush = true;
-
- // Check out the last child added to the stylesheet tree to
+
+ // Check out the last child added to the stylesheet tree to
// see if it is a literal text result element.
Node last = parent.getLastChild();
-
+
if(null != last)
{
ElemTemplateElement lastElem = (ElemTemplateElement)last;
// If it was surrounded by xsl:text, it will count as an element.
- boolean isPrevCharData
+ boolean isPrevCharData
= Constants.ELEMNAME_TEXTLITERALRESULT == lastElem.getXSLToken();
- boolean isLastPoppedXSLText = (m_lastPopped != null) &&
+ boolean isLastPoppedXSLText = (m_lastPopped != null) &&
(Constants.ELEMNAME_TEXT == m_lastPopped.getXSLToken());
- if(isPrevCharData && !isLastPoppedXSLText)
+ if(isPrevCharData && !isLastPoppedXSLText)
{
parent.appendChild(elem);
shouldPush = false;
@@ -1581,9 +1581,9 @@
}
// END SANJIVA CODE
// TODO: Flag error if text inside of stylesheet
-// m_lastPopped = null; // Reset this so that it does not affect future elements
+// m_lastPopped = null; // Reset this so that it does not affect future elements
}
-
+
/**
* Receive notification of cdata.
*
@@ -1606,7 +1606,7 @@
* @param length The number of characters to read from the array.
* @exception org.xml.sax.SAXException Any SAX exception, possibly
* wrapping another exception.
- * @see #ignorableWhitespace
+ * @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void cdata (char ch[], int start, int length)
@@ -1623,15 +1623,15 @@
parent = (ElemTemplateElement)m_elems.elementAt(m_elems.size()-2);
preserveSpace = true;
}
- Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
- ? null :
+ Locator locator = m_processor.m_stylesheetLocatorStack.isEmpty()
+ ? null :
((Locator)m_processor.m_stylesheetLocatorStack.peek());
int lineNumber = (null != locator) ? locator.getLineNumber() : 0;
int columnNumber = (null != locator) ? locator.getColumnNumber() : 0;
ElemTextLiteral elem = new ElemTextLiteral(m_processor,
m_stylesheet,
- ch, start, length,
- true, preserveSpace,
+ ch, start, length,
+ true, preserveSpace,
disableOutputEscaping,
lineNumber, columnNumber);
boolean isWhite = isWhiteSpace(ch, start, length);
@@ -1647,18 +1647,18 @@
else if(isWhite)
{
boolean shouldPush = true;
-
- // Check out the previous element that was added to the
- // stylesheet tree to see if it was a literal text
+
+ // Check out the previous element that was added to the
+ // stylesheet tree to see if it was a literal text
// element.
- Node last = parent.getLastChild();
+ Node last = parent.getLastChild();
if(null != last)
{
ElemTemplateElement lastElem = (ElemTemplateElement)last;
// If it was surrounded by xsl:text, it will count as an element.
- boolean isPrevCharData
+ boolean isPrevCharData
= Constants.ELEMNAME_TEXTLITERALRESULT == lastElem.getXSLToken();
- boolean isLastPoppedXSLText = (m_lastPopped != null) &&
+ boolean isLastPoppedXSLText = (m_lastPopped != null) &&
(Constants.ELEMNAME_TEXT == m_lastPopped.getXSLToken());
if(isPrevCharData && !isLastPoppedXSLText)
{
@@ -1735,8 +1735,8 @@
// No action for the moment.
// m_lastPopped = null; // Reset this so that it does not affect future elements
}
+
-
/**
* Called when a Comment is to be constructed.
* @param data The comment data.
@@ -1756,5 +1756,5 @@
{
// No action for the moment.
}
-
+
}
1.29 +22 -17 xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java
Index: StylesheetRoot.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/StylesheetRoot.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- StylesheetRoot.java 2000/02/23 23:03:30 1.28
+++ StylesheetRoot.java 2000/02/24 21:11:02 1.29
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
@@ -169,7 +169,9 @@
}
/**
- * Constructor for a Stylesheet needs a Document.
+ * Uses an XSL stylesheet document.
+ * @param processor The XSLTProcessor implementation.
+ * @param baseIdentifier The file name or URL for the XSL stylesheet.
* @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
@@ -185,7 +187,7 @@
}
/**
- * Do common initialization.
+ * Initialize the stylesheet.
*/
protected void init(XSLTEngineImpl processor)
throws XSLProcessorException,
@@ -211,7 +213,7 @@
}
/**
- * Get a new OutputFormat object according to the attributes of xsl:output.
+ * Get a new OutputFormat object according to the xsl:output attributes.
*/
public OutputFormat getOutputFormat()
{
@@ -244,12 +246,12 @@
}
/**
- * Transform the source tree to the output in the given
- * result tree target.
- * @param inputSource The input source tree.
- * @param outputTarget The output source tree.
+ * Transform the XML source tree and place the output in the result tree target.
+ * @param xmlSource The XML input source tree.
+ * @param outputTarget The output result tree.
* @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
+ * @see org.apache.xalan.xslt.XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
*/
public void process( XSLTInputSource xmlSource,
XSLTResultTarget outputTarget)
@@ -268,13 +270,13 @@
}
/**
- * Transform the source tree to the output in the given
- * result tree target.
+ * Transform the XML source tree and place the output in the result tree target.
* @param iprocessor The processor that will track the running state.
- * @param inputSource The input source tree.
- * @param outputTarget The output source tree.
+ * @param xmlSource The XML input source tree.
+ * @param outputTarget The output result tree.
* @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
+ * @see org.apache.xalan.xslt.XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
*/
public void process( XSLTProcessor iprocessor, XSLTInputSource xmlSource,
XSLTResultTarget outputTarget)
@@ -287,10 +289,13 @@
}
/**
- * Transform the source tree to the output in the given
- * result tree target.
- * @param inputSource The input source tree.
- * @param outputTarget The output source tree.
+ * Transform the XML source tree (a DOM Node) and place the output in the result tree target.
+ * This is a convenience method. You can also use a DOM Node to instantiate an XSLTInputSource object,
+ * and call {@link #process(XSLTProcessor, XSLTInputSource, XSLTResultTarget)} or
+ * {@link org.apache.xalan.xslt.XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)}.
+ * @param iprocessor The processor that will track the running state.
+ * @param sourceTree The input source tree in the form of a DOM Node.
+ * @param outputTarget The output result tree.
* @exception XSLProcessorException thrown if the active ProblemListener and XMLParserLiaison decide
* the error condition is severe enough to halt processing.
*/
@@ -452,7 +457,7 @@
/**
* If this is set to true, the Xerces serializers will
- * be used, otherwise the Xalan serializers will be
+ * be used, otherwise (false is the default) the Xalan serializers will be
* used. This is meant as a stop-gap until the Xerces
* serializers come up to speed.
*/
1.2 +1 -1 xml-xalan/src/org/apache/xalan/xslt/StylesheetSpec.java
Index: StylesheetSpec.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/StylesheetSpec.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StylesheetSpec.java 2000/02/18 06:41:08 1.1
+++ StylesheetSpec.java 2000/02/24 21:11:02 1.2
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.6 +1 -1 xml-xalan/src/org/apache/xalan/xslt/TemplateList.java
Index: TemplateList.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/TemplateList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TemplateList.java 2000/02/23 23:03:30 1.5
+++ TemplateList.java 2000/02/24 21:11:02 1.6
@@ -66,7 +66,7 @@
import org.apache.xalan.xslt.res.XSLTErrorResources;
/**
- * Encapsulates a template list, and helps locate templates.
+ * Encapsulates a template list, and helps locate individual templates.
*/
public class TemplateList implements java.io.Serializable
{
1.3 +1 -1 xml-xalan/src/org/apache/xalan/xslt/XMLSourceInfo.java
Index: XMLSourceInfo.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XMLSourceInfo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLSourceInfo.java 2000/02/23 23:03:30 1.2
+++ XMLSourceInfo.java 2000/02/24 21:11:02 1.3
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/XSLProcessorException.java
Index: XSLProcessorException.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLProcessorException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLProcessorException.java 2000/01/05 23:05:32 1.3
+++ XSLProcessorException.java 2000/02/24 21:11:03 1.4
@@ -24,7 +24,7 @@
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
1.8 +12 -12 xml-xalan/src/org/apache/xalan/xslt/XSLProcessorVersion.java
Index: XSLProcessorVersion.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLProcessorVersion.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XSLProcessorVersion.java 2000/02/23 21:29:28 1.7
+++ XSLProcessorVersion.java 2000/02/24 21:11:03 1.8
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -57,14 +57,14 @@
package org.apache.xalan.xslt;
/**
- * Xalan administrative class to keep track of the version number of
- * the release.
+ * Administrative class to keep track of the version number of
+ * the Xalan release.
* <P>See also: org/apache/xalan/xpath/xml/XSLTInfo.properties</P>
*/
-public class XSLProcessorVersion
+public class XSLProcessorVersion
{
/**
- * Version String like <CODE>"<B>Xalan</B>i v.r[.dd| <B>D</B>nn]"</CODE>.
+ * Version String like <CODE>"<B>Xalan</B>i v.r[.dd| <B>D</B>nn]"</CODE>.
* <P>Semantics of the version string are identical to the Xerces project.</P>
*/
public static String S_VERSION = "0.19.5";
@@ -85,7 +85,7 @@
* significant, externally apparent enhancement from
* the previous release. 'n' represents the n'th
* version.
- *
+ *
* Clients should carefully consider the implications
* of new versions as external interfaces and behaviour
* may have changed.
@@ -118,15 +118,15 @@
* Optional identifier designates development drop of
* a specific release. D01 is the first development drop
* of a new release.
- *
+ *
* Development drops are works in progress towards a
* compeleted, final release. A specific development drop
- *
+ *
* may not completely implement all aspects of a new
* feature, which may take several development drops to
* complete. At the point of the final drop for the
* release, the D suffix will be omitted.
- *
+ *
* Each 'D' drops can contain functional enhancements as
* well as defect fixes. 'D' drops may not be as stable as
* the final releases.
1.48 +45 -78 xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
Index: XSLTEngineImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- XSLTEngineImpl.java 2000/02/23 23:03:29 1.47
+++ XSLTEngineImpl.java 2000/02/24 21:11:03 1.48
@@ -73,59 +73,23 @@
import org.apache.xalan.xpath.xml.XSLMessages;
/**
- * Collaborates with the XML parser liaison, the DOM,
- * and the XPath engine, to transform a source tree
- * of nodes into a result tree according to instructions
- * and templates specified by a stylesheet tree.
- * The methods <code>process(...)</code> are the primary
- * public entry points. The best way to call the processor
- * classes is to use the
- * <A HREF="#process(org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTInputSource, org.apache.xalan.xslt.XSLTResultTarget)">process( XSLTInputSource inputSource, XSLTInputSource stylesheetSource, XSLTResultTarget outputTarget)</A>
- * method, but you may use any of process methods that are provided for
- * convenience.
+ * <meta name="usage" content="advanced"/>
+ * The Xalan workhorse -- Collaborates with the XML parser liaison, the DOM,
+ * and the XPath engine, to transform a source tree of nodes into a result tree
+ * according to instructions and templates specified by a stylesheet tree.
+ * We suggest you use one of the
+ * static XSLTProcessorFactory getProcessor() methods to instantiate the processor
+ * and return an interface that greatly simplifies the process of manipulating
+ * XSLTEngineImpl.
*
- * Example:<br><br>
+ * <p>The methods <code>process(...)</code> are the primary public entry points.
+ * The best way to perform transformations is to use the
+ * {@link XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)} method,
+ * but you may use any of process methods defined in XSLTEngineImpl.</p>
*
- * foo.xml:<br><PRE>
- * <?xml version="1.0"?>
- * <doc>Hello</doc>
- * </PRE>
- * foo.xsl:<br><PRE>
- * <?xml version="1.0"?>
- * <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
- * <xsl:template match="doc">
- * <out><xsl:value-of select="."/></out>
- * </xsl:template>
- * </xsl:stylesheet>
- * </PRE>
- * transform.java:<br><PRE>
- * package uri2stream;
- *
- * import org.xml.sax.SAXException;
- * import org.apache.xalan.xpath.XPathException;
- * import org.apache.xalan.xslt.XSLTEngineImpl;
- * import java.io.PrintWriter;
- * import java.io.FileWriter;
- *
- * public class transform
- * {
- * public static void main(String[] args)
- * throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
- * {
- * XSLTEngineImpl processor = new XSLProcessor();
- * PrintWriter pw = new PrintWriter( new FileWriter("foo.out") );
- * processor.process("foo.xml", "foo.xsl", pw);
- * }
- * }
- * </PRE>
- * foo.out:<br><PRE>
- * <out>Hello</out>
- * </PRE>
- * Look at the Process class
- * for an advanced example of usage by the main() function.
- *
- * <p>If you reuse the processor instance, you should call reset() between calls.</p>
- *
+ * <p>If you reuse the processor instance, you should call reset() between transformations.</p>
+ * @see XSLTProcessorFactory
+ * @see XSLTProcessor
*/
public class XSLTEngineImpl implements XPathEnvSupport, XSLTProcessor
{
@@ -378,8 +342,12 @@
private void ____CONSTRUCTORS____(){}
/**
- * Construct an XSL processor that uses the XML4J fast DOM liaison
- * by default.
+ * Construct an XSLT processor that uses the default DTM (Document Table Model) liaison
+ * and XML parser. As a general rule, you should use XSLTProcessorFactory to create an
+ * instance of this class and provide access to the instance via the XSLTProcessor interface.
+ *
+ * @see XSLTProcessorFactory
+ * @see XSLTProcessor
*/
protected XSLTEngineImpl()
throws org.xml.sax.SAXException
@@ -400,11 +368,12 @@
}
/**
- * Construct an XSL processor that uses the the given parser liaison.
- * (This must be made public for use by derived classes and so it
- * can also be accessed by the XSLTProcessorFactory. But, normally,
- * one should use the XSLTProcessorFactory to create an instance of
- * this class.)
+ * Construct an XSLT processor that uses the the given parser liaison.
+ * As a general rule, you should use XSLTProcessorFactory to create an
+ * instance of this class and provide access to the instance via the XSLTProcessor interface.
+ *
+ * @see XSLTProcessorFactory
+ * @see XSLTProcessor
*/
public XSLTEngineImpl(String parserLiaisonClassName)
throws org.xml.sax.SAXException
@@ -425,16 +394,14 @@
/**
* Construct an XSL processor that uses the the given parser liaison.
- * (This must be made public for use by derived classes and so it
- * can also be accessed by the XSLTProcessorFactory. But, normally,
- * one should use the XSLTProcessorFactory to create an instance of
- * this class.)
- * @param XMLParserLiaison A liaison to an object
- * that can help with stuff
- * specific to a parser
- * implementation.
- * @see org.apache.xalan.xslt.XMLParserLiaison
- * @see org.apache.xalan.xslt.xml4j.ProcessXSL
+ * As a general rule, you should use XSLTProcessorFactory to create an
+ * instance of this class and provide access to the instance via the XSLTProcessor interface.
+ *
+ * @param XMLParserLiaison A liaison to an XML parser.
+ *
+ * @see org.apache.xalan.xpath.xml.XMLParserLiaison
+ * @see XSLTProcessorFactory
+ * @see XSLTProcessor
*/
public XSLTEngineImpl(XMLParserLiaison parserLiason)
{
@@ -443,15 +410,14 @@
}
/**
- * Construct an XSL processor that can call back to
- * a XML processor, so it can handle included files,
- * and the like.
- * @param XMLParserLiaison A liaison to an object
- * that can help with stuff
- * specific to a parser
- * implementation.
- * @see org.apache.xalan.xslt.XMLParserLiaison
- * @see org.apache.xalan.xslt.xml4j.ProcessXSL
+ * Construct an XSLT processor that can call back to the XML parser, in order to handle
+ * included files and the like.
+ *
+ * @param XMLParserLiaison A liaison to an XML parser.
+ *
+ * @see org.apache.xalan.xpath.xml.XMLParserLiaison
+ * @see XSLTProcessorFactory
+ * @see XSLTProcessor
*/
XSLTEngineImpl(XMLParserLiaison parserLiason, XPathFactory xpathFactory)
{
@@ -501,7 +467,8 @@
/**
* Transform the source tree to the output in the given
- * result tree target.
+ * result tree target. As a general rule, we recommend you use the
+ * {@link XSLTProcessor#Process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)} method.
* @param inputSource The input source.
* @param stylesheetSource The stylesheet source. May be null if source has a xml-stylesheet PI.
* @param outputTarget The output source tree.
1.3 +70 -50 xml-xalan/src/org/apache/xalan/xslt/XSLTInputSource.java
Index: XSLTInputSource.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTInputSource.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSLTInputSource.java 1999/11/29 06:28:47 1.2
+++ XSLTInputSource.java 2000/02/24 21:11:04 1.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -63,41 +63,43 @@
/**
* Represents an XML source document or XSL stylesheet.
- * <p>Use XSLTInputSource objects to provide input to the XSLTProcessor process() method
- * for a transformation. This class extends the SAX input source to handle
- * DOM nodes as input in addition to the other input forms.
+ * Use XSLTInputSource objects to provide input to the XSLTProcessor process() method
+ * for a transformation. This class extends the SAX input source to handle
+ * DOM nodes as input as well as files, character streams, byte streams and SAX DocumentHandlers.
+ *
* @see XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
*/
public class XSLTInputSource extends InputSource
{
/**
- * Zero-argument default constructor.
+ * Zero-argument default constructor -- Before you can use the new XSLTInputSource object in a transformation,
+ * you must define the document source with setSystemId(), setNode(), setByteStream(), or setCharacterStream().
*
- * @see #setPublicId
- * @see #setSystemId
+ * @see #setSystemId(String)
+ * @see #setNode(Node)
* @see #setByteStream
* @see #setCharacterStream
- * @see #setEncoding
+ * @see #setEncoding(String)
+ * @see #setPublicId(String)
*/
public XSLTInputSource ()
{
}
/**
- * Create a new input source with a system identifier.
- *
- * <p>Applications may use setPublicId to include a
- * public identifier as well, or setEncoding to specify
- * the character encoding, if known.</p>
- *
- * <p>If the system identifier is a URL, it must be full resolved.</p>
+ * Create a new input source with a system identifier (for a URL or file name) --
+ * the equivalent of creating an input source with the zero-argument
+ * constructor and setting the new object's SystemId property.
+
+ * If the system identifier is a URL, it must be fully resolved.
*
* @param systemId The system identifier (URI).
- * @see #setPublicId
- * @see #setSystemId
+ * @see #setSystemId(String)
+ * @see #setNode(Node)
* @see #setByteStream
- * @see #setEncoding
+ * @see #setEncoding(String)
* @see #setCharacterStream
+ * @see #setPublicId(String)
*/
public XSLTInputSource (String systemId)
{
@@ -106,14 +108,16 @@
/**
- * Create a new input source with a byte stream.
- *
- * <p>Application writers may use setSystemId to provide a base
- * for resolving relative URIs, setPublicId to include a
- * public identifier, and/or setEncoding to specify the object's
- * character encoding.</p>
+ * Create a new input source with a byte stream -- the equivalent of creating an input source
+ * with the zero-argument constructor and setting the new object's ByteStream property.
*
* @param byteStream The raw byte stream containing the document.
+ * @see #setByteStream
+ * @see #setSystemId(String)
+ * @see #setNode(Node)
+ * @see #setEncoding(String)
+ * @see #setCharacterStream
+ * @see #setPublicId(String)
*/
public XSLTInputSource (InputStream byteStream)
{
@@ -121,25 +125,34 @@
}
/**
- * Create a new input source with a character stream.
+ * Create a new input source with a character stream -- the equivalent of creating an input source
+ * with the zero-argument constructor and setting the new object's CharacterStream property.
+ * <p>The character stream shall not include a byte order mark.</p>
*
- * <p>Application writers may use setSystemId() to provide a base
- * for resolving relative URIs, and setPublicId to include a
- * public identifier.</p>
+ * @param characterStream The character stream containing the document.
+ * @see #setCharacterStream
+ * @see #setByteStream
+ * @see #setSystemId(String)
+ * @see #setNode(Node)
+ * @see #setEncoding(String)
+ * @see #setPublicId(String)
*/
public XSLTInputSource (Reader characterStream)
{
setCharacterStream(characterStream);
}
-
+
/**
- * Create a new input source with a DOM node.
+ * Create a new input source with a DOM Node -- the equivalent of creating an input source
+ * with the zero-argument constructor and setting the new object's Node property.
*
- * <p>Application writers may use setSystemId() to provide a base
- * for resolving relative URIs, and setPublicId to include a
- * public identifier.</p>
- *
- * <p>The character stream shall not include a byte order mark.</p>
+ * @param node The DOM Node containing the document.
+ * @see #setNode(Node)
+ * @see #setCharacterStream
+ * @see #setByteStream
+ * @see #setSystemId(String)
+ * @see #setEncoding(String)
+ * @see #setPublicId(String)
*/
public XSLTInputSource (Node node)
{
@@ -148,6 +161,15 @@
/**
* Create a new XSLTInputSource source from a SAX input source.
+ * This operation sets the ByteStream, CharacterStream, SystemId, PublicID, and Encoding properties.
+ *
+ * @param isource The SAX input source.
+ * @see #setCharacterStream
+ * @see #setByteStream
+ * @see #setSystemId(String)
+ * @see #setEncoding(String)
+ * @see #setPublicId(String)
+ * @see #setNode(Node)
*/
public XSLTInputSource (InputSource isource)
{
@@ -159,15 +181,12 @@
}
/**
- * Set the character stream for this input source.
- *
- * <p>If there is a character stream specified, the SAX parser
- * will ignore any byte stream and will not attempt to open
- * a URI connection to the system identifier.</p>
+ * Set the DOM Node for this input source.
*
* @param characterStream The character stream containing the
- * XML document or other entity.
- * @see #getCharacterStream
+ * XML document or XSL stylesheet.
+ * @see #XSLTInputSource(Node)
+ * @see #getCharacterStream()
* @see java.io.Reader
*/
public void setNode (Node node)
@@ -176,10 +195,11 @@
}
/**
- * Get the character stream for this input source.
+ * Get the DOM Node for this input source.
*
- * @return The character stream, or null if none was supplied.
- * @see #setCharacterStream
+ * @return The DOM node containing the document, or null if none was supplied.
+ * @see #XSLTInputSource(Node)
+ * @see #setNode(Node)
*/
public Node getNode ()
{
@@ -187,5 +207,5 @@
}
private Node node = null;
-
+
}
1.10 +1 -1 xml-xalan/src/org/apache/xalan/xslt/XSLTProcessor.java
Index: XSLTProcessor.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTProcessor.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XSLTProcessor.java 2000/02/23 23:03:29 1.9
+++ XSLTProcessor.java 2000/02/24 21:11:04 1.10
@@ -154,7 +154,7 @@
/**
* Get the DOM Node from the XSLTInputSource object. Returns null if the XSLTInputSource
- * object does not contain a Node (may, for example, contain an input stream).
+ * object does not contain a Node (it may, for example, contain an input stream).
*/
public Node getSourceTreeFromInput(XSLTInputSource inputSource)
throws org.xml.sax.SAXException;
1.4 +36 -20 xml-xalan/src/org/apache/xalan/xslt/XSLTProcessorFactory.java
Index: XSLTProcessorFactory.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTProcessorFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLTProcessorFactory.java 1999/12/01 20:08:50 1.3
+++ XSLTProcessorFactory.java 2000/02/24 21:11:04 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -66,10 +66,11 @@
public class XSLTProcessorFactory
{
/**
- * Get a new XSLTProcessor. You must set XSLTProcessor properties before you
- * can use it to perform a transformation.
- * @return An implentation of the XSLTProcessor interface with which you
- * can perform transformations.
+ * Get a new XSLTProcessor with the default high-performance DTM (Document Table Model) liaison and XML parser.
+ * <p><b>Note</b> If you want to process DOM Node input, use {@link #getProcessorUsingLiaisonName
+ * getProcessorUsingLiaisonName(org.apache.xalan.xdom.XercesLiaison)}.</p>
+ * @return An implentation of the XSLTProcessor interface with which you can perform transformations.
+ * @see org.apache.xalan.xpath.dtm.DTMLiaison
*/
public static XSLTProcessor getProcessor()
throws org.xml.sax.SAXException
@@ -79,13 +80,17 @@
/**
* Get a new XSLTProcessor that will use a given XMLParserLiaison class to interact with
- * a given XML parser. Do not use this method if you plan to use the
- * the XMLParserLiaisonDefault class and the XML4J Parser.
+ * a given XML parser. You can use this method, for example, if you are processing DOM Node input with
+ * org.apache.xalan.xpath.xdom.XercesLiaison and the Xerces XML parser.
+ * <p>If your input is in the form of
+ * a file, character stream, byte stream, or SAX DocumentHandler, you may want to use the high-performance
+ * DTM liaison and parser, in which case you can use the no-argument constructor.</p>
* @param parserLiaisonClassName The name of the ParserLiaison class.
- * @param dummy Dummy argument (true, false, or null -- makes no difference)included a unique method signature.
- * @return An implentation of the XSLTProcessor interface with which you
- * can perform transformations.
+ * @return An implentation of the XSLTProcessor interface with which you can perform transformations.
+ *
+ * @see #getProcessor()
* @see org.apache.xalan.xpath.xml.XMLParserLiaison
+ * @see org.apache.xalan.xpath.dtm.DTMLiaison
*/
public static XSLTProcessor getProcessorUsingLiaisonName(String parserLiaisonClassName)
throws org.xml.sax.SAXException
@@ -95,11 +100,16 @@
/**
* Get a new XSLTProcessor that will use the specified XMLParserLiaison to interact
- * with a given XML parser. Do not use this method if you
- * plan to use the XMLParserLiaisonDefault class and the XML4J Parser.
+ * with a given XML parser. If your input is in the form of
+ * a file, character stream, byte stream, or SAX DocumentHandler, you may want to use the high-performance
+ * DTM liaison and parser, in which case you can use the no-argument getProcessor() method.
+ *
* @param parserLiaison the XMLParserLiaison set up to interact with a given XML parser.
- * @return An implentation of the XSLTProcessor interface with which you
- * can perform transformations.
+ * @return An implentation of the XSLTProcessor interface with which you can perform transformations.
+ *
+ * @see #getProcessor()
+ * @see org.apache.xalan.xpath.xml.XMLParserLiaison
+ * @see org.apache.xalan.xpath.dtm.DTMLiaison
*/
public static XSLTProcessor getProcessor(XMLParserLiaison parserLiaison)
{
@@ -108,12 +118,18 @@
/**
* Get a new XSLTProcessor that will use the specified XMLParserLiaison and XPathFactory to interact
- * with a given XML parser. Do not use this method if you
- * plan to use the XMLParserLiaisonDefault class, the XML4J Parser, and the default XPathFactory.
+ * with a given XML parser. If your input is in the form of
+ * a file, character stream, byte stream, or SAX DocumentHandler, you may want to use the high-performance
+ * DTM liaison and parser, in which case you can use the no-argument getProcessor() method.
+ *
* @param parserLiaison the XMLParserLiaison set up to interact with a given XML parser.
* @param xpathFactory A custom XPathFactory.
* @return An implentation of the XSLTProcessor interface with which you
* can perform transformations.
+ *
+ * @see #getProcessor()
+ * @see org.apache.xalan.xpath.xml.XMLParserLiaison
+ * @see org.apache.xalan.xpath.dtm.DTMLiaison
*/
public static XSLTProcessor getProcessor(XMLParserLiaison parserLiaison,
XPathFactory xpathFactory)
1.4 +136 -44 xml-xalan/src/org/apache/xalan/xslt/XSLTResultTarget.java
Index: XSLTResultTarget.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTResultTarget.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSLTResultTarget.java 2000/02/21 20:44:51 1.3
+++ XSLTResultTarget.java 2000/02/24 21:11:04 1.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,15 +18,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "XSLT4J" and "Apache Software Foundation" must
+ * 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -62,28 +62,45 @@
import org.xml.sax.DocumentHandler;
/**
- * Contains the result of a transformation that you perform with the
- * XSLTProcessor process() method.
- * <p> Create an instance of this class to provide process() a container for the XSLT
- * result tree. This class is modeled after the SAX InputSource class, except that it
- * is for the XSLT Result tree, and in addition to streams, writers, and
- * filenames, it also can specify a DOM node, or a DocumentHandler
- * or FormatterListener.
- * @see XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
- */
+ * Contains the result of a transformation that you perform with the
+ * XSLTProcessor process() method or one of the StylesheetRoot process() methods.
+ * Create an instance of this class to provide the process() method a container
+ * for the transformation result tree.
+ * You can use a file name or URL, character stream, byte stream, DOM Node, or SAX DocumentHandler
+ * to instantiate an XSLTResultTarget object.
+ *
+ * @see XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget)
+ * @see StylesheetRoot
+ */
public class XSLTResultTarget
{
/**
- * Zero-argument default constructor.
- */
+ * Zero-argument default constructor -- Before you can use the new XSLTResultTarget object in a transformation,
+ * you must define the output container by setting its FileName, CharacterStrea, ByteStream, or Node property.
+ *
+ * @see #setFileName(String)
+ * @see #setCharacterStream(Writer)
+ * @see #setByteStream(OutputStream)
+ * @see #setNode(Node)
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setEncoding(String)
+ */
public XSLTResultTarget ()
{
}
/**
- * Create a new output target with a file name.
+ * Create a new output target with a file name -- the equivalent of creating an output target
+ * with the zero-argument constructor and setting the new object's FileName property.
*
- * @param fileName Must be a valid system file name.
+ * @param fileName Identifies the file that will contain the transformation result (must be a valid system file name).
+ *
+ * @see #setFileName(String)
+ * @see #setCharacterStream(Writer)
+ * @see #setByteStream(OutputStream)
+ * @see #setNode(Node)
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setEncoding(String)
*/
public XSLTResultTarget (String fileName) // File?
{
@@ -92,10 +109,19 @@
/**
- * Create a new output target with a byte stream.
+ * Create a new output target with a byte stream -- the equivalent of creating an output target
+ * with the zero-argument constructor and setting the new object's ByteStream property.
+ *
+ * @param byteStream The raw byte stream that will contain the transformation result.
*
- * @param byteStream The raw byte stream that will contain the document.
+ * @see #setByteStream(OutputStream)
+ * @see #setFileName(String)
+ * @see #setCharacterStream(Writer)
+ * @see #setNode(Node)
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setEncoding(String)
*/
+
public XSLTResultTarget (OutputStream byteStream)
{
setByteStream(byteStream);
@@ -103,30 +129,54 @@
/**
- * Create a new output target with a character stream.
+ * Create a new output target with a character stream -- the equivalent of creating an output target
+ * with the zero-argument constructor and setting the new object's CharacterStream property.
+ *
+ * @param characterStream The character stream where the transformation result is written.
*
- * @param characterStream The character stream where the results will be written.
- */
+ * @see #setCharacterStream(Writer)
+ * @see #setByteStream(OutputStream)
+ * @see #setFileName(String)
+ * @see #setNode(Node)
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setEncoding(String)
+ */
public XSLTResultTarget (Writer characterStream)
{
setCharacterStream(characterStream);
}
/**
- * Create a new output target with a character stream.
+ * Create a new output target with a DOM Node -- the equivalent of creating an output target
+ * with the zero-argument constructor and setting the new object's Node property.
*
- * @param characterStream The character stream where the results will be written.
+ * @param node The DOM Node that will contain the transformation result.
+ *
+ * @see #setNode(Node)
+ * @see #setCharacterStream(Writer)
+ * @see #setByteStream(OutputStream)
+ * @see #setFileName(String)
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setEncoding(String)
*/
public XSLTResultTarget (Node n)
{
setNode(n);
}
-
+
/**
- * Create a new output target with a SAX Document handler, which
- * will handle result events.
- *
- * @param handler The SAX Document handler to which the results will be written.
+ * Create a new output target with a SAX Document handler, which
+ * will handle result events -- the equivalent of creating an output target with the
+ * zero-argument constructor and setting the new object's DocyumentHandler property.
+ *
+ * @param handler The SAX Document handler to which the result is written.
+ *
+ * @see #setDocumentHandler(DocumentHandler)
+ * @see #setNode(Node)
+ * @see #setCharacterStream(Writer)
+ * @see #setByteStream(OutputStream)
+ * @see #setFileName(String)
+ * @see #setEncoding(String)
*/
public XSLTResultTarget(DocumentHandler handler)
{
@@ -134,9 +184,12 @@
}
/**
- * Set the file name where the results will be written.
+ * Set the file name or URL where the transformation result will be written.
*
* @param fileName The system identifier as a string.
+ *
+ * @see #XSLTResultTarget(String)
+ * @see #getFileName
*/
public void setFileName (String fileName) // File?
{
@@ -145,9 +198,12 @@
/**
- * Get the file name where the results will be written to.
- *
- * @return The file name.
+ * Get the file name where the results are or will be written, or null if none was supplied.
+ *
+ * @return The file name or URL.
+ *
+ * @see #XSLTResultTarget(String)
+ * @see #setFileName(String)
*/
public String getFileName ()
{
@@ -156,9 +212,12 @@
/**
- * Set the byte stream for this output target.
+ * Set the byte stream to contain the transformation result.
+ *
+ * @param byteStream A byte stream that will contain the transformation result.
*
- * @param byteStream A byte stream that will contain the result document.
+ * @see #XSLTResultTarget(OutputStream)
+ * @see #setByteStream(OutputStream)
*/
public void setByteStream (OutputStream byteStream)
{
@@ -167,9 +226,12 @@
/**
- * Get the byte stream for this output target.
+ * Get the byte stream that contains or will contain the transformation result.
*
* @return The byte stream, or null if none was supplied.
+ *
+ * @see #XSLTResultTarget(OutputStream)
+ * @see #setByteStream(OutputStream)
*/
public OutputStream getByteStream ()
{
@@ -179,6 +241,8 @@
/**
* Set the character encoding, if known.
+ *
+ * @param encoding The character encoding.
*/
public void setEncoding (String encoding)
{
@@ -200,8 +264,11 @@
/**
* Set the character stream for this output target.
*
- * @param characterStream The character stream that will contain
- * the result document.
+ * @param characterStream The character stream that will contain
+ * the transformation result.
+ *
+ * @see #XSLTResultTarget(Writer)
+ * @see #getCharacterStream
*/
public void setCharacterStream (Writer characterStream)
{
@@ -213,6 +280,9 @@
* Get the character stream for this output target.
*
* @return The character stream, or null if none was supplied.
+ *
+ * @see #XSLTResultTarget(Writer)
+ * @see #setCharacterStream(Writer)
*/
public Writer getCharacterStream ()
{
@@ -220,7 +290,12 @@
}
/**
- * Set the node that will contain the result nodes.
+ * Set the DOM Node that will contain the transformation reasult.
+ *
+ * @param node DOM Node where the transformation result is placed.
+ *
+ * @see #XSLTResultTarget(Node)
+ * @see #getNode()
*/
public void setNode (Node node)
{
@@ -228,15 +303,25 @@
}
/**
- * Get the node that will contain the result nodes.
+ * Get the DOM Node that contains or will contain the transformation result.
+ *
+ * @see #XSLTResultTarget(Node)
+ * @see #setNode(Node)
*/
public Node getNode ()
{
return node;
}
-
+
/**
* Set a SAX DocumentHandler to process the result tree events.
+ * You can process events as they occur
+ * rather than waiting for the transformation to be completed.
+ *
+ * @param handler The SAX DocumentHandler to process result tree events.
+ *
+ * @see #XSLTResultTarget(DocumentHandler)
+ * @see #getDocumentHandler()
*/
public void setDocumentHandler (DocumentHandler handler)
{
@@ -244,13 +329,20 @@
}
/**
- * Get the SAX DocumentHandler that will process the result tree events.
+ * Get the SAX DocumentHandler that processes the result tree events.
+ * You can use the DocumentHandler to process events as they occur
+ * rather than waiting for the transformation to be completed.
+ *
+ * @return The SAX DocumentHandler that processes result tree events.
+ *
+ * @see #XSLTResultTarget(DocumentHandler)
+ * @see #setDocumentHandler(DocumentHandler)
*/
public DocumentHandler getDocumentHandler ()
{
return formatterListener;
}
-
+
//////////////////////////////////////////////////////////////////////
// Internal state.
//////////////////////////////////////////////////////////////////////