morten 01/10/19 04:58:40
Modified: java/src/org/apache/xalan/xsltc/compiler Include.java
Stylesheet.java XSLTC.java
Log:
Cleaned up the include/import precedence code in Import and Include
PR: bugzilla 2695
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.9 +2 -1
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java
Index: Include.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Include.java 2001/09/06 13:45:06 1.8
+++ Include.java 2001/10/19 11:58:40 1.9
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Include.java,v 1.8 2001/09/06 13:45:06 tmiller Exp $
+ * @(#)$Id: Include.java,v 1.9 2001/10/19 11:58:40 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -118,6 +118,7 @@
_included.setSourceLoader(loader);
_included.setSystemId(docToLoad);
_included.setParentStylesheet(context);
+ _included.setIncludingStylesheet(context);
// An included stylesheet gets the same import precedence
// as the stylesheet that included it.
1.22 +12 -5
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
Index: Stylesheet.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Stylesheet.java 2001/09/26 10:26:13 1.21
+++ Stylesheet.java 2001/10/19 11:58:40 1.22
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Stylesheet.java,v 1.21 2001/09/26 10:26:13 morten Exp $
+ * @(#)$Id: Stylesheet.java,v 1.22 2001/10/19 11:58:40 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -111,6 +111,7 @@
private final Hashtable _extensions = new Hashtable();
public Stylesheet _importedFrom = null;
+ public Stylesheet _includedFrom = null;
private int _importPrecedence = 1;
private Mode _defaultMode;
private boolean _multiDocument = false;
@@ -146,7 +147,6 @@
}
public void setImportPrecedence(final int precedence) {
- //System.err.println("PREC="+precedence+" for "+getSystemId());
// Set import precedence for this stylesheet
_importPrecedence = precedence;
@@ -156,9 +156,7 @@
SyntaxTreeNode child = (SyntaxTreeNode)elements.nextElement();
if (child instanceof Include) {
Stylesheet included = ((Include)child).getIncludedStylesheet();
- if (included != null) {
- included.setImportPrecedence(precedence);
- }
+ if (included != null) included.setImportPrecedence(precedence);
}
}
@@ -170,6 +168,11 @@
_importedFrom.setImportPrecedence(nextPrecedence);
}
}
+ // Set import precedence for the stylesheet that imported this one
+ else if (_includedFrom != null) {
+ if (_includedFrom.getImportPrecedence() != precedence)
+ _includedFrom.setImportPrecedence(precedence);
+ }
}
public int getImportPrecedence() {
@@ -201,6 +204,10 @@
}
public void setImportingStylesheet(Stylesheet parent) {
+ _importedFrom = parent;
+ }
+
+ public void setIncludingStylesheet(Stylesheet parent) {
_importedFrom = parent;
}
1.28 +1 -7
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java
Index: XSLTC.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- XSLTC.java 2001/10/18 11:46:24 1.27
+++ XSLTC.java 2001/10/19 11:58:40 1.28
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: XSLTC.java,v 1.27 2001/10/18 11:46:24 morten Exp $
+ * @(#)$Id: XSLTC.java,v 1.28 2001/10/19 11:58:40 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -602,12 +602,6 @@
return code.intValue();
}
- /*
- public int nextVariableSerial() {
- return _variableSerial++;
- }
- */
-
public int nextModeSerial() {
return _modeSerial++;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]