xsl-list
[Top] [All Lists]

RE: [xsl] Counting nodes up to a certain sibling

2007-03-08 14:51:28
A sample of your input would make helping you a good deal easier. Is this what 
you're faced with?

<div>
  First column<span> <span>Second column<span>  </span>
</div>

If not, please give a sample, not a description.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     mclagett(_at_)comcast(_dot_)net
Sent:     Thu, 08 Mar 2007 20:45:27 +0000
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] Counting nodes up to a certain sibling

Hi -

I am transforming an input html doc into an xml formatted output stream.  The 
portion of the document I am now working with has been laid out in html as a 
set of columns, but instead of using tables they did it by inserting spaces 
enclosed within span tags (aaarrrggghhh!).  I am attempting to implement this 
simple rule:

for each span tag that includes a space, take all sibling nodes up to the next 
span tag and output thes within a single output tag. 

The document is structured such that these will only be text nodes or 
formatting nodes like <i> or <b> or <sub>.  I'm having a hell of a time, 
however, figuring out how to create a node set that includes only nodes in 
between a current span node and its next sibling span node.  I've been trying 
to work with the position() function, but in order to identify the next span 
node, I have to do it with an axis expression and a filter and then position() 
only tells me the position of the node with respect to the filtered set.  I 
need to identify the position of a node matching my characteristics in an 
unfiltered parent node set.  Can't seem to figure out how to do it.  Is there a 
way?

Thanks for any help anyone can offer.  If this has been answered before, I 
apologize.  I've spent an awful lot of time looking for it.

Regards,

Mike  

--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>