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
Jon GallegosSubject: No Topic
Author: Jon Gallegos
Date: 29 Apr 2008 05:03 PM
Alberto

I have attached the .xsl

The ProductRevision@id has a sequential number
{count(preceding-sibling::*)*30+2}
and can occur multiple time. The transverseRootRefs should be a list of each sequential number that in productRevision@id.

After reading your last comment, I assumed the <xsl:for-each select="/PLMXML/ProductRevision/@id"> will pull each item from ProductRevision@id into the transverseRootRefs. I was wrong.

I know you gave me the syntax <xsl:for-each select="/eCrfs/eCrf/ProductRevision/@id"> but that did not make sense to me so i tried something different. Then I decided that I really do not know what I am doing and that I sould listen to you. But that didn't seem to work either. So that is the reason why I attached the xsl. I hope you could show me the errors of my ways.

//jvg


UnknownGMSiPDHPLM.xsl

Posttop
(Deleted User) Subject: No Topic
Author: (Deleted User)
Date: 02 May 2008 10:52 AM
Hi Jon,
the mismatch in our conversation is caused by the fact that you are talking about an attribute created in the output, that cannot be accessed using XPath as it doesn't belong to the source tree (indeed, when you are creating the Header output element, the ProductRevision elements haven't been created yet, you cannot gather their ids).
You need to either:
1) write two stylesheets, where the first one creates the three Product, ProductRevision and Form element while the second one builds the Header using as input the output of the first, or
2) compute the three elements as the value of a single variable, and then build the Header by querying the variable, followed by a copy-of of the variable itself, or
3) duplicate the code that computes the id as part of the Header computation (e.g.

<xsl:attribute name="traverseRootDefs">
<xsl:for-each select="/ns1:eCrfs/ns1:eCrfs">
<xsl:value-of select="concat('#',count(preceding-sibling::*)*30+2)"/>
</xsl:for-each>
</xsl:attribute>) even if this means you could have problems in maintaining the two expression aligned

Hope this helps,
Alberto

   
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.