XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 28th, 2004, 10:40 AM
jwthompson2 jwthompson2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: New Orleans
Posts: 3 jwthompson2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question XSLT Hang up...any help welcome...

I've been working on some XSLTs for a new content management system my employer is deploying and I have encounterd one rather frustrating hang up. I have a sitemap that is generated by the CMS in which a page is flagged with an attribute named 'current' and a value of 'true' indicating the page that includes the sitemap as part of it. The XSLT is applied to this Sitemap and finds the page with the 'current' attribute and then walks back up the sitemap marking the parent of the page with a tag name 'tagged' and a value of true and it does this all the way back up the chain. Where I am getting hung up is in writing the template that walks back down the tree looking for each of the 'tagged' folder items in the sitemap and then getting the value of their 'title' elements for display as part of a bread crumb trail.

Here is the Sitemap XML (without the 'current' attribute):

Code:
<?xml version="1.0" encoding="UTF-8"?>
<system-index-block name="Sitemap" current-time="1085758459172">
	<system-folder id="611adaa30a0101040084c1f9b7546308">
		<name>Academics</name>
		<path>/NOBTS/Academics</path>
	</system-folder>
	<system-folder id="a86aaa050a010104002e749cf9ef62c9">
		<name>Chapel</name>
		<path>/NOBTS/Chapel</path>
	</system-folder>
	<system-folder id="a86b13840a010104002e749c0fb8320a">
		<name>Enlistment</name>
		<display-name>Student Enlistment</display-name>
		<path>/NOBTS/Enlistment</path>
		<title>Student Enlistment</title>
		<system-page id="a86d5ce50a010104002e749c0c1e3eee">
			<name>Default</name>
			<title>Welcome to Shepherd's Corner</title>
			<path>/NOBTS/Enlistment/Default</path>
			<display-name>Welcome to Shepherd's Corner</display-name>
		</system-page>
	</system-folder>
	<system-folder id="a86ad4a20a010104002e749c0d4ee2ec">
		<name>Extensions</name>
		<path>/NOBTS/Extensions</path>
	</system-folder>
	<system-folder id="a86a62bc0a010104002e749c661a4a47">
		<name>LeavellCollege</name>
		<path>/NOBTS/LeavellCollege</path>
	</system-folder>
	<system-folder id="a86b8eca0a010104002e749c548d465b">
		<name>Library</name>
		<path>/NOBTS/Library</path>
	</system-folder>
	<system-page id="6fc6fc7e0a0101040084c1f99d473716">
		<name>Default</name>
		<title>Home Page</title>
		<description>New Orleans Baptist Theological Seminary</description>
		<path>/NOBTS/Default</path>
	</system-page>
	<system-page id="c217e0bf0a01010401ad44f61008eed3">
		<name>Sitemap</name>
		<title>Sitemap</title>
		<summary>Map of the NOBTS.EDU web site</summary>
		<author>James W. Thompson, II</author>
		<description>Map of the NOBTS.EDU web site.</description>
		<path>/NOBTS/Sitemap</path>
		<display-name>Sitemap</display-name>
	</system-page>
</system-index-block>


I attached the XSLT I am trying to work on...

The last template named 'walk-down-path' is where I am trying to implement the functionality. To be honest, I do not understand xpath well enough and would like any hints in the right direction I can get. Thanks!
Attached Files
File Type: txt NOBTSBreadCrumbs.txt (2.4 KB, 107 views)

Reply With Quote
  #2  
Old June 2nd, 2004, 09:50 AM
jwthompson2 jwthompson2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: New Orleans
Posts: 3 jwthompson2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Was able to get what I needed using a <xsl:for-each select="ancestor::system-folder"> construct which worked quite well.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSLT Hang up...any help welcome...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway