Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 11th, 2009, 11:37 AM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default not able to print child node value using value-of select

this is my XSL
<?xml version="1.0"?>
<abc:news xmlns:abc="http://abc.com/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:chiba="http://chiba.sourceforge.net/xforms">
<abc:page>
<abc:image>heroimage1.jpg</abc:image>
<abc:year/>
<abc:headlines>
<abc:intro>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In quis erat. Aenean bibendum. Cras eleifend turpis sed dui. Aenean ac libero quis erat molestie commodo. Suspendisse potenti."</abc:intro>
</abc:headlines>
<abc:headlines>
<abc:intro>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In quis erat. Aenean bibendum. Cras eleifend turpis sed dui. Aenean ac libero quis erat molestie commodo. Suspendisse potenti."</abc:intro>
</abc:headlines>
<abc:headlines>
<abc:intro>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In quis erat. Aenean bibendum. Cras eleifend turpis sed dui. Aenean ac libero quis erat molestie commodo. Suspendisse potenti."</abc:intro>
</abc:headlines>
</abc:page>
</abc:news>

Here is my XSL from template.


<xsl:template match="/">
<xsl:for-each select="//abc:headlines">
<xsl:value-of select="abc:intro"/><br/>
</xsl:for-each>
</xsl:template>
 
Old February 11th, 2009, 11:50 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Can't see anything wrong with your code. How did it fail? Perhaps you declared the namespace incorrectly?
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 11th, 2009, 11:52 AM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

namespace is correct. No idea why its failing basically just displays a blank page on output. This is what I have above template tag

<xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rcdc="http://rcdc.com/rcdc" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:exsl="http://exslt.org/common" exclude-result-prefixes="xhtml">
<xsl:output method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="

Last edited by eruditionist; February 11th, 2009 at 11:54 AM..
 
Old February 11th, 2009, 11:55 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please supply the full stylesheet and explain how you are running the transformation.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 11th, 2009, 12:02 PM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

the forum wont allow me to upload the full stylesheet it cuts off after doctype. You were right I was using incorrect namesapce

Last edited by eruditionist; February 11th, 2009 at 12:07 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Select correct child node richieWolf XSLT 4 September 24th, 2008 08:53 AM
how to append child node after an node in XML + C# vishnu108mishra XML 5 November 13th, 2007 05:30 AM
Select first child node that matches criteria priya81 XSLT 4 July 3rd, 2007 10:32 AM
Select node whose child value matches Fantmx XSLT 5 February 16th, 2007 04:54 PM
Select parent node when any one child has key pparadesia XSLT 2 January 7th, 2005 11:29 AM





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