You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Schmitt, Christian" <Ch...@Dresdner-Bank.com> on 2000/08/01 16:57:32 UTC

Passing a value to an XalanJ extension

Hi,
I'm sorry if this is a FAQ, but the archive is down right now...

So here goes:

We wrote an extension to Xalan to format numbers according to locale. One
can use it in an XSL style sheet like this:

<ourext:formatNumber number="12345.67890" language="de" country="DE"/>

This returns "12.345,67890".

This is working very good as long as you set the attribute values literally.
What does not work is something like this:

<ourext:formatNumber language="de" country="DE">
	<xsl:attribute name="number">
		<xsl:value-of select="amount"/> <!-- Where amount is an
element in the source XML document -->
	</xsl:attribute>
</ourext:formatNumber>

Using the second approach, element.getAttribute("number") in the Java
extension code always return null.


Thanks in advance for any hints/tips.
Christian Schmitt