This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Ye ole XML->XSL->HTML Question
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] Ye ole XML->XSL->HTML Question
- From: Nathan Shaw <n8_shaw at yahoo dot com>
- Date: Tue, 17 Jul 2001 10:52:56 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
(Sent this once, but did not seem to go thru.
Apologies if it is a dup.)
Using MSXML to parse an XML file using an XSL file.
However, when I view source on the HTML file that is
produced (which looks nothing like it should), I see
all of my XSL instructions.
I am running the conversion thru XMLWriter, which uses
MSXML. I have run other files thru there successfully,
so I think it is my XSL file. However, XMLWriter is
not giving me any error messages when I run the
conversion.
Thoughts? Ideas? Help!? --Nate
-------------------------------------------------------
XML File:
<?xml version="1.0" ?>
<!DOCTYPE WebContent PUBLIC "-//Alex Pline/DTD
OBPRWebContent//EN//"
"OBPRWebContent.dtd">
<?xml-stylesheet type="text/xsl"
href="OBPRWebContent.xsl"?>
<WebContent>
<Navigation>
<MainMenu>
<MainMenuItem URL="/">Home</MainMenuItem>
<MainMenuItem URL="/strat.html">Strategic
Vision</MainMenuItem>
<MainMenuItem URL="/themes.html">Research
Themes</MainMenuItem>
<MainMenuItem
URL="/edu.html">Education</MainMenuItem>
<MainMenuItem
URL="http://commercial.hq.nasa.gov">Commercial</MainMenuItem>
</MainMenu>
<SubMenu>
<SubMenuItem
URL="/strat.html#v">Mission</SubMenuItem>
<SubMenuItem
URL="/strat.html#g">Goals</SubMenuItem>
<SubMenuItem
URL="/strat.html#p">Philosophy</SubMenuItem>
</SubMenu>
</Navigation>
<Content>
<Header Title="OBPR Strategic Vision" />
<Section Title="Mission">
<SectionText>Conduct basic and applied research to
support human
exploration of space and to take advantage of the
space environment as a
laboratory for scientific, technological, and
commercial research.</SectionText>
<List Type="Unordered">
<ListItem
URL="http://www.hq.nasa.gov/office/codez/plans/pl2000.pdf"
Caption="3.18 MB pdf">NASA Strategic Plan</ListItem>
<ListItem
URL="http://www.hq.nasa.gov/office/codez/plans.html">NASA
Planning Documents</ListItem>
</List>
</Section>
<Section Title="Goals">
<List Type="Unordered">
<ListItem>Enable Exploration: Conduct research
to enable safe and
productive human habitation of space</ListItem>
<ListItem>Science: Use the space environment as
a laboratory to test the
fundamental principles of physics, chemistry, and
biology</ListItem>
<ListItem>Commerce: Enable and promote
commercial research in
space</ListItem>
<ListItem>Outreach: Use space research
opportunities to improve academic
achievement and the quality of life</ListItem>
</List>
</Section>
</Content>
</WebContent>
-------------------------------------------------------
XSL File:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" href="styles.css"
type="text/css" />
<title>OBPR Enterprise - <xsl:value-of
select="Content/Header/@Title" /></title>
</head>
<body text="#000000" bgcolor="#ffffff" alink="#cc0000"
link="#3333ff"
vlink="#003399">
<div align="center">
<table width="500" border="0" cellspacing="0"
cellpadding="0" align="center">
<tr>
<td align="left" valign="top"><a
href="/index.html"><img src="2bpre.gif"
height="90" width="300" alt="Biological and Physical
Research Enterprise"
border="0" /></a><a href="http://www.nasa.gov/"><img
src="nlogo.gif"
align="bottom" height="48" width="59" border="0"
alt="NASA Logo" /></a></td>
</tr>
</table>
<br />
<xsl:apply-templates />
</div>
</body>
</html>
</xsl:template>
<!-- navigation -->
<xsl:template match="Navigation">
<table width="500" border="0" cellspacing="0"
cellpadding="0" align="center">
<xsl:apply-templates />
</table>
<br />
</xsl:template>
<xsl:template match="MainMenu">
<tr>
<td align="center" valign="bottom"
class="topnav"><xsl:apply-templates /></td>
</tr>
</xsl:template>
<xsl:template match="MainMenuItem">
<xsl:for-each select=".">
<b><a href="{@URL}"><xsl:apply-templates
/></a></b><xsl:if
test="not(position()=last)">&nbsp;|&nbsp;</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- sub menu -->
<xsl:template match="SubMenu">
<tr>
<td align="center" valign="bottom"
class="subnav"><hr size="1"
noshade="noshade" /><br /><xsl:apply-templates /></td>
</tr>
</xsl:template>
<xsl:template match="SubMenuItem">
<xsl:for-each select=".">
<b><a href="{@URL}"><xsl:apply-templates
/></a></b><xsl:if
test="not(position()=last)">&nbsp;|&nbsp;</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- content -->
<xsl:template match="Content">
<table width="500" border="0" cellspacing="0"
cellpadding="3" align="center">
<tr>
<td valign="top" width="100%" bgcolor="#ccccff"
class="pageheader"><b>
<xsl:value-of select="Header/@Title" /></b></td>
</tr>
<tr>
<td valign="top" width="100%"><xsl:apply-templates
/></td>
</tr>
</table>
<br />
</xsl:template>
<xsl:template match="HeaderText">
<div><xsl:copy-of select="." /></div>
</xsl:template>
<!-- section -->
<xsl:template match="Section">
<div><b><xsl:if test="@URL != ''"><a
href="{@URL}"><xsl:value-of
select="@Title" /></a></xsl:if><xsl:if test="@URL =
''"><xsl:value-of
select="@Title" /></xsl:if></b><br /><hr size="1"
noshade="noshade" /></div>
</xsl:template>
<xsl:template match="SectionText">
<div><xsl:copy-of select="." /></div>
</xsl:template>
<!-- subsection -->
<xsl:template match="SubSection">
<div><b><xsl:if test="@URL != ''"><a
href="{@URL}"><xsl:value-of
select="@Title" /></a></xsl:if><xsl:if test="@URL =
''"><xsl:value-of
select="@Title" /></xsl:if></b></div>
</xsl:template>
<xsl:template match="SubSectionText">
<div><xsl:copy-of select="." /></div>
</xsl:template>
<!-- list -->
<xsl:template match="List">
<div><b><xsl:if test="@URL != ''"><a
href="{@URL}"><xsl:value-of
select="@Title" /></a></xsl:if><xsl:if test="@URL =
''"><xsl:value-of
select="@Title" /></xsl:if></b><br />
<xsl:choose>
<xsl:when test="@type='Unordered'">
<ul><xsl:apply-templates /></ul>
</xsl:when>
<xsl:when test="@type='Ordered'">
<ol><xsl:apply-templates /></ol>
</xsl:when>
<xsl:otherwise>
<ul><xsl:apply-templates /></ul>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<xsl:template match="ListItem">
<li><xsl:if test="@URL != ''"><a
href="{@URL}"><xsl:apply-templates /></a>
</xsl:if><xsl:if test="@URL = ''"><xsl:apply-templates
/></xsl:if><xsl:if
test="@Caption != ''"> [<xsl:value-of
select="@Caption" />]</xsl:if></li>
</xsl:template>
<!-- image -->
<xsl:template match="Image">
<xsl:if test="@LinkURL != ''"><a
href="{@LinkURL}"><img src="{@SourceURL}"
width="{@Width}" height="{@Height}" align="{@Align}"
name="{@Name}"
border="{@Border}" alt="{@AltText}" /></a></xsl:if>
<xsl:if test="@LinkURL =
''"><img src="{@SourceURL}" width="{@Width}"
height="{@Height}"
align="{@Align}" name="{@Name}" border="{@Border}"
alt="{@AltText}" /></xsl:if>
</xsl:template>
<!-- table -->
<xsl:template match="Table">
<table cellspacing="{@CellSpacing}"
cellpadding="{@CellPadding}"
border="{@Border}" width="{@Width}" height="{@Height}"
summary="{@Summary}"
align="{@Align}" bgcolor="{@BGColor}">
<xsl:if test="@Title != ''"><caption><xsl:value-of
select="@Title" /></caption>
</xsl:if>
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="TableHeader">
<tr><xsl:apply-templates /></tr>
</xsl:template>
<xsl:template match="TableColumnHeader">
<th bgcolor="{@BGColor}" width="{@Width}"
height="{@Height}" align="{@Align}"
valign="{@VAlign}" rowspan="{@RowSpan}"
colspan="{@ColSpan}"><xsl:copy-of
select="." /></th>
</xsl:template>
<xsl:template match="TableRow">
<tr><xsl:apply-templates /></tr>
</xsl:template>
<xsl:template match="TableRowHeader">
<th bgcolor="{@BGColor}" width="{@Width}"
height="{@Height}" align="{@Align}"
valign="{@VAlign}" rowspan="{@RowSpan}"
colspan="{@ColSpan}"><xsl:copy-of
select="." /></th>
</xsl:template>
<xsl:template match="TableRowCell">
<td bgcolor="{@BGColor}" width="{@Width}"
height="{@Height}" align="{@Align}"
valign="{@VAlign}" rowspan="{@RowSpan}"
colspan="{@ColSpan}"><xsl:copy-of
select="." /></td>
</xsl:template>
<!-- Begin lower boilerplate -->
<table width="500" border="0" cellspacing="0"
cellpadding="0" align="center">
<tr>
<td class="footer" align="right"><hr size="1" />NASA
Headquarters Responsible
Official: Code U<br />Curator: <a
href="/contact.html">Office of Biological and
Physical Research</a></td>
</tr>
</table>
<!-- End lower boilerplate -->
</xsl:stylesheet>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list