I am wondering what this documentation:
If the select attribute is present, the element cannot contain any content
about the xsl:variable element at:
[1]: http://www.w3schools.com/xsl/el_variable.asp%20w3%20schools means?
The reason I ask is because I am encountering this error:
JAXPSAXProcessorInvoker - java.lang.RuntimeException: ElemTemplateElement error: The xsl:variable element must not have both content and a select attribute. during transformation. Weird thing is it “runs” with the eclipse default processor but not xalan.
When it runs with the eclipse default processor, I find that some of the elements in the original document I am converting do not show up in the result document, I am curious if it is related to this. and the eclipse processor just masks the issue while the xalan processor fails.
I believe this is the offending line:
<xsl:variable name="vSections" select="//*[local-name()='ItemDef']/*/*/*[local-name()='SectionLabel'][generate-id() = generate-id(key('kLabelsInForm', concat($vFormOID, '+', .))[1])]">
<xsl:value-of select="concat(., ' ')" />
</xsl:variable>
Thanks for the explanation.
This rule is present in both XSLT 1.0 and in 2.0. If you have a stylesheet that contains this error and you find a processor that does not report the error, that’s a bug (non-conformance) in the processor. It’s not a bug you need to worry about much, just fix the error in your stylesheet.