Hello,

I built some xsl files using the XML Spy tool. The problem is that the behavior 
in XML Spy is different of the behavior when I transform my XML using XalanJ 
(WebLogic 8.1).

XML to be transformed:

<BLAH_ADP_OUT_PARAMETERS>
        <RECORD name="OCC" index="0">
                <PARAM name="CO_ID" value="12345"/>
        </RECORD>
</BLAH_ADP_OUT_PARAMETERS>

Block of the occ.xsl:

<xsl:template match="[EMAIL PROTECTED]'OCC']" mode="occ">
        <occ>
            <xsl:attribute name="index"><xsl:value-of 
select="@index"></xsl:value-of></xsl:attribute>
            <xsl:apply-templates mode="contract" 
select="."></xsl:apply-templates>
        </occ>
</xsl:template>

Block of the contract.xsl:

<xsl:template name="contract"  match="."  mode="contract">
                <contract>
                     <xsl:apply-templates 
mode="contract-data"></xsl:apply-templates>
                </contract>
</xsl:template>

When I transform using XML Spy, everything runs OK. When I transform under 
Weblogic (XalanJ) or Jbuilder I got the error message below:

Error:

A node test that matches either NCName:* or QName was expected.;

I found that the problem is:

<xsl:template name="contract"  match="."  mode="contract">

I can not use match=".". Instead of ., I have to use match="[EMAIL 
PROTECTED]'OCC']".

I did a lot of search by Internet and somebody said that match="." is not valid.

What about select="."? It seems to work fine.

I do not want to use match="[EMAIL PROTECTED]'OCC'] because the tag <PARAM 
name=CO_ID> can appear under different nodes:

<RECORD name="OCC" index="0">
        <PARAM name="CO_ID" value="12345"/>
</RECORD>

or

<RECORD name="BLAH" index="0">
        <PARAM name="CO_ID" value="12345"/>
</RECORD>

What is a good solution? I want to have only 1 contract.xsl working under 
different situations. That's why I used match=".".

Thanks in advance,
Marco Camp�lo

Reply via email to