xsl-list
[Top] [All Lists]

Re: Question on preceding Text()

2005-04-12 08:18:03


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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>