Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


include document and concatanated id's

From: Martin <a@-.->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent