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...@apache.org on 2001/11/08 21:15:48 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/processor ProcessorInclude.java
mmidy 01/11/08 12:15:48
Modified: java/src/org/apache/xalan/processor ProcessorInclude.java
Log:
Bugzilla 4355: Make sure that when finding out if a stylesheet imports itself, we use the resolved href.
Revision Changes Path
1.20 +25 -17 xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java
Index: ProcessorInclude.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ProcessorInclude.java 2001/06/18 21:42:42 1.19
+++ ProcessorInclude.java 2001/11/08 20:15:48 1.20
@@ -168,31 +168,39 @@
setPropertiesFromAttributes(handler, rawName, attributes, this);
- String hrefUrl = getHref();
-
- if (handler.importStackContains(hrefUrl))
+ try
{
- throw new org.xml.sax.SAXException(
- XSLMessages.createMessage(
+ String hrefUrl = SystemIDResolver.getAbsoluteURI(getHref(),
+ handler.getBaseIdentifier());
+
+ if (handler.importStackContains(hrefUrl))
+ {
+ throw new org.xml.sax.SAXException(
+ XSLMessages.createMessage(
getStylesheetInclErr(), new Object[]{ hrefUrl })); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!");
- }
+ }
- handler.pushImportURL(hrefUrl);
+ handler.pushImportURL(hrefUrl);
- int savedStylesheetType = handler.getStylesheetType();
+ int savedStylesheetType = handler.getStylesheetType();
- handler.setStylesheetType(this.getStylesheetType());
- handler.pushNewNamespaceSupport();
+ handler.setStylesheetType(this.getStylesheetType());
+ handler.pushNewNamespaceSupport();
- try
- {
- parse(handler, uri, localName, rawName, attributes);
+ try
+ {
+ parse(handler, uri, localName, rawName, attributes);
+ }
+ finally
+ {
+ handler.setStylesheetType(savedStylesheetType);
+ handler.popImportURL();
+ handler.popNamespaceSupport();
+ }
}
- finally
+ catch(TransformerException te)
{
- handler.setStylesheetType(savedStylesheetType);
- handler.popImportURL();
- handler.popNamespaceSupport();
+ handler.error(te.getMessage(), te);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org