|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Elements print sometimes only
Trevor, Thanks for the advice. That did work. I was confused because it does print the first time through, but then when it recalls the template it is in another spot so to speak and I therefore need to be more clear on the path. Thanks for the other info as well. I will check out the global variable possibilities and also minimize code before I post it. Thank you again. Tamre ----- Original Message ----- From: "Trevor Nash" <tcn@xxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Saturday, July 21, 2001 2:21 AM Subject: 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 > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








