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

Re: Elements print sometimes only

Subject: Re: Elements print sometimes only
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Sat, 21 Jul 2001 09:21:56 GMT
Re:  Elements print sometimes only
Tamre,

>I have the following xsl file that prints a header, middle section and a
>footer--on each page.  On the first page in the header area three elements
>print out in a line, namely "acctnum", "taxid" and "statement/stmtPeriod",
>as shown here:
>
In the text you say "statement/stmtPeriod" but in the template you add
'/' on the front.  This may be an important difference.

It looks like a problem with the current element, though its hard to
be sure as you do not give us a sample of the input.
Within the template "pagehead" you are referring to
/statement/stmtPeriod which is an absolute path, so will work in
whatever context pagehead is called.  But the things like "acctnum"
are relative paths.  These will only produce something if when you
call pagehead the current element has a child called "acctnum".

You probably need to pass statement/accountInfo as a parameter into
the pagehead template, or instead of saying 'acctnum' say
'/statement/accountInfo/acctnum'.

If the output from the pagehead template is the same for the whole
run, then it may be better to put the contents in a global variable
and copy that rather than doing a call-template.  Look up xsl:variable
and xsl:copy-of.

><xsl:template name="pagehead">
><DIV style="position: relative; top:4px;">
><xsl:value-of select="acctnum"/>
>
><span class="shiftright">
><xsl:value-of select="taxid"/>
></span>
>
><span class="shiftrightb">
><xsl:value-of select="/statement/stmtPeriod"/>
></span>
></DIV>
>
>but when this is called the second time through, only the
>"statement/stmtPeriod" prints out.  I have not been able to figure this out.
>Any ideas?  I have posted the entire file below, in case it will be helpful.

The most helpful thing you (and others) can do is first reduce the
stylesheet and input to give something that is easy to test.  Make
sure what you post still does what you claim - test it yourself first.

Often this process of elimination will reveal the answer without
having to post at all.

>Thanks.   Tamre
>

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 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.