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)
-> - XSLT slicing and orphan contro... (1)
-> + How to delete CDATA using XSL... (15)
-> + Remove only root namespace, bu... (3)
-> + String Parsing (3)
-> + Calling Java method from XSL (3)
-> + populate xsl file from xsd fil... (5)
-> + formating a number like #'###.... (3)
-> + Help with grouping children, f... (20)
-> + Need help for newbie! (3)
-> + xpath in string format (2)
-> + How to populate elements at ra... (4)
-> + Changing Date format in XLST (2)
-> + Please help....How could I rem... (2)
-> + Counting children and grandchi... (7)
-> + Nested tags (4)
-> + Problem with XSLT on a Soap En... (2)
-> + Problem with XSLT on a Soap En... (5)
-> + Comparison between XSLT proces... (2)
-> + Printing non-existing value (9)
-> + big input file for XSLT (14)
-> + Is there any way to store xpat... (2)
-> + Encoding special charecters (2)
-> + Sorting (3)
-> + XML to PDF using XSL:FO (3)
-> + How to find the line number in... (2)
-> + How to set a marker for paper ... (2)
-> + Not equality Function (2)
-> + Counting Elements (4)
-> + Looking for help or code samp... (2)
-> + Help needed in pattern matchin... (2)
-> + Repeaters and Ifs (2)
-> + select adjacent nodes in xpath... (3)
-> + Stripping of Empty Target Elem... (2)
-> + auto-generate Edifact Intercha... (5)
-> + Qname Error in xsl:element (2)
-> + [Newbie] Type conversion and f... (2)
-> + Do ...when (2)
-> + Using Key (3)
-> + sorting elements in option (2)
-> + NaN(not available) value repla... (3)
-> + infinite loop error when tryin... (9)
-> + Escape a character in the stri... (3)
-> + find sum of 2 elements in xml (2)
-> + placing a ' * ' by reading the... (3)
-> + Problem in dispaying Current D... (4)
-> + Merging Table Cells in XSLT re... (3)
-> + xsl fo block-container and foo... (2)
-> + Is is possible to create a .CO... (2)
-> + printing a parent node value i... (2)
-> + Mime header info setup? (3)
-> + Calculating a Date based on 4 ... (3)
-> + XSLT formatting number issue (10)
-> + map repeating elements separat... (3)
-> + Combining XML elements based o... (3)
-> + Convert XML to UTF-8 (8)
-> + XSLT and MS Access 2007 Optio... (5)
-> - WORDML list to XML list (1)
-> + [Newbie] Using lookups in XSLT... (3)
-> + Comparing 2 passed Date Values (2)
-> + ERROR XQueryMediator Error du... (2)
-> + XML / XSLT... Unordered lists ... (2)
-> + Specify image path in XSL (2)
-> + Variable within a variable (3)
-> + How to call jfreechart method ... (8)
-> + leading and trailing white spa... (2)
-> + XSLT to Html problems (6)
-> + How to set classpath, when i n... (3)
-> + Error in using functions (4)
-> + To find the occurence of a cha... (3)
-> + PLMXML to XML (4)
-> + Transform multiple node values... (2)
-> + I am in need of svg example(s)... (13)
-> + count in XSLT, Need Help Pleas... (2)
-> + Help with XML.Report and Gener... (2)
-> + for each loop and variable (5)
-> + Problem with selecting nodes f... (3)
-> + Getting "Expected elemenmt mis... (2)
-> + Help with attached XML mapping... (8)
-> + xml:space="Preserve" and Embed... (2)
-> + XSLT and Multiple Strings (2)
-> + XSL Date format (2)
-> + check element contents against... (3)
-> + XML to XML Namespace conversio... (2)
-> - Supressing subgroup headers in... (1)
-> - HTML to fo conversion using XS... (1)
-> + No Topic (2)
-> + parsing xml using xslt HELP (2)
-> + Multiple Page Headers (2)
-> + PLM Xml To Generic XML (3)
-> + XSLT/XPath Help (2)
-> + XSL Space Issue (2)
-> + wanting help with xslt custom ... (3)
-> - Update input xml content with ... (1)
-> + Error: namespace prefix xsl on... (3)
-> + Error in my xsl:if test... (2)
-> - calling javascript from XSLT (1)
-> + Error when trying to a call a ... (2)
-> - HTTP POST from XSLT (1)
-> + passing xml document as input ... (2)
-> + XSLT for WORDML table to CALS ... (2)
-- Previous [361-380] [381-400] [401-420] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Neal  WaltersSubject: For-each not generated automatically
Author: Neal Walters
Date: 10 Mar 2005 09:48 AM
I'm dragging an XML element from a node that occurs multiple times
to another node that occurs multiples times. According to the
doc, "Blocks can be created - automatically when you link one
node to another... If you link repeating elements in the source
and target documents, Stylus Studio automatically creates an
xsl:for-each instruction block in the mapper".
from .pdf file page 418.

Below are relevant schema fragments from my source first then target
second. I used the GUI mapper and mapped IT_QUANTITY to ItemQty and no
for-each block was created. If I manually add the for-each block,
everything works okay. So my question is if I did something wrong
that the for-each block was not added automatically?

Thanks,
Neal Walters
http://Biztalk-Training.com
http://VBScript-Training.com
http://XML-Online-Training.com


<xsd:element name = "ITEMS">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref = "ITEM" maxOccurs = "unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name = "ITEM">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref = "IT_PURCHASE_ID"/>
<xsd:element ref = "IT_SKU"/>
<xsd:element ref = "IT_QUANTITY"/>
<xsd:element ref = "IT_UNIT_PRICE"/>
<xsd:element ref = "IT_SUB_TOTAL"/>
<xsd:element ref = "IT_VID"/>
<xsd:element ref = "SPECIAL_INSTRUCTIONS" minOccurs = "0"/>
<xsd:element ref = "IT_DESCRIPTION"/>
<xsd:element ref = "PAGE_NUMBER" minOccurs = "0"/>
<xsd:element ref = "IT_SOURCECODE" minOccurs = "0"/>
<xsd:element ref = "IT_TAX" minOccurs = "0"/>
<xsd:element ref = "IT_SHIPPING" minOccurs = "0"/>
<xsd:element ref = "IT_TRACK_NO" minOccurs = "0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

Mapping to:

<xs:complexType name="Order">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Site" type="tns:Site" />
<xs:element minOccurs="0" maxOccurs="1" name="BillingAddress-10" type="tns:BillingAddress10" />
<xs:element minOccurs="0" maxOccurs="1" name="EmailInfo-13" type="tns:EmailInfo13" />
<xs:element minOccurs="0" maxOccurs="1" name="ShipMethod-15" type="tns:ShipMethod15" />
<xs:element minOccurs="0" maxOccurs="1" name="User-19" type="tns:User19" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="PaymentMethod-20" type="tns:PaymentMethod20" />
<xs:element minOccurs="0" maxOccurs="1" name="Comments-21" type="tns:Comments21" />
<xs:element minOccurs="0" maxOccurs="1" name="ShippingAddress-30" type="tns:ShippingAddress30" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Product-40" type="tns:Product40" />
</xs:sequence>

<xs:complexType name="Product40">
<xs:attribute name="ItemQty" type="xs:string" />
<xs:attribute name="ItemEdp" type="xs:string" />
<xs:attribute name="ItemNo" type="xs:string" />
<xs:attribute name="ShipMethod" type="xs:string" />
<xs:attribute name="PhAmt" type="xs:string" />
<xs:attribute name="Price" type="xs:string" />
<xs:attribute name="PriceOveride" type="xs:string" />
<xs:attribute name="AssocNo" type="xs:string" />
<xs:attribute name="Customize1" type="xs:string" />
<xs:attribute name="Customize2" type="xs:string" />
<xs:attribute name="GiftWrapLevel" type="xs:string" />
<xs:attribute name="GiftWrapMessage" type="xs:string" />
<xs:attribute name="GiftWrapCost" type="xs:string" />
<xs:attribute name="GiftWrapTax" type="xs:string" />
</xs:complexType>


Postnext
Minollo I.Subject: Re: For-each not generated automatically
Author: Minollo I.
Date: 10 Mar 2005 09:59 AM
This is a limitation of the current version: repeating elements described
by XML Schema or DTD are not properly recognized; only those described by
an instance document are.

You can, of course, still manually create the "for-each" block and force
the repetition to be taken into account.

Thanks,
Minollo

Postnext
Neal  WaltersSubject: For-each not generated automatically
Author: Neal Walters
Date: 10 Mar 2005 10:11 AM
As I continue reading your manual, I found the following.
The element "ITEM" does not have the icon that identifies it as
a "repeating element", rather it has the normal "element" icon.

But the schema shows it is a repeating item:

<xsd:element name = "ITEMS">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref = "ITEM" maxOccurs = "unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

So if XSLT does not see this as a repeating item, that would explain
why it didn't create the for-each, so now the question is "Why
doesn't Stylus Studio recognize this element as a repeating element?"

Thanks again,
Neal

Postnext
Neal  WaltersSubject: For-each not generated automatically
Author: Neal Walters
Date: 10 Mar 2005 10:14 AM
Sorry, I was posting about the same time you were,
so I didn't read your last message when I posted my last message.
Seems like this is a bug that needs to be fixed.

Neal

Postnext
Minollo I.Subject: Re: For-each not generated automatically
Author: Minollo I.
Date: 10 Mar 2005 10:18 AM
I think I answered this question in my previous post.

BTW, another way to control the kind of link created is to drag&drop the
connection line using the right button of the mouse; a popup menu will let
you choose the kind of link that better describes the operation you are
trying to accomplish.

Thanks,
Minollo

Postnext
Minollo I.Subject: Re: For-each not generated automatically
Author: Minollo I.
Date: 10 Mar 2005 11:58 AM
Reviewing the code involved, the issue is present only when schemas use
"unbounded" for maxOccurrs; a numeric maxOccurs > 1 will work as expected.

A fix will be available soon.

Thanks,
Minollo

Postnext
Neal  WaltersSubject: For-each not generated automatically
Author: Neal Walters
Date: 10 Mar 2005 10:59 AM

From the mapper I add a "xslt:choose" instruction block.
When I right-click it, I have three shortcut menu options:
1) Delete, 2) Go to source, and 3) Add When Port.

Page 439 of the .pdf doc talks about right-clicking it and selecting
the "properties" option. I don't see the properties option.
Am I doing something wrong. (Using build 287h.)


Thanks,
Neal Walters
http://Biztalk-Training.com
http://VBScript-Training.com
http://XML-Online-Training.com

Posttop
Neal  WaltersSubject: For-each not generated automatically
Author: Neal Walters
Date: 10 Mar 2005 11:01 AM
Sorry - last post was meant for a separate thread, I reposted it as new topic. Still trying to use forum properly.

Neal

   
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.