XML / Basic XSL Document

Team can someone help me create two basic XSL docs to display the following code in HTML. It's for demo purposes but urgent.  Just a nice clean basic layout.
Thanks kindly

FIRST
====
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Requirements SYSTEM "E:\Documents and Settings\Administrator\Desktop\xml\requirements.dtd">
<Requirements>
     <ProjectTitle>Extensible Markup Project</ProjectTitle>
     <Purpose>Create A XML File</Purpose>
     <InterfaceGuidelines>Web Based Training</InterfaceGuidelines>
     <PublicContent>
          <Sections>
               <Title>Extensible Markup File</Title>
               <Abstract>This is the creation of an XML file</Abstract>
          </Sections>
     </PublicContent>
     <DocumentationArtifacts>
          <Artifact>
               <ArtTitle>Extensible Markup File Creation</ArtTitle>
               <DescriptionofDocument>Shows how to create an XML file</DescriptionofDocument>
          </Artifact>
     </DocumentationArtifacts>
     <Glossary>
          <GlossaryEntry>
               <Word>Extensible Markup Language XML</Word>
               <Definition>Stands for Extensible Markup Language</Definition>
          </GlossaryEntry>
     </Glossary>
</Requirements>



SECOND
=====
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE TimeEntries SYSTEM "E:\Documents and Settings\Administrator\Desktop\xml\timeEntries.dtd">
<TimeEntries>
      <Date>Jan 1st 2005</Date>
      <TotalTime>48</TotalTime>
      <Name>John Smith</Name>
      <ChargeTo>
            <Requirements>YES</Requirements>
      </ChargeTo>
      <Comments>Pay by Cheque</Comments>
</TimeEntries>

pauldhadiallaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LeviterCommented:
FIRST
====

<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="no" omit-xml-declaration="no" />

<xsl:template match="/Requirements">
      <html>
      <head>
            <title><xsl:value-of select="ProjectTitle"/></title>
      </head>
      <body>
            <h1><xsl:value-of select="ProjectTitle"/></h1>
            
            <p><xsl:value-of select="Purpose"/></p>
            <p><xsl:value-of select="InterfaceGuidelines"/></p>
            
            <xsl:apply-templates select="PublicContent/Sections"/>
            <xsl:apply-templates select="DocumentationArtifacts/Artifact"/>
            
            <br/>
            <br/>
            <h3>Glossary</h3>
            <xsl:apply-templates select="Glossary/GlossaryEntry"/>
      </body>
      </html>
</xsl:template>

<xsl:template match="PublicContent/Sections">
      <h2><xsl:value-of select="Title"/></h2>
      <p><xsl:value-of select="Abstract"/></p>
</xsl:template>

<xsl:template match="DocumentationArtifacts/Artifact">
      <h2><xsl:value-of select="ArtTitle"/></h2>
      <p><xsl:value-of select="DescriptionofDocument"/></p>
</xsl:template>

<xsl:template match="Glossary/GlossaryEntry">
      <xsl:value-of select="Word"/> - <xsl:value-of select="Definition"/><br/>
</xsl:template>

</xsl:stylesheet>


SECOND
======
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="no" omit-xml-declaration="no" />

<xsl:template match="/TimeEntries">
      <html>
      <head>
            <title>Time entries</title>
      </head>
      <body>
            <table>
                  <tr>
                        <th>Date</th>
                        <th>Totaltime</th>
                        <th>Name</th>
                        <th>ChargeTo</th>
                        <th>Comments</th>
                  </tr>
                  <tr>
                        <td><xsl:value-of select="Date"/></td>
                       <td><xsl:value-of select="TotalTime"/></td>
                       <td><xsl:value-of select="Name"/></td>
                       <td><xsl:value-of select="ChargeTo/Requirements"/></td>
                       <td><xsl:value-of select="Comments"/></td>
                 </tr>
           </table>
      </body>
      </html>
</xsl:template>
</xsl:stylesheet>



This is just something you can do... I don't know what it is you are trying to demo, but this could be a start for a 'cool' demo.  :-)

For the second example I would add an extra level so that multiple time entries are possible. It would look like this:

<TimeEntries>
     <Entry>
          <Date>Jan 1st 2005</Date>
          <TotalTime>48</TotalTime>
          <Name>John Smith</Name>
          <ChargeTo>
               <Requirements>YES</Requirements>
          </ChargeTo>
          <Comments>Pay by Cheque</Comments>
     </Entry>
</TimeEntries>



Good luck with your demo........
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
YZlatCommented:
FIRST
___________
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="/">
            <TABLE STYLE="border:1px solid red">
                  <TR STYLE="font-family:Verdana; font-size:8pt;color: red; padding:0px 2px;">
                        <TD STYLE="border: 1px solid red">Project Title</TD>
                        <TD STYLE="border: 1px solid red">Purpose</TD>
                        <TD STYLE="border: 1px solid red">Interface Guidelines</TD>
                        <TD STYLE="border: 1px solid red">Section Title</TD>
                        <TD STYLE="border: 1px solid red">Abstract</TD>
                        <TD STYLE="border: 1px solid red">Artifact title</TD>
                        <TD STYLE="border: 1px solid red">Artifact Description</TD>
                        <TD STYLE="border: 1px solid red">Glossary Entry</TD>
                        <TD STYLE="border: 1px solid red">Definition</TD>  

                  </TR>
                  <xsl:for-each select="Requirements">
                        <TR STYLE="font-family:Verdana; font-size:8pt;color: red; padding:0px 2px;">
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="ProjectTitle" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Purpose" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="InterfaceGuidelines" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="PublicContent/Title" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="PublicContent/Abstract" />
                              </TD>
                              
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Glossary/GlossaryEntry/Word" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Glossary/GlossaryEntry/Definition" />
                              </TD>
                              
                        </TR>
                  </xsl:for-each>

            </TABLE>
 </xsl:template>
 </xsl:stylesheet>
 
 
SECOND
___________
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="/">
            <TABLE STYLE="border:1px solid red">
                  <TR STYLE="font-family:Verdana; font-size:8pt;color: red; padding:0px 2px;">
                        <TD STYLE="border: 1px solid red">Date</TD>
                        <TD STYLE="border: 1px solid red">Total Time</TD>
                        <TD STYLE="border: 1px solid red">Name</TD>
                        <TD STYLE="border: 1px solid red">Requirements</TD>
                        <TD STYLE="border: 1px solid red">Comments</TD>
                  
                  </TR>
                  <xsl:for-each select="TimeEntries">
                        <TR STYLE="font-family:Verdana; font-size:8pt;color: red; padding:0px 2px;">
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Date" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="TotalTime" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Name" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="ChargeTo/Requirements" />
                              </TD>
                              <TD STYLE="border: 1px solid red">
                                    <xsl:value-of select="Comments" />
                              </TD>      
                        </TR>
                  </xsl:for-each>

            </TABLE>
 </xsl:template>
 </xsl:stylesheet>
 
 

Also put this line in your xml file on the very top:

<?xml-stylesheet type="text/xsl" href="myXSLFile.xslt"?>

 following <?xml version="1.0" encoding="UTF-8" ?>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.