sboag 00/11/14 09:40:35
Modified: java/src/org/apache/xalan/processor StylesheetHandler.java
Log:
In getBaseIdentifier(), try to use the
m_baseIdentifiers stack, and only use
the locators stack if this is empty.
Revision Changes Path
1.21 +24 -14
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- StylesheetHandler.java 2000/11/13 16:26:50 1.20
+++ StylesheetHandler.java 2000/11/14 17:40:35 1.21
@@ -241,19 +241,6 @@
}
/**
- * Return the base identifier.
- *
- * NEEDSDOC ($objectName$) @return
- */
- public String getBaseIdentifier()
- {
-
- SourceLocator locator = getLocator();
-
- return (null == locator) ? "" : locator.getSystemId();
- }
-
- /**
* Test to see if the stack contains the given URL.
*
* NEEDSDOC @param stack
@@ -1270,7 +1257,30 @@
{
return (String) m_baseIdentifiers.pop();
}
+
+ /**
+ * Return the base identifier.
+ *
+ * @return The base identifier of the current stylesheet.
+ */
+ public String getBaseIdentifier()
+ {
+ // Try to get the baseIdentifier from the baseIdentifier's stack,
+ // which may not be the same thing as the value found in the
+ // SourceLocators stack.
+ String base = (String)(m_baseIdentifiers.isEmpty() ? null :
m_baseIdentifiers.peek());
+
+ // Otherwise try the stylesheet.
+ if(null == base)
+ {
+ SourceLocator locator = getLocator();
+
+ base = (null == locator) ? "" : locator.getSystemId();
+ }
+ return base;
+ }
+
/**
* The top of this stack should contain the currently processed
* stylesheet SAX locator object.
@@ -1288,7 +1298,7 @@
if (m_stylesheetLocatorStack.isEmpty())
{
SAXSourceLocator locator = new SAXSourceLocator();
-
+
locator.setSystemId(this.getStylesheetProcessor().getDOMsystemID());
return locator;
// m_stylesheetLocatorStack.push(locator);