Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Newbie help with transform - force output element not in input

From: "Flomo Togba Kwele" <Flomo@---------.------>
To: NULL
Date: 5/2/2007 10:16:00 AM

I do not know much about xslt, but I've got a transform in place which works.
Essentially, it takes the output of a CSV==>XML from different datasources as
its input and creates a standardized output.

I have recently gotten a new datasource which does not include an element which
I do need on the output. The value will always be the same:

	<OwnerAbsentOccupied>O</OwnerAbsentOccupied>

When I put that in the existing transform, it does appear in the output. Can
anyone tell me how to do this?

This is a snippet of the script:

	<xsl:template match="/csv_data_records">
		<StdAddress>
			<xsl:for-each select="@source">
				<xsl:attribute name="source">
					<xsl:value-of select="."/>
				</xsl:attribute>
			</xsl:for-each>
			<xsl:for-each select="record">
				<record>
					<xsl:for-each select="@num">
						<xsl:attribute name="num">
							<xsl:value-of select="."/>
						</xsl:attribute>
					</xsl:for-each>
					<xsl:for-each select="PRIMARY_SIC">
						<UseCode>
							<xsl:value-of select="."/>
						</UseCode>
					</xsl:for-each>
					<OwnerAbsentOccupied>O</OwnerAbsentOccupied>
				</record>
			</xsl:for-each>
		</StdAddress>
	</xsl:template>

And the output:

<csv_data_records source="C:\List-1259507711.TXT">
     <record num="1">
          <PRIMARY_SIC>769962</PRIMARY_SIC>
     </record>

Thanks, Flomo


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