Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2004, 06:49 AM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic XSLT problem....

Hi all I am new to XSLT and am having problems which I cant understand with the following XSL doc, I am using Xalan:

Code:
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="kapil/note">
<xsl:value-of select="count(firstName)"/>
<xsl:value-of select="surname"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The name of the document is kapil.xsl and the XML contains <name><firstName>Pete</firstName><surname>Sampras</surname></name>....

What I want is to print out the fisrtName and surname elements which are contained within the <name> tags. I am not getting any output and cannot see why, please can someone advise me....

Cheers,

 
Old February 5th, 2004, 06:57 AM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Apologies the line in the previous post was wrong, it should have been:

Code:
<xsl:for-each select="kapil/name">
Even with this correct path I am getting no values returned,

 
Old February 6th, 2004, 09:13 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Does your xml have an all enclosing kapil element?

--

Joe




Similar Threads
Thread Thread Starter Forum Replies Last Post
help, basic xslt Yanson XSLT 4 June 19th, 2007 06:45 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
xslt basic question kgoldvas XSLT 2 January 25th, 2006 02:48 PM
basic xslt Question abhishek verma XSLT 4 January 24th, 2006 05:35 AM
Basic SQL Problem mattastic SQL Server 2000 4 December 8th, 2004 05:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.