Re: Another newbie question

Subject: Re: Another newbie question
From: Nicole Gustas <ngustas@xxxxxxxxxxxxx>
Date: Tue, 14 Mar 2000 14:05:40 -0500
OK.  I have looked over my original XSL and couldn't find a <xsl:value-of>
statement.  All my <xsl:template> statements had a match attribute. I
changed my <xsl:apply-templates> statements to <xsl:value-of>, but no joy.
(XML, XSL and DTD follow; see below.)

When I remove the body statement (in HTML), I just wind up with a big white
blank page instead of a big black blank page.  I have replaced my
apply-templates statements with value-of statements, and I still get the
same results.  I have changed the "body" element to "main", and I still get
the same result.  I have changed my <xsl:template> statements from
<xsl:template match="title"> to <xsl:template match="title()"> (for example)
and still get the same results.  When I change my namespace declaration, I
still get a big blank page.

Obviously, I'm missing something else here.

Sorry to take up bandwidth with this, but it is becoming the bane of my
existence.  I'm not expecting anyone to have an answer for me, but I am
hoping someone is bored enough to figure out what I'm missing.  So far I
have tried every suggestion but no luck.

-------------------
DTD
-------------------
<!ENTITY copyright "This photo copyright Nicole Gustas, 2000." >
<!ENTITY index "Back to this person's index." >
<!ENTITY yplt "Back to You Pretty Little Things" >
<!ENTITY home "Back to Nikki's home page" >

<!ELEMENT document (title, body, footer) >
<!ELEMENT title EMPTY >
<!ATTLIST title name CDATA #REQUIRED
  num CDATA #REQUIRED >
<!ELEMENT main (img | text)* >
<!ELEMENT img EMPTY >
<!ATTLIST img
 src CDATA #REQUIRED
 alt CDATA #REQUIRED
 height CDATA #REQUIRED
 width CDATA #REQUIRED
 >
<!ELEMENT text (#PCDATA) >
<!ELEMENT footer (next?, prev?, index, yplt, home, copyright) >
<!ELEMENT next EMPTY >
<!ATTLIST next
 href CDATA #REQUIRED
 text (next) #FIXED 'next' >
<!ELEMENT prev EMPTY >
<!ATTLIST prev
 href CDATA #REQUIRED
 text (last) #FIXED 'last' >
<!ELEMENT index EMPTY >
<!ATTLIST index
 href CDATA #REQUIRED
 text (index) #FIXED 'index' >
<!ELEMENT yplt EMPTY >
<!ATTLIST yplt
 href CDATA #REQUIRED
 text (yplt) #FIXED 'yplt' >
<!ELEMENT home EMPTY >
<!ATTLIST home
 href CDATA #REQUIRED
 text (home) #FIXED 'home' >
<!ELEMENT copyright EMPTY >
<!ATTLIST copyright
 date CDATA #FIXED 'copyright' >

-------------------------
XSL
-------------------------
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="document()">
<xsl:apply-templates/>

</xsl:template>
<body bgcolor="Black" text="White" link="#CCCCCC" vlink="Red" alink="Blue"/>

<xsl:template match="title()">
<font face="arial,helvetica,helv" size="+3"><b><xsl:value-of select="name"/>

  <xsl:value-of select="num"/></b></font>

</xsl:template>
<xsl:template match="main()">
 <table width="600" border="0" cellpadding="6">
 <tr>
  <td align="top" valign="left">
   <xsl:value-of match="img"/>
  </td>
  <td align="top" valign="left">
   <p><font color="#000000"><xsl:value-of match="text"/></font></p>
  </td>
  </tr>
  </table>
 </xsl:template>
 </xsl:stylesheet>

-------------------------
XML
-------------------------
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="gallery.xsl"?>

<!DOCTYPE document SYSTEM "gallery.dtd">
<document>
<title name="John" num="3"/>
<main>
<img src="john3.jpg" alt="Lighting Candles" height="257" width="287"/>
<text>Lighting candles.</text>
</main>
<footer>
<index href="index.htm"/>
<yplt href="../pretty.htm"/>
<home href="../index.html"/>
<copyright/>
</footer>
</document>

RSuiter@xxxxxxxxx wrote:

> I think Mike has pointed to your problem here.
> The namespace declaration is the one for XSLT.
> The syntax you show looks a lot like IE5 (which did not require the
> "select" on value-of).
> Whatever you are trying to do, you can't do both of these.
> So:
> If you are using IE5, use the namespace declaration that it says to use.
> If you are using real XSLT, fix the value-of statements.
>
> Rick Suiter
>
> To the original problem, Mike Kay replied:
> ><xsl:value-of> in XSLT has a mandatory select attribute, and
> <xsl:template>
> >must have either a name or a match attribute, or both. Judging from the
> >namespace declaration, the poster was using XSLT.
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread