Hi,
I'm trying to put my resume on my website, and I want to do it using
XML and XSL. If I don't include the schema in the mix, the xml
displays without a problem. When I add the schema location to the xml,
however, it doesn't seem to be displaying the html tags. It just puts
all the information on the screen in one big block, almost like it's
reading the xml information, but not the html I have in my XSL. I know
all the XML/XSL/XSD stuff is well-formed because I have an editor
(XMLSpy) to yell at me for that kind of stuff. Here's what I have so
far:
---BEGIN XML---
---XML---
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="resume.xs l"?>
<resume xmlns='http://www.nickshaw.ne t'
xmlns:xsi='http ://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocat ion='http://www.nickshaw.ne t resume.xsd'>
<contact-info>
<name>Nichola s J. Shaw</name>
<address location="Home" >
...
---XSL---
<xsl:styleshe et version="1.0" xmlns="http://www.nickshaw.ne t"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/resume">
<html>
<head>
<title>Resume </title>
<link rel="stylesheet " type="text/css" media="screen"
href="resume.cs s" />
</head>
<body>
<h1>
<xsl:value-of select="contact-info/name"/>
</h1>
<xsl:for-each select="contact-info/phone-number">
<xsl:value-of select="@locati on" />: <xsl:value-of
select="/resume/contact-info/phone-number" /><br/>
</xsl:for-each>
E-Mail: <xsl:value-of select="contact-info/e-mail" /><br/>
<xsl:for-each select="contact-info/address">
<p>
<h3><xsl:valu e-of select="@locati on" /></h3>
<xsl:value-of select="street-1"/>
<xsl:if test="street-2">, <xsl:value-of
select="street-2"/><br /></xsl:if>
<xsl:if test="not(stree t-2)"><br /></xsl:if>
<xsl:value-of select="city"/>, <xsl:value-of
select="state"/><br />
<xsl:value-of select="zip"/>
</p>
</xsl:for-each>
<h3>Objective </h3>
<p><xsl:value-of select="objecti ve" /></p>
<h3>Skills</h3>
<xsl:for-each select="skill-set/skill-group">
<h4><xsl:valu e-of select="@name" /></h4>
<ul>
<xsl:for-each select="skill">
<li><xsl:valu e-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Education </h3>
<xsl:for-each select="educati on">
<xsl:value-of select="univers ity" /><br />
<xsl:value-of select="start-date" /> through <xsl:value-of
select="end-date" /><br />
<xsl:if test="expected-graduation">
<xsl:value-of select="expecte d-graduation" /><br />
</xsl:if>
<ul>
<xsl:for-each select="degree" >
<li><xsl:valu e-of select="@type" /> in <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
<ul>
<xsl:for-each select="gpa">
<li><xsl:valu e-of select="@type" />: <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Coursewor k</h3>
<xsl:for-each select="coursew ork/class-group" >
<xsl:value-of select="@name" /><br />
<ul>
<xsl:for-each select="class">
<li><xsl:valu e-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Work Experience</h3>
<xsl:for-each select="work-experience/job">
<xsl:value-of select="company " /> - <xsl:value-of
select="locatio n" /><br />
<xsl:value-of select="job-title" /> - <xsl:value-of
select="start-date" /> through <xsl:value-of select="end-date" /><br />
<ul>
<xsl:for-each select="respons ibility">
<li><xsl:valu e-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Reference s</h3>
<ul>
<xsl:for-each select="referen ces/reference">
<li><xsl:valu e-of select="." /></li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
---XSD---
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.nickshaw.ne t"
targetNamespace ="http://www.nickshaw.ne t"
elementFormDefa ult="qualified" >
<xs:element name="resume">
<xs:complexType >
<xs:all>
<xs:element name="contact-info">
...
---END XML--
I think this is a problem with namespaces (or I could be completely
wrong). I am pretty new to all this (As of about 2 days ago). Any help
anyone could provide will be greatly appreciated. If you need any more
information, just ask. Thanks!
Nick Shaw