This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Global Variables (use of)


If I call an <xsl:variable> just after <xsl:stylesheet> as such:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:saxon="http://icl.com/saxon"
				extension-element-prefixes="saxon"
                			version='1.0'
				saxon:trace="yes">

<xsl:variable name="sectnum"><xsl:value-of
select="child::title/attribute::id"/></xsl:variable>

$num should be processed as a global variable (my understanding through the
reading I have done).

The only thing that should be passed as values are the id attribute values
for title within chapters, sections, figures, and the book itself (the only
elements that have title as a child).  Running this produces nothing
(running SAXON with XP).  If I place this in the template for one of the
elements that contains a title, it evaluates correctly.  If I need to build
a TOC where all the titles are reproduced as anchors with the id value as
the href, do I need to declare a unique variable in each template to make
this evaluate correctly, or is there a way I can use a global value that
will return the correct id value based on the current node being matched?  

This is the toughest part of my project I have hit so far (other than
getting all these lousy java apps to work correctly).  Any help will be
appreciated, and a solution will be showered with numerous accolades......

Thanks in advance....

Jason A. Buss
Single Engine Technical Publications
Cessna Aircraft Company
jabuss@cessna.textron.com

In 1992 the Web was a garden of personal home pages blooming with thoughts,
opinions, and life experiences. People were learning how to build their own
sites, experimenting with design, and sharing their voice with the world
while the business world scrambled for ways to "monetize" the internet and
capitalize on its fertility.
Then they paved it all and built a mall.               -Biz Stone       



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]