Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: include document and concatanated id's include document and concatanated id'sTo: NULL Date: 4/7/2008 10:38:00 AM Hi, I have the following: <xsl:template match="parts"> <xsl:variable name="inc-url"> <xsl:value-of select="@url"/>.data </xsl:variable> <xsl:variable name="inc-doc" select="document($inc-url, .)" /> <xsl:for-each select="$inc-doc/*"> <xsl:copy-of select="." /> </xsl:for-each> </xsl:template> So given ------ component.xml ----- <component> <parts id='main' url='assembly.data' /> </component> -------------------------- and ------ assembly.data ----- <assembly id='outerBox' width='400'> <name'>Cardboard Outer</name> <price id='outerPrice' value='200' /> </assembly> -------------------------------- i get ----- result ----- <component> <assembly id='outerBox' width='400'> <name'>Cardboard Outer</name> <price id='outerPrice' value='200' /> </assembly> </component> ------------------ I need to change this xsl to combine id's (if present) so i get: ----- result ----- <component id='mainProduct'> <assembly id='main$outerBox' width='400'> <name'>Cardboard Outer</name> <price id='main$outerPrice' value='200' /> </assembly> </component> ------------------ That is; the included ids are prefixed with their 'parent' ids. I know I need to change <xsl:for-each select="$inc-doc/*"> <xsl:copy-of select="." /> </xsl:for-each> but for the life of me i cannot see the solution. Can anyone help me? Martin | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
