N
Nick Shaw
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.xsl"?>
<resume xmlns='http://www.nickshaw.net'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.nickshaw.net resume.xsd'>
<contact-info>
<name>Nicholas J. Shaw</name>
<address location="Home">
...
---XSL---
<xsl:stylesheet version="1.0" xmlns="http://www.nickshaw.net"
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.css" />
</head>
<body>
<h1>
<xsl:value-of select="contact-info/name"/>
</h1>
<xsl:for-each select="contact-info/phone-number">
<xsl:value-of select="@location" />: <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:value-of select="@location" /></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(street-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="objective" /></p>
<h3>Skills</h3>
<xsl:for-each select="skill-set/skill-group">
<h4><xsl:value-of select="@name" /></h4>
<ul>
<xsl:for-each select="skill">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Education</h3>
<xsl:for-each select="education">
<xsl:value-of select="university" /><br />
<xsl:value-of select="start-date" /> through <xsl:value-of
select="end-date" /><br />
<xsl:if test="expected-graduation">
<xsl:value-of select="expected-graduation" /><br />
</xsl:if>
<ul>
<xsl:for-each select="degree">
<li><xsl:value-of select="@type" /> in <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
<ul>
<xsl:for-each select="gpa">
<li><xsl:value-of select="@type" />: <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Coursework</h3>
<xsl:for-each select="coursework/class-group" >
<xsl:value-of select="@name" /><br />
<ul>
<xsl:for-each select="class">
<li><xsl:value-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="location" /><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="responsibility">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>References</h3>
<ul>
<xsl:for-each select="references/reference">
<li><xsl:value-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.net"
targetNamespace="http://www.nickshaw.net"
elementFormDefault="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
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.xsl"?>
<resume xmlns='http://www.nickshaw.net'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.nickshaw.net resume.xsd'>
<contact-info>
<name>Nicholas J. Shaw</name>
<address location="Home">
...
---XSL---
<xsl:stylesheet version="1.0" xmlns="http://www.nickshaw.net"
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.css" />
</head>
<body>
<h1>
<xsl:value-of select="contact-info/name"/>
</h1>
<xsl:for-each select="contact-info/phone-number">
<xsl:value-of select="@location" />: <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:value-of select="@location" /></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(street-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="objective" /></p>
<h3>Skills</h3>
<xsl:for-each select="skill-set/skill-group">
<h4><xsl:value-of select="@name" /></h4>
<ul>
<xsl:for-each select="skill">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Education</h3>
<xsl:for-each select="education">
<xsl:value-of select="university" /><br />
<xsl:value-of select="start-date" /> through <xsl:value-of
select="end-date" /><br />
<xsl:if test="expected-graduation">
<xsl:value-of select="expected-graduation" /><br />
</xsl:if>
<ul>
<xsl:for-each select="degree">
<li><xsl:value-of select="@type" /> in <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
<ul>
<xsl:for-each select="gpa">
<li><xsl:value-of select="@type" />: <xsl:value-of
select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>Coursework</h3>
<xsl:for-each select="coursework/class-group" >
<xsl:value-of select="@name" /><br />
<ul>
<xsl:for-each select="class">
<li><xsl:value-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="location" /><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="responsibility">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
<h3>References</h3>
<ul>
<xsl:for-each select="references/reference">
<li><xsl:value-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.net"
targetNamespace="http://www.nickshaw.net"
elementFormDefault="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