F
Flomo Togba Kwele
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
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