landspeeder1
IS-IT--Management
Ok, I've been working with XML/XSL for a little over 24hrs. What I've got is an XML generated from Microsoft Project for web reporting. I've modified the sample XSL Microsoft provides to produce the web report that I need. However, I'm having one problem. I've found that my XSL can't read the XML due to a schema that Microsoft is placing in the XML. If I manually remove the statement from the XML, I'm good. Project will not give you options to save it any other way. I need to be able to produce my report without editing the XML every time I same/update my project. I had to modify the XSL because the date format that Project produces is yyyy-mm-ddThh:mm:ss and I needed mm-dd-yyyy. Below is part of my XML/XSL and output with/without the schema statement.
Unmodified
XML
<?xml version="1.0" ?>
- <Project xmlns=" <Name>test.xml</Name>
<Title>Device Rollout</Title>
<Company>0</Company>
<CreationDate>2004-01-13T15:45:00</CreationDate>
<LastSaved>2004-01-16T08:25:00</LastSaved>
</Project>
XSL
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="substring.xsl"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:template match="/">
<HTML>
<BODY BGCOLOR="white">
<H1 ALIGN="center"><xsl:value-of select="Project/Title"/></H1>
<xsl:variable name="Savetime" select="Project/LastSaved"/>
<H2 ALIGN="center"><font face="tahoma" size="3">Rollout status as of <xsl:value-of select='substring($Savetime,6,2)'/>-<xsl:value-of select='substring($Savetime,9,2)'/>-<xsl:value-of select='substring($Savetime,1,4)'/></font></H2>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Output
Rollout status as of --
*****************************
Modified
XML
<?xml version="1.0" ?>
- <Project>
<Name>test.xml</Name>
<Title>Device Rollout</Title>
<Company>0</Company>
<CreationDate>2004-01-13T15:45:00</CreationDate>
<LastSaved>2004-01-16T08:25:00</LastSaved>
</Project>
XSL
Same as above
Output
Device Rollout
Rollout status as of 01-16-2004
Unmodified
XML
<?xml version="1.0" ?>
- <Project xmlns=" <Name>test.xml</Name>
<Title>Device Rollout</Title>
<Company>0</Company>
<CreationDate>2004-01-13T15:45:00</CreationDate>
<LastSaved>2004-01-16T08:25:00</LastSaved>
</Project>
XSL
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="substring.xsl"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:template match="/">
<HTML>
<BODY BGCOLOR="white">
<H1 ALIGN="center"><xsl:value-of select="Project/Title"/></H1>
<xsl:variable name="Savetime" select="Project/LastSaved"/>
<H2 ALIGN="center"><font face="tahoma" size="3">Rollout status as of <xsl:value-of select='substring($Savetime,6,2)'/>-<xsl:value-of select='substring($Savetime,9,2)'/>-<xsl:value-of select='substring($Savetime,1,4)'/></font></H2>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Output
Rollout status as of --
*****************************
Modified
XML
<?xml version="1.0" ?>
- <Project>
<Name>test.xml</Name>
<Title>Device Rollout</Title>
<Company>0</Company>
<CreationDate>2004-01-13T15:45:00</CreationDate>
<LastSaved>2004-01-16T08:25:00</LastSaved>
</Project>
XSL
Same as above
Output
Device Rollout
Rollout status as of 01-16-2004