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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext 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
Alberto MassariSubject: No Topic
Author: Alberto Massari
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

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
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.