[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Question on preceding Text()
Subject: Re: [xsl] Question on preceding Text() From: David Carlisle <davidc@xxxxxxxxx> 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. That sounds like you want preceding-sibling rather than preceding. 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? David ________________________________________________________________________ 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 -> |
---|---|---|
[xsl] Question on preceding Text(), Besi Fube | Thread | Re: [xsl] Question on preceding Tex, Besi Fube |
RE: [xsl] Selecting only those node, cknell | Date | Re: [xsl] Selecting only those node, Peter Hickman |
Month |