Building XSLT from FOR XML RAW

13 views
Skip to first unread message

Andy Kinnear

unread,
Jul 23, 2018, 2:25:43 PM7/23/18
to XSLT
Good afternoon all, I am very new with XML and XLST, so please bear with me. 

I have created a SSIS package that spits out an XML document, hourly. But in order to display, I need an accompanied XSLT, but I am getting stuck.

The query uses FOR XML RAW that outputs one line:
<Census Day="for 01/01/01" Total="999"/>

I want to create a XSLT to display this, but i have not been able to figure out how, or if that's even possible. This is what I have so far:

<?xml version="1.0" encoding="UTF-8"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<body style="font-family:Arial;font-size:16pt;background-color:#EEEEEE">
<xsl:for-each select="Census">
<div style="background-color:white;color:black;padding:10px">
<span style="font-weight:bold"><xsl:value-of select="Day"/> - <xsl:value-of select="Total"/>
</span>
</div>
</xsl:for-each>
</body>
</html>

When i reconfigure the XML to:
<Census>
<Day>for 01/01/01</Day> 
<Total>999</Total>
</Census>

I can then easily configure XSLT. 

Just curious if it would be possible to create one based on the original. Or if anyone see's where I am going wrong.

Thanks!
Andy

Andy Kinnear

unread,
Jul 23, 2018, 2:35:01 PM7/23/18
to XSLT
aaaaaaaaaand nevermind, I found i just changed FOR XML RAW to FOR XML PATH and that gave me what I needed. :)
Reply all
Reply to author
Forward
0 new messages