[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

List of Unique Items within an XML Document

Subject: List of Unique Items within an XML Document
From: Ben Gazzard <BenG@xxxxxxxxxxxxxx>
Date: Tue, 22 Jun 2004 15:53:03 +0100
colourcode
Hi All,

Basically I have quite a flat XML Document that needs to be converted into a
more structured one.

----Original XML----

<?xml version="1.0" encoding="UTF-8"?>
<Import>
	<Row>
		<customer>ADULTS</customer>
		<product>SOCKS</product>
		<productID>611150</productID>
		<productName>COPA 3 STRIPE SOCK</productName>
		<productColor>WHITE/BLK</productColor>
		<productSize>2 | 3 | 4</productSize>
	</Row>
</Import>

----Converted XML----

<productCatalog>
<product type="STRIPED SOCK">
	<productName>STRIPED SOCK</productName>
	<productType>SOCKS</productType>
	<productSpecs>manual</productSpecs>
	<productSize>
		<sizeAdult>2 | 3 | 4</sizeAdult>
		<sizeKid></sizeKid>
	</productSize>
	<productPrice>
		<priceAdult>manual</priceAdult>
		<priceKid>manual</priceKid>
	</productPrice>
	<!-- Repeat for each colour variation -->
	<productInfo id="1" type="STRIPED SOCK">
		<productCode>
			<codeAdult>2134124</codeAdult>
			<codeKid></codeKid>
		</productCode>
		<productColorScheme>
			<colourDecsription>WHITE/BLK</colourDecsription>
			<colourCode>manual</colourCode>
			<colourCode>manual</colourCode>
		</productColorScheme>
	</productInfo>
</product>
<productCatalog>

The XSLT works fine so far. This Template triggers the other templates based
on the product param.

<xsl:template match="Import">
	<productCatalog>
		<xsl:call-template name="productTemplate">
			<xsl:with-param name="product" select="'COPA 3
STRIPE SOCK'"/>
		</xsl:call-template>
		<!-- repeated for each product -->
	</productCatalog>
</xsl:template>

What I want to happen is that instead of manually putting each product name
into a call-template param is for the xslt to do it itself. What is the best
way to do this?

Hope someone can help!

Cheers,
Ben


This e-mail and any attached files are for the exclusive use of the addressee and may contain privileged and/or confidential information. If you receive this e-mail in error you should not disclose the contents to any other person nor take copies but should delete it and telephone us immediately on +44(0)20 7557 6100.

TEQUILA\ London Limited does not make any warranty as to the accuracy or completeness of this e-mail and we accept no liability for its content or use. Any opinions expressed in this e-mail are those of the author and do not necessarily reflect the opinions of TEQUILA\ London Limited.

TEQUILA\ London Limited operates within the parameters set by the Data Protection Act 1998 with regard to the use of personal information including e-mail addresses. We accept no liability for the forwarding of this e-mail to other parties that may result in unsolicited e-mails being received by those whose email addresses appear in this e-mail.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.