Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Only output element when parameter value is not equal to blank (or null)

From: Chris Coyle <chriscoyle@--------->
To:
Date: 2/1/2007 3:21:00 AM
Hello,
  I need to modify the following so the Key elements
will only exist when there is a value assigned to
parameter.

  Thanks,
   Chris


<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"
omit-xml-declaration="yes"/>
    <xsl:param name="catalogName"/>
    <xsl:param name="productid"/>
    <xsl:param name="shortdesc"/>
    <xsl:param name="packsize"/>
    <xsl:param name="category"/>
    <xsl:param name="major"/>
    <xsl:param name="intermediate"/>
    <xsl:param name="minor"/>
    <xsl:param name="trueVendor"/>
    <xsl:param name="gtin"/>
    <xsl:param name="mpc"/>
    <xsl:param name="itemType"/>
    <xsl:param name="packSize"/>


<xsl:template match="/">
     <DataService>
	<Identity>
		<DirectoryPath>
			<Directory type="Enterprise">Alpha</Directory>
			<Directory type="User">admin</Directory>
		</DirectoryPath>
		<Authentication>admin</Authentication>
	</Identity>

	<Transaction>
		<Command type="Query">
			<MasterCatalogRecord etype="Entity">
				<ExternalKeys>
					<Key name="MASTERCATALOGNAME"
type="string"><xsl:value-of
select="$catalogName"/></Key>
					<Key name="PRODUCTID" type="string"><xsl:value-of
select="$productid"/></Key>
					<Key name="SHORTDESC" type="string"><xsl:value-of
select="$shortdesc"/></Key>
					<Key name="SUPCCATEGORY"
type="string"><xsl:value-of select="$category"/></Key>
					<Key name="SUPCMAJORCLASS"
type="string"><xsl:value-of select="$major"/></Key>
					<Key name="SUPCINTERMEDIATECLASS"
type="string"><xsl:value-of
select="$intermediate"/></Key>
					<Key name="SUPCMINORCLASS"
type="string"><xsl:value-of select="$minor"/></Key>
					<Key name="MANUFACTURER"
type="string"><xsl:value-of
select="$trueVendor"/></Key>
					<Key name="EXTERNAL_PRODUCT_CODE"
type="string"><xsl:value-of select="$gtin"/></Key>
					<Key name="MFR_PRODUCT_CODE"
type="string"><xsl:value-of select="$mpc"/></Key>
					<Key name="ITEM_TYPE" type="string"><xsl:value-of
select="$itemType"/></Key>
					<Key name="PACK_SIZE" type="string"><xsl:value-of
select="$packSize"/></Key>
				</ExternalKeys>
			</MasterCatalogRecord>
		</Command>
	</Transaction>
     </DataService>
</xsl:template>
	
</xsl:stylesheet>



 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091


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