XSL template match issue

N

namrathu1

Hi,

I'm facing a problem with my XSL. I have two nodes with the same name
at different levels in my XSL and while writing rules i.e in the
template match it writes the same name. Hence it is not able to
differentiate between the two and i don't get correct results when I
do an array-get.
I tried putting the XPath value but that doesn't help as in i don't
get any output.

Example:

<xsl:template match="cbc:ID"
xmlns:cbc="urn:eek:asis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<xsl:apply-templates/>
<!-- array get rule here -->
</xsl:template>

<xsl:template match="cbc:ID"
xmlns:cbc="urn:eek:asis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<xsl:apply-templates/>
<!-- array get rule here -->
</xsl:template>


Any inputs from your side will be of great help.

Thanks in advance,
Smitha
 
E

Evans

Hi,

I'm facing a problem with my XSL. I have two nodes with the same name
at different levels in my XSL and while writing rules i.e in the
template match it writes the same name. Hence it is not able to
differentiate between the two and i don't get correct results when I
do an array-get.
I tried putting the XPath value but that doesn't help as in i don't
get any output.

Example:

    <xsl:template match="cbc:ID"
xmlns:cbc="urn:eek:asis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
      <xsl:apply-templates/>
      <!-- array get rule here -->
      </xsl:template>

      <xsl:template match="cbc:ID"
xmlns:cbc="urn:eek:asis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
      <xsl:apply-templates/>
     <!-- array get rule here -->
     </xsl:template>

Any inputs from your side will be of great help.

Thanks in advance,
Smitha

Have a look at XML Namespaces. That should help sort out the name
conflicts if though they are at different level of nodes. This is a
common issue.

Good luck
 

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,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top