You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mo...@apache.org on 2001/10/31 09:31:57 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Parser.java Stylesheet.java
morten 01/10/31 00:31:57
Modified: java/src/org/apache/xalan/xsltc/compiler Parser.java
Stylesheet.java
Log:
Fix for simplified stylesheets. A namespace declaration on the root element
in the stylesheet (xmlns="http://www.w3.org/TR/xhtml1/strict") caused XSLTC
to try to match elements in this namespace instead of elements in the null
namespace.
PR: bugzilla 3664
Obtained from: n/a
Submitted by: morten@xml.apache.org
Reviewed by: morten@xml.apache.org
Revision Changes Path
1.31 +3 -1 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Parser.java 2001/10/30 16:19:45 1.30
+++ Parser.java 2001/10/31 08:31:56 1.31
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Parser.java,v 1.30 2001/10/30 16:19:45 morten Exp $
+ * @(#)$Id: Parser.java,v 1.31 2001/10/31 08:31:56 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -322,6 +322,8 @@
stylesheet = new Stylesheet();
stylesheet.setSimplified();
stylesheet.addElement(element);
+ stylesheet.setAttributes(element.getAttributes());
+ element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING);
}
stylesheet.setParser(this);
return stylesheet;
1.29 +10 -9 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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Stylesheet.java 2001/10/30 08:42:55 1.28
+++ Stylesheet.java 2001/10/31 08:31:56 1.29
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Stylesheet.java,v 1.28 2001/10/30 08:42:55 morten Exp $
+ * @(#)$Id: Stylesheet.java,v 1.29 2001/10/31 08:31:56 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -310,14 +310,15 @@
public void parseContents(Parser parser) {
final SymbolTable stable = parser.getSymbolTable();
- // Make sure the XSL version set in this stylesheet
- _version = getAttribute("version");
- if ((_version == null) || (_version.equals(EMPTYSTRING))) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "version");
- }
- // Verify that the version is 1.0 and nothing else
- else if (!_version.equals("1.0")) {
- reportError(this, parser, ErrorMsg.XSL_VERSION_ERR, _version);
+ if (!_simplified) {
+ // Make sure the XSL version set in this stylesheet
+ if ((_version == null) || (_version.equals(EMPTYSTRING))) {
+ reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR,"version");
+ }
+ // Verify that the version is 1.0 and nothing else
+ else if (!_version.equals("1.0")) {
+ reportError(this, parser, ErrorMsg.XSL_VERSION_ERR, _version);
+ }
}
// Add the implicit mapping of 'xml' to the XML namespace URI
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org