[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem writing a XSLT stylesheet

Subject: Problem writing a XSLT stylesheet
From: Mukul <mukulw3@xxxxxxxxx>
Date: Mon, 17 Feb 2003 22:05:23 -0800 (PST)
writing an xslt
Hello ,

I have a XML file as below.

XML file
---------
<rootelem>
<TAG>
  <A>dfdf</A>
  <B>gfgfgg</B>
  <C>ytyty</C>
  <D>ghghgh</D>
  <E>ghghgh</E>
</TAG>
<TAG>
  <C>ytyty</C>
  <D>ghghgh</D>
  <E>ghghgh</E>
</TAG>
<TAG>
  <B>ghgh</B>
  <C>ytyty</C>
  <D>ghghgh</D>
  <E>ghghgh</E>
</TAG>
<TAG>
  <C>ytyty</C>
  <D>ghghgh</D>
  <E>ghghgh</E>
</TAG>
<!..TAG can repeat any no of times -->
</rootelem>


There are certain tags missing in <TAG>. The missing
tags <A> and <B> are repetitive information. Therefore
the first <TAG> tag will have data and will not be
present in tags after that unless there is a change in
these tag's value. 

The <A> tag can have 3 possible values
value1, value2, value3

Based on this value, the label for <E> that needs to
be output will change --
if <A> is value1, output E's label as Label1
if <A> is value2, output E's label as Label2
if <A> is value3, output E's label as Label3


I want the output to appear as

Label1  <value-of E>
Label3  <value-of E>
Label2  <value-of E>
..etc
(the Labels will be different depending on the value
of <A>)

I am trying to do this in XSLT but am facing problem
in doing so. I tried using a variable for E's Label
and assigning it Label value depending on <A> but this
was not possible as A is sent in XML tag for the first
time and thereafter it is not present in XML file
until a new A is to be displayed. 

Can anybody please help?

Regards,
Mukul

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.