Skip to Content
avatar image
Former Member

how to handle duplicate nodes in xslt mapping

Hi,

in my scenario that i have a source mapped to the canonical structure and from canonical to target.

source structure

<empid>

<national_id>

canonical structure

<id> 0 to unbounded

<id>

<type>

the mapping from source to canonical

is like i have duplicated the canonical structure and then mapped

id -


empid

type--- assigned a constant employee

id -


national_id

type--- assigned a constant National

i have used xslt mapping using stylus studio and mapping from source to canonical is not the problem

when i mapped the canonical to target there is a problem

the node id is visible once in the canonical when the structure is a source

but there is a dupicate node in the structure but not visible. how to procedue with the mapping for canonical to target

kindly help me

with regards

pradeep N

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jun 14, 2007 at 09:44 AM

    Hi Pradeep,

    sorry, your task is difficult ot understand.

    Can you gibe me an XML example for your issue?

    - The source, which you want to map, and

    - the result, which you would like to have?

    Regards,

    Udo

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Pradeep,

      this should work:

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.aprilbiztec.in/MM_MultiFile">
      	<xsl:template match="*">
      		<ns0:Materail_file>
      			<Emp_ID>
      				<xsl:value-of select="//ID[../Type='Employee']"/>
      			</Emp_ID>
      			<National_ID>
      				<xsl:value-of select="//ID[../Type='National']"/>
      			</National_ID>
      		</ns0:Materail_file>
      	</xsl:template>
      </xsl:stylesheet>

      Regards,

      Udo