Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML/XSL Help

Status
Not open for further replies.

landspeeder1

IS-IT--Management
Jan 16, 2004
1
US
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=&quot;1.0&quot; ?>
- <Project xmlns=&quot; <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=&quot;text/xsl&quot; href=&quot;substring.xsl&quot;?>
<xsl:stylesheet version=&quot;1.0&quot;
xmlns:xsl=&quot;<xsl:template match=&quot;/&quot;>



<HTML>
<BODY BGCOLOR=&quot;white&quot;>
<H1 ALIGN=&quot;center&quot;><xsl:value-of select=&quot;Project/Title&quot;/></H1>
<xsl:variable name=&quot;Savetime&quot; select=&quot;Project/LastSaved&quot;/>
<H2 ALIGN=&quot;center&quot;><font face=&quot;tahoma&quot; size=&quot;3&quot;>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=&quot;1.0&quot; ?>
- <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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top