Java and XSLT, XPath

A

Angus Parvis

Hi,

I use the java.xml.transform libs to read an XSL stylesheet and
transform and existing XML file to HTML. At least I try to, but there's
a problem:

I use variables in the XSL and using them with <xsl:value-of
select="$variable.name"> works fine. The variables are used for I18N, so
there are some places, where I want to use the variables inside of
HTML-Tags, for example within the submit-tag of a form.

I'm new to XSLT, XPath and this stuff, and it didn't work with simple a
"xsl:value-of". Someone told me to do use the following XPath expression:

<input value="{concat($text, '.submit')}" ... />

and i guess this should work either:

<input value="{string($text.submit)}" ... />

But when transforming, i get a this exception:
javax.xml.transform.TransformerException: Premature end of file.

Without the XPath-Expression the XSL works fine, so this should be the
source of the problem.

Do you have any suggestions how to solve this problem? Maybe any other
attempts to achieve the same goal?

Thanks in advance for your help.

Angus
 
A

Angus Parvis

Angus said:
Do you have any suggestions how to solve this problem? Maybe any other
attempts to achieve the same goal?

For the curious people: I've found the solution. It's just:

<input value="{$text.submit}" ... />

I changed server from Tomcat to JBoss, but JBoss uses Tomcat, so that
can't make the difference.

Greetings, Angus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top