|
next
|
Subject: map repeating elements separately to individual elements Author: (Deleted User) Date: 08 Jan 2009 09:42 AM
|
Hi Ronald,
in Mapper a value link will create an xsl:value-of instruction, filling the target schema element with the content of the source element; if the source element is a repeatable element, i.e. it can occur multiple times, the XSLT instruction will cause the newly created element to contain the concatenation of the input values.
A repeatable link will instead create a xsl:for-each statement that will generate an empty target element for each element found in the source document.
A repeatable value link will perform both operations, creating a for-each with a value-of inside, so that for each source element a new target element will be created with the same content of the current source element. This is just a shortcut, as the same effect can be achieved by first creating a repeatable link, and then creating a value link between the same two elements.
In you case, you should create multiple value links from DataTimeField10 to each of Start_Time, next_Time and finish_Time. Then, go to the text editor below the Mapper canvas, and add the proper filter predicate to restrict the source XPath to locate the exact time you need to extract. Your XML fragment doesn't have any hint about which criteria should be used to distinguish the various times, so you could be forced to just add a positional predicate like [2] or [3].
<Start_Time>
<xsl:value-of select="(root/Paragraph/DateTimeField10)[2]"/>
</Start_Time>
<next_Time>
<xsl:value-of select="(root/Paragraph/DateTimeField10)[3]"/>
</next_Time>
<finish_Time>
<xsl:value-of select="(root/Paragraph/DateTimeField10)[6]"/>
</finish_Time>
Hope this helps,
Alberto
|
|
|