You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@locus.apache.org on 2000/07/28 19:13:02 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xslt StylesheetHandler.java XSLTEngineImpl.java
mmidy 00/07/28 10:13:01
Modified: java/src/org/apache/xalan/processor XSLTElementDef.java
XSLTSchema.java
java/src/org/apache/xalan/stree Child.java ElementImpl.java
java/src/org/apache/xalan/templates ElemLiteralResult.java
java/src/org/apache/xalan/xslt StylesheetHandler.java
XSLTEngineImpl.java
Log:
Add an entry in XSLTSchema for xsl attributes to be ignored in LRE output
Revision Changes Path
1.3 +5 -1 xml-xalan/java/src/org/apache/xalan/processor/XSLTElementDef.java
Index: XSLTElementDef.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTElementDef.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSLTElementDef.java 2000/07/26 21:20:19 1.2
+++ XSLTElementDef.java 2000/07/28 17:12:51 1.3
@@ -270,7 +270,11 @@
XSLTAttributeDef attrDef = attrDefs[k];
String uriDef = attrDef.getNamespace();
String nameDef = attrDef.getName();
- if(nameDef.equals("*"))
+ if(nameDef.equals("*") && equalsMayBeNullOrZeroLen(uri, uriDef))
+ {
+ return attrDef;
+ }
+ else if(nameDef.equals("*") )
{
// In this case, all attributes are legal, so return
// this as the last resort.
1.3 +4 -1 xml-xalan/java/src/org/apache/xalan/processor/XSLTSchema.java
Index: XSLTSchema.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/XSLTSchema.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSLTSchema.java 2000/07/26 21:20:19 1.2
+++ XSLTSchema.java 2000/07/28 17:12:51 1.3
@@ -250,6 +250,9 @@
XSLTAttributeDef resultAttr
= new XSLTAttributeDef(null, "*", XSLTAttributeDef.T_AVT, false);
+
+ XSLTAttributeDef xslResultAttr
+ = new XSLTAttributeDef(Constants.S_XSLNAMESPACEURL, "*", XSLTAttributeDef.T_CDATA, false);
XSLTElementDef[] templateElements = new XSLTElementDef[20];
XSLTElementDef[] templateElementsAndParams = new XSLTElementDef[21];
@@ -264,7 +267,7 @@
xslExcludeResultPrefixesAttr,
xslExtensionElementPrefixesAttr,
xslUseAttributeSetsAttr,
- xslVersionAttr, resultAttr},
+ xslVersionAttr, xslResultAttr, resultAttr},
new ProcessorLRE(),
ElemLiteralResult.class /* class object */ );
1.3 +2 -2 xml-xalan/java/src/org/apache/xalan/stree/Child.java
Index: Child.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/Child.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Child.java 2000/07/05 14:39:02 1.2
+++ Child.java 2000/07/28 17:12:55 1.3
@@ -98,7 +98,7 @@
/**
* <meta name="usage" content="internal"/>
* Get the value of K. K is the maximum width of the tree.
- */
+ *
public int getK()
{
return getDocumentImpl().getK();
@@ -108,7 +108,7 @@
* <meta name="usage" content="internal"/>
* Get the value of Y. Y is the maximum depth of the tree.
* Needed to calculate depth-first (document order) numbering.
- */
+ *
public int getY()
{
return getDocumentImpl().getY();
1.4 +1 -0 xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java
Index: ElementImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/ElementImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElementImpl.java 2000/07/21 20:57:00 1.3
+++ ElementImpl.java 2000/07/28 17:12:56 1.4
@@ -72,6 +72,7 @@
public Node getFirstChild()
{
// The call to getAttrCount gets the number of attributes in the list.
+ // The attributes are put in the list before the actual children.
return (getChildCount() == 0) ? null : getChild(getAttrCount());
}
1.3 +19 -3 xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java
Index: ElemLiteralResult.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ElemLiteralResult.java 2000/07/05 14:40:10 1.2
+++ ElemLiteralResult.java 2000/07/28 17:12:58 1.3
@@ -65,6 +65,7 @@
import org.apache.xpath.XPathContext;
import org.apache.xalan.utils.StringToStringTable;
import org.apache.xalan.utils.NameSpace;
+import org.apache.xalan.utils.StringVector;
import org.apache.xalan.res.XSLTErrorResources;
import org.apache.xalan.transformer.TransformerImpl;
import org.apache.xalan.transformer.ResultTreeHandler;
@@ -87,17 +88,29 @@
*/
private Vector m_avts = null;
+ private Vector m_xslAttr = null;
+
/**
- * Set a literal result attribute.
+ * Set a literal result attribute (AVTs only).
*/
public void addLiteralResultAttribute(AVT avt)
{
if(null == m_avts)
m_avts = new Vector();
- m_avts.addElement(avt);
+ m_avts.addElement(avt);
}
/**
+ * Set a literal result attribute (used for xsl attributes).
+ */
+ public void addLiteralResultAttribute(String att)
+ {
+ if(null == m_xslAttr)
+ m_xslAttr = new Vector();
+ m_xslAttr.addElement(att);
+ }
+
+ /**
* Get a literal result attribute by name.
*/
public AVT getLiteralResultAttribute(String name)
@@ -115,7 +128,7 @@
} // end for
}
return null;
- }
+ }
/**
* The namespace of the element to be created.
@@ -209,6 +222,7 @@
// TODO: Need prefix.
return m_rawName;
}
+
/**
* Copy a Literal Result Element into the Result tree, copy the
@@ -227,6 +241,8 @@
// Process any possible attributes from xsl:use-attribute-sets first
super.execute(transformer, sourceNode, mode);
+
+ //xsl:version, excludeResultPrefixes???
// Add namespace declarations.
executeNSDecls(transformer);
1.2 +8 -0 xml-xalan/java/src/org/apache/xalan/xslt/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xslt/StylesheetHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StylesheetHandler.java 2000/07/25 16:05:44 1.1
+++ StylesheetHandler.java 2000/07/28 17:12:59 1.2
@@ -91,4 +91,12 @@
public void startElement (String name, AttributeList atts)
throws SAXException
{}
+
+ /**
+ * Return the stylesheet that this handler is constructing.
+ */
+ void pushStylesheet(org.apache.xalan.templates.Stylesheet s)
+ {
+ this.pushStylesheet(s);
+ }
}
1.2 +5 -2 xml-xalan/java/src/org/apache/xalan/xslt/XSLTEngineImpl.java
Index: XSLTEngineImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSLTEngineImpl.java 2000/07/25 16:05:44 1.1
+++ XSLTEngineImpl.java 2000/07/28 17:12:59 1.2
@@ -473,8 +473,9 @@
IOException, SAXException
{
if (baseIdentifier == null)
- return new StylesheetRoot(this, baseIdentifier);
-
+ {
+ return new StylesheetRoot(this, baseIdentifier);
+ }
Templates templates = m_processor.process(new InputSource(baseIdentifier));
return (StylesheetRoot)((StylesheetHandler)(m_processor.getTemplatesBuilder())).getStylesheetRoot();
//this, baseIdentifier);
@@ -715,6 +716,8 @@
FileNotFoundException,
IOException
{
+ //TODO:Question for Scott: StylesheetPIHandler??
+
StylesheetRoot m_stylesheetRoot = null;
Stylesheet stylesheet = null;
String[] stringHolder =