This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Reluctant question on start lines
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Reluctant question on start lines
- From: Meltem Kogelbauer <meltem dot kogelbauer at netdecisions dot co dot uk>
- Date: Fri, 20 Apr 2001 17:02:47 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
The first thing I see in your XML is a syntax error. I hope you are not
using it this way. Your
<AllNews> element should have a proper closing element.
Instead of using the following
<xsl:for-each select="AllNews/news">
<xsl:apply-templates
select="."/>
</xsl:for-each>
Try this only ( and it works, tested with Xalan v2)
<xsl:apply-templates select="AllNews/news"/>
Cheers
Meltem
-----Original Message-----
From: Koray Berk [mailto:berkk@ims.com.tr]
Sent: 20 April 2001 3:59 PM
To: XSLList (E-mail)
Subject: [xsl] Reluctant question on start lines
Question 1:
I had asked about the namspace files and according to the replies
<xsl:stylesheet version="1.0"
xmlns:xsl="<http://www.w3.org/1999/XSL/Transform>"
xmlns:fo="<http://www.w3.org/1999/XSL/Format>">
should be my starting line.
However my xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="news">
<b><xsl:value-of select="title"/></b><br/>
<i>Date:</i><xsl:value-of select="date"/><br/>
<i>Comment of <xsl:value-of select="provider"/>: <xsl:value-of
select="comment"/></i><br/>
<xsl:for-each select="body/p"><p
style="text-indent:50"><xsl:value-of
select="."/></p></xsl:for-each>
<br/><br/>
</xsl:template>
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="AllNews/news">
<xsl:apply-templates
select="."/>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
does not work for my xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by () -->
<?xml-stylesheet href = "haber.xsl" type="text/xsl"?>
<AllNews>
<news>
<title>This is the tile</title>
<date>This is the date</date>
<body><p>This is the body</p></body>
<comment>This is the comment</comment>
<provider>This is the provider</provider>
</news>
<AllNews>
All I get is a:
italic Date: and an itallic Comment of: and thats that!
I have downloaded MSXSML3.0 and installed it (it installed itself using an
installer)
I am using XMLSPY
and I dont understand why this doesnt work where as
the so unrecommended <xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"> works if I replace the relevant
line on my xsl.
(however with the old one <xsl:variable> doesnt work....
I am so confused....
koray
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list