Subject: Re: [xsl] Question on preceding Text() From: "Besi Fube" <pearle20@xxxxxxxxxxx> Date: Tue, 12 Apr 2005 11:41:55 -0400 |
Thanks again, Besi
***************************** <Book>
<TitleNum> Chapter 1. <TitleNum>
<Center> Chapter on Testing: <AddText>Testing FAQ</AddText> <StrikeText>Questions</StrikeText> </Center>
<Center> Chapter on Logic: <AddText>Logic FAQ</AddText> <StrikeText>Logic</StrikeText> </Center>
----Original Message Follows---- From: David Carlisle <davidc@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Question on preceding Text() Date: Tue, 12 Apr 2005 16:18:03 +0100
> If the length of the preceding sibling is greater than Zero, then a > center tag has already been opened so nothing needs to be > done. Otherwise open a center tag.
XSLT has almost no support for generating tags, the only method to do so is the deprecated (and explictly non-portable) disable-output-escaping mechanism that you are using. If you are generating tags (that is, generating the textual markup of an XML document directly) you are far better to use a system such as perl that can treat such text as a first class object.
With XSLT the model is that you should not write a start tag and a end tag as two distinct operations but rather you just create a center element node as one primitive operation. When (if) the result tree is serialised to a file this element will produce two tags but taht is only indirectly under the control of the XSLt stylesheet.
I attempted using string-length(parent::*/preceding::*[1])>0 but this does not ensure that I am pulling a node that is a child of the same parent node.
Actually I notice that you are using <xsl:output method="text"/> which means that disable-output-escaping='yes' is doing nothing as no escaping is done in text output anyway. But the above comments still apply, you should use xml (or html) output method and generate element nodes not text.
I can't understand your exact requirement well enough to suggest any code. What output do you want to generate from your supplied input?
________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Question on preceding Tex, David Carlisle | Thread | RE: [xsl] Question on preceding Tex, Michael Kay |
Re: [xsl] printing text output excl, Mukul Gandhi | Date | RE: [xsl] Question on preceding Tex, Michael Kay |
Month |