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 June 4th, 2004, 10:46 AM
Canlador Canlador is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 Canlador User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XSL Help

Here's my problem to solve.

I've got an XML file structured like so:
Code:
<Root>
   <Level_1>
      <Title/>
      <Data/>
      <Level_2>
         <Title/>
         <Data/>
         <Level_3>
            ...
         </Level_3>
      </Level_2>
   </Level_1>
</Root>


The above file is actually a conglomeration of a DTD we've created and wordProcessingML (yes it's ugly, but that's what we've got to use given a requirement.) I don't know the exact structure of the XML files. I only know that basic framework defined by the DTD.

What I need to do is build a path reference (ie "Level_1_Title | Level_2_Title | Level_3_Title", etc) while I'm parsing the <Title/> nodes. I can select the correct node based on its parent, but I don't know how I can build a path. I have tried using a series of variables testing and storing the information in a variable like so:
Code:
<xsl:variable name="Level_1_Path">
			<xsl:choose>
				<xsl:when test="not(parent::ns0:Level2) and ../parent::ns0:Level1">
					<xsl:copy-of select="."/>
				</xsl:when>			
				<xsl:otherwise>
					false
				</xsl:otherwise>		
			</xsl:choose>		
		</xsl:variable>


The only problem is I can't then use these variables to build the path because once the variable is assigned, <Title/> has already been parsed and it's onto the next element wiping out my variables when the next <Title/> comes around.

Any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL Help


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 3 hosted by Hostway
Stay green...Green IT