Vinicius Carvalho wrote:
Hello there! I'm facing a really annoying problem here, one that is
not letting me sleep quite well.

I have an XML in this format:
<message>
<header>
<id>1234</id>
</header>
<payload>
<customer>
<id/>
</customer>
</payload>
</message>

What I need is to copy the id from header to customer. Well hereÅ› the xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
<xsl:template match="//customer/id">
        <xsl:variable name="idc" select="//payload/customer/id"/>
        <id><xsl:value-of select="$idc"/><id>
</xsl:template>

<xsl:template match="*">
<xsl:copy>
    <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="node()"/>
  </xsl:copy>
</xsl:template>
</xsl:stylesheet>


Well, now the pain begins. Running inside eclipse 3.2 unit tests (with
jdk 1.6) it works perfectly... Inside jboss it does not work, it
simply does not copy the id from header to customer.
Since jboss overrides the endorsed dirs, I've set the VM argument
-Djava.endorsed.dirs inside my unit test and it really did not work :(
I've tried xalan 2.7.0, 2.7.1 and nothing, it simply does not work.
Only when I run without overriding the endorsed dirs. If I try to run
jboss with no overriden endorsed dir, it does not start, complains
about some xerces classes.

Please how can I solve this, I'm stuck for over 2 days, tried
everything and nothing is working.

Best Regards


Hi,

I don't know how this relates to your problem, but isn't the xpath select expression in your <xsl:variable> element wrong? I would have expected "/message/header/id" instead.

Klaus



Reply via email to