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

WD-xsl: Variables, XSL(T) conversion, etc

Subject: WD-xsl: Variables, XSL(T) conversion, etc
From: Nileblitz <nileblitz@xxxxxxxxx>
Date: Wed, 29 Dec 2004 06:44:47 -0800 (PST)
xsl variables
I have read many posts on this list related to similar
problems.
 
I have taken over support activities for an
application. One page of 
this application is XML-XSL based.
 
I was asked to provide certain default values for a
few dropdown lists 
generated by the xsl. I realized based on past
experience that this is 
not going to be an easy task because the system was
coded in WD-xsl. I 
cannot use variables and parameters.
 
I tried converting to XSLT using the converter
provided by MS, but it 
leaves much to be desired. Considering the huge size
of the XSL and the 
lack of impact analysis, I dont wish to proceed with
the conversion 
without proper approval. Meanwhile I am trying to find
a solution if I 
can. I am posting the relevant XML and XSL and I will
try to explain the 
problem in detail.
 
XML
---------------------------------------------------------------------------------------
<ReportDefinition ID=1>
  <SearchForm>
   <Edit Caption="Global/Market"
FieldName="GlobalorMarket" 
Type="Combo" Source="GlobalorMarket"
ListId="GlobalorMarket" DefValue="Global"/>
  </SearchForm>
</ReportDefinition>
<ReportDefinition ID=2>
   <Edit Caption="Global/Market"
FieldName="GlobalorMarket" 
Type="Combo" Source="GlobalorMarket"
ListId="GlobalorMarket" DefValue="Market"/>
  </SearchForm>
</ReportDefinition>
.
.
 
   <GlobalorMarket>
      <Type IDVALUE="Global">Global</Type>
      <Type IDVALUE="Market">Market</Type>
   </GlobalorMarket>

----------------------------------------------------------------------
XSL
----------------------------------------------------------------------
.
.
.
<Select>
<xsl:if test="../@ListId[. = 'GlobalorMarket']">
 <xsl:for-each select="//GlobalorMarket/Type">
  <option>
   <xsl:attribute name="VALUE"><xsl:value-of 
select="../@IDVALUE"/></xsl:attribute>
   <xsl:if test="@IDVALUE[.='Global']"><xsl:attribute 
name="SELECTED"/></xsl:if>
   <xsl:value-of select="." />
  </option>
 </xsl:for-each>
</xsl:if>
</Select>
.
.
.
------------------------------------------------------------------------
 
Problem: As you can see from the XSL, currently the
default value for 
all the "GlobalorMarket" select boxes is set to
"Global". But for 
different report definitions the default value should
be different (DefValue 
attribute in XML section). The problem is, how to
access this DefValue 
attribute inside the for-each loop because the context
is different and 
we cannot use variables.
 
Let me know if you have any thoughts on this.



		
__________________________________ 
Do you Yahoo!? 
Dress up your holiday email, Hollywood style. Learn more. 
http://celebrity.mail.yahoo.com

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.