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 August 15th, 2005, 08:22 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default output frustrations, please help!

I cannot understand why my I'm outputting text elements that are outside of my explicit xpath context. I've uploaded my work so far: www.figit.com/dev/xslt.zip w/o the associated images and css. You'll notice I have my xml file and 2 xslt files. One "navoptions.xsp" is only for stroring navigation instances, this site wont have frames so I needed a way to store various active/selected/expanded versions of the navigation. I'm setting up parameters based on the content.xml file, you'll see what I mean. Anyhow the problem that has been killing me for like 2 days now is I can't seem to output only whats in the pageOne element. I've tried a ton of different ways but cant seem to get this. The output I desire would be

pageOne's content including the headers/links and the navigation instance I'm calling on by name and thats it. Nothing from page two, also notice that its outputting the elements for the navigation options. I dont want that at the bottom either : o ).

If anyone could download these files and take a look that would be soooo great. I think it has something to do with my apply templates tags, thanks in avance for any help you can offer me!

Thanks,
-mike


 
Old August 22nd, 2005, 11:10 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rushman
Default

Yo Mike!

I had a look and I think I know what your problem is.

When you call <xsl:apply-templates/> in the TD class="stage", your context node is the document root. Calling this will apply templates to all child nodes, including page TWO. Since you don't explicitly have a template for it, I think it defaults to applying templates to any child of page TWO. So you'll get something outputted for page two's <paragraph>.

If you really want to be sure, try using <xsl:apply-templates match="YOUR XPATH EXPRESSION"/> whenever its possible.

Try adding this template to pageOne.xsl

<xsl:template match="content">
  <xsl:apply-templates select="pageOne"/>
</xsl:template>

This way, no other page but pageOne will be selected and the navigation options won't show up.

Hoping this help a little,
RushMan

Dijkstra's law on Programming and Inertia:

If you don't know what your program is supposed to do, don't try to write it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
tell me the output abdul_owiusa C# 3 May 10th, 2007 04:25 AM
Frustrations of Split(long) enterbase Access VBA 6 January 27th, 2004 04:19 PM
Frustrations with setting up site in VS.NET!!! buzzterrier BOOK: ASP.NET Website Programming Problem-Design-Solution 5 January 20th, 2004 02:02 AM
Datagrid Frustrations rob225 Pro VB 6 0 December 30th, 2003 11:40 PM
how to get this output? Haroldd SQL Language 2 July 16th, 2003 07:24 AM





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