RE: Mapping recursive elements

Tech-Archive recommends: Fix windows errors by optimizing your registry




If you want to copy it exactly as it is and the source nodes have the exact
same names as the destination you can use the mass copy functoid.
The mass copy functoid copies the namespace of the original XML to the
destination XML though. Try it, and if the namespace is a problem you can use
a scripting functoid. The following code is what I have in a "Inline XSLT
Call Template" scripting functoid that copies the entire "catalogueItem" node
structure that is a child of a "catalogueItemNotification" node onto a
destination "Document" node. The functoid has no input parameters but the
destination links to the "Document" node on the destination schema.

<xsl:template name = "testTemplate"
match="/*[local-name()='catalogueItemNotification' and
namespace-uri()='urn:ean.ucc:gdsn:2']/*">
<xsl:element name="Document">
<xsl:apply-templates mode="copy-no-ns" select="catalogueItem"/>
</xsl:element>
</xsl:template>
<!-- Selectively mass copy some of the nodes without namespaces -->
<xsl:template mode="copy-no-ns" match="*">
<xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copy-no-ns"/>
</xsl:element>
</xsl:template>

So if the original document had:
<catalogueItemNotification>
<catalogueItem>
<.... a whole bunch of nodes and attributes ...>
</catalogueItem>
<catalogueItemNotification>

The destination will have:
<ParentNode>
<Document>
<.... exact copy of a whole bunch of nodes and attributes ...>
</Document>
</ParentNode>

"Sree" wrote:

I have a schema with a recursive record element.

<Workflow Id="Id_0" MajorVersion="MajorVersion_1"
MinorVersion="MinorVersion_2">
<Workflow Id="Id_0" MajorVersion="MajorVersion_1"
MinorVersion="MinorVersion_2" />
<Workflow Id="Id_0" MajorVersion="MajorVersion_1"
MinorVersion="MinorVersion_2" />
</Workflow>
</Workflow>

I need to map this record to another schema. I tried using the shift
and drag link method to have all the child nodes mapped but that does
only one level deep mapping. How do I achieve N level deep mapping for
this recursive record.

The destination record struct is exactly as the source record
structure. It does not make sense to have to do a one to one mapping
dragging a link, because of the record being recursive.

All help is great help.

Thanks
Sree


.



Relevant Pages

  • Re: Create empty records and fields in the destination file
    ... Add a Looping functoid linked to the record and another field in the source schema that you know it will always exist in the incoming message and create a number of Value Mapping functoids to map the values of the repeating record fields into the destination + the value of the field in source schema to all the fields in the destination record after producing an empty value using a single Scripting functoid for all fields. ... You also need to use the Logical existence functoid linked to the repeating records in both source and destination and also the field that will always exist and the destination repeating record to ensure the creation of the empty record. ...
    (microsoft.public.biztalk.general)
  • RE: String Left Functoid Does Not Return a Value
    ... Already recreated the functoid in many combinations. ... String Concatenate did work. ... recreated my project and added both anew source and destination schema with ... I would think that the xpath statement should be there. ...
    (microsoft.public.biztalk.general)
  • Re: Mapper - nill element question
    ... you can use a Script functoid and add the XSLT template that I add below... ... As soon as you connect any functoid to the destination ... >> script functoid and invoke a XSLT to check the value of this parameter... ...
    (microsoft.public.biztalk.general)
  • map copy elements for each occurence of criteria to match
    ... I have a map whose source and destination are of the same schema. ... Currently i use the looping functoid, the mass copy functoid and one ... if the logical functoid returns true for the first record in ...
    (microsoft.public.biztalk.general)
  • Re: photons
    ... what is a classical photon? ... DESTINATION is exactly that mass (a body: ... Why do you imagine this is necessary? ...
    (sci.physics.relativity)