XML/XSLT doesn't display properly in a browser

hi, i'm a xml/xslt beginner having trouble getting a simple network inventory doc to display correctly in a browser (it just shows a list of values, no formatting), i'd appreciate any feedback r.e. where i'm going wrong.  thanks.

XML code - networkinventory.xml

<?xml version="1.0" encoding="ISO8859-1"?>
<?xml-stylesheet type="text/xsl" href="networkinventory.xsl"?>
<!DOCTYPE NetworkInventory [
<!ELEMENT NetworkInventory (ComputerName,UserID,Password,IPAddress,Department,Location)>
<!ELEMENT ComputerName (#PCDATA)>
<!ELEMENT UserID (#PCDATA)>
<!ELEMENT Password (#PCDATA)>
<!ELEMENT IPAddress (#PCDATA)>
<!ELEMENT Department (#PCDATA)>
<!ELEMENT Location (#PCDATA)>
<!ELEMENT IPAddress (#PCDATA)>
]>
<NetworkInventory>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>PC_1</ComputerName>
    <UserID>GOByrne</UserID>
    <Password>jumpship</Password>
    <IPAddress>192.168.1.21</IPAddress>
    <Department>New Business</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>PC_2</ComputerName>
    <UserID>GODwyer</UserID>
    <Password>motion</Password>
    <IPAddress>192.168.1.22</IPAddress>
    <Department>Renewals</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>PC_3</ComputerName>
    <UserID>RMCGrath</UserID>
    <Password>flood</Password>
    <IPAddress>192.168.1.23</IPAddress>
    <Department>Renewals</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
  <NetworkInv>
    <ComputerName>AdminPC</ComputerName>
    <UserID>TOKeeffe</UserID>
    <Password>migrate</Password>
    <IPAddress>192.168.1.20</IPAddress>
    <Department>IT</Department>
    <Location>Waterford</Location>
  </NetworkInv>
</NetworkInventory>  

XSLT Code - NetworkInventory.xsl

<?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="/">
  <html>
  <body>
  <h2>Network Inventory</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
            <th>ComputerName</th>
            <th>UserID</th>
      <th>Password</th>
      <th>IPAddress</th>
      <th>Department</th>
      <th>Location</th>
    </tr>
    <xsl:for-each select="network/inventory">
    <tr>
            <td><xsl:value-of select="ComputerName"/></td>
            <td><xsl:value-of select="UserID"/></td>
      <td><xsl:value-of select="Password"/></td>
      <td><xsl:value-of select="IPAddress"/></td>
      <td><xsl:value-of select="Department"/></td>
      <td><xsl:value-of select="Location"/></td>
    </tr>
    </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
tokeeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Gertone (Geert Bormans)Information ArchitectCommented:
Your DTD is not correct

<!DOCTYPE NetworkInventory [
<!ELEMENT NetworkInventory (NetworkInv)+>
<!ELEMENT NetworkInv (ComputerName,UserID,Password,IPAddress,Department,Location)>
<!ELEMENT ComputerName (#PCDATA)>
<!ELEMENT UserID (#PCDATA)>
<!ELEMENT Password (#PCDATA)>
<!ELEMENT IPAddress (#PCDATA)>
<!ELEMENT Department (#PCDATA)>
<!ELEMENT Location (#PCDATA)>

and there is a bug in the XPath for the for each

           <xsl:for-each select="NetworkInventory/NetworkInv">

and then it works
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
tokeeAuthor Commented:
Thanks a lot Gertone, it would've taken me a long time to spot that!  Tony
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.