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 July 31st, 2013, 10:25 AM
Registered User
 
Join Date: Jul 2013
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Post How to get node value in XSLT which comes within 2 different but continius tag

Hi,

I am newbie to XSLT, in fact today only I started working on it. I learn some basic stuffs but got stuck on some point. please see below XML.
Code:
<section>
<title>Phonemic Awareness</title>
<p><b>Use the Poetry Poster</b></p>
</section>
<section>
<title>Phonemic Awareness</title>
<p>Use the Poetry Poster</p>
</section>
<section>
<title>Phonemic Awareness</title>
<b>Use the Poetry Poster</b>
</section>
I would like to retrieve value which is inside "<p><b>" tag & which are in continuous in order (i.e. first <p> and then immediately <b> tag comes). How can i get this value in my xslt (I m transforming xml to html file). Appreciate if you can help me on same asap.

Thanks,
Abdul
 
Old July 31st, 2013, 10:30 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

//p/b[not(preceding-sibling::node())]
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
XSLT_Prof (July 31st, 2013)
 
Old July 31st, 2013, 10:43 AM
Registered User
 
Join Date: Jul 2013
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks mhkay.

It solved my problem. Could you please describe me same because I am new for this so would like to get idea on same.

Thanks,
Abdul
 
Old July 31st, 2013, 11:09 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Have you got my book? It explains all this in great detail.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old July 31st, 2013, 11:11 AM
Registered User
 
Join Date: Jul 2013
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Not yet, but I'll for sure..

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL:FO tag for repetetive child node bug XSLT 1 July 22nd, 2011 06:46 AM
Increment tag by 1 using XSLT Divya XSLT 10 April 13th, 2010 05:39 AM
Determine If A Tag or Node Exists coolpeep Classic ASP XML 2 July 20th, 2006 06:16 PM
xslt for each and attribute tag desse XSLT 1 May 24th, 2006 08:01 AM
How to use XPath to retrieve a node tag rs:data? y10k XML 1 May 5th, 2006 01:11 PM





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