sboag 01/01/30 21:06:22
Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
Log:
Fix bug reported by Krishna 01/30/2001 09:47 PM.
The bug is that values that were set by the
stylesheet were not overridden by the properties,
because a confusing function was called that is
also used for internal processing, which does
not override properties that are already
set (the function is used to process higher
precidence properties first, then lower precidence,
for various reasons). The fix is fairly
straight-forward, the call that copies in the
stylesheet properties has to be done after the
copy from the caller's properties, instead of
before.
Also contains a minor change to executeChildren to
allow for the supression of xsl:attribute from xsl:element
when an element production needs to be ignored.
Revision Changes Path
1.80 +25 -2
xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- TransformerImpl.java 2001/01/29 19:51:14 1.79
+++ TransformerImpl.java 2001/01/31 05:06:18 1.80
@@ -811,11 +811,11 @@
m_outputFormat = new OutputProperties();
}
- m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties());
if(null != oformat)
{
m_outputFormat.copyFrom(oformat);
}
+ m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties());
}
}
@@ -2071,7 +2071,7 @@
this.setContentHandler(savedHandler);
}
}
-
+
/**
* <meta name="usage" content="advanced"/>
* Execute each of the children of a template element.
@@ -2089,6 +2089,27 @@
ElemTemplateElement elem, Node sourceNode, QName mode)
throws TransformerException
{
+ executeChildTemplates(elem, sourceNode, mode, true);
+ }
+
+ /**
+ * <meta name="usage" content="advanced"/>
+ * Execute each of the children of a template element.
+ *
+ * @param transformer The XSLT transformer instance.
+ *
+ * @param elem The ElemTemplateElement that contains the children
+ * that should execute.
+ * @param sourceNode The current context node.
+ * @param mode The current mode.
+ * @param shouldAddAttrs true if xsl:attributes should be executed.
+ *
+ * @throws TransformerException
+ */
+ public void executeChildTemplates(
+ ElemTemplateElement elem, Node sourceNode, QName mode, boolean
shouldAddAttrs)
+ throws TransformerException
+ {
// Does this element have any children?
ElemTemplateElement firstChild = elem.getFirstChildElem();
@@ -2121,6 +2142,8 @@
for (ElemTemplateElement t = firstChild; t != null;
t = t.getNextSiblingElem())
{
+ if(!shouldAddAttrs && t.getXSLToken() ==
Constants.ELEMNAME_ATTRIBUTE)
+ continue;
xctxt.setSAXLocator(t);
m_currentTemplateElements.setTail(t);
t.execute(this, sourceNode, mode);