XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Ronald WilsonSubject: map repeating elements separately to individual elements
Author: Ronald Wilson
Date: 07 Jan 2009 01:25 AM
Maaping Question

source Document:
<Paragraph>
<DateTimeField10>1030</DateTimeField10>
<DateTimeField10>1243</DateTimeField10> [this is Start_Time]
<DateTimeField10>1322</DateTimeField10> [this is next_Time]
</Paragraph>
<Paragraph>
<TextField/>
<DateTimeField10>1315</DateTimeField10>
<DateTimeField10/>
</Paragraph>
<Paragraph>
<DateTimeField10>1448</DateTimeField10> [this is finish_Time}
<DateTimeField10>1502</DateTimeField10>
<DateTimeField10/>
<DateTimeField10>1545</DateTimeField10>
</Paragraph>

Target document:

<xs:element ref="Start_Time"/>
<xs:element ref="next_Time"/>
<xs:element ref="finish_Time"/>


I just do not understand the reate value link; create repeatable vaule link and how to use the FLOWR(?).

This is not well documented in the help.





Postnext
(Deleted User) 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

Posttop
Ronald WilsonSubject: map repeating elements separately to individual elements
Author: Ronald Wilson
Date: 08 Jan 2009 11:58 PM
May the blessings of many children befall you.

Thank you very much.

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.