Finding Range starting and ending points in nested nodes
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stefan_Pietschmann
Posted On:   Thursday, July 3, 2003 03:49 AM

this may sound simple for some of you for sure... i'm no java guru - sad but true ;) I'm building a Transformer for Cocoon at the moment. I'm working on an xHTML document with DOM and my problem is as follows: things I have : a certain Node, a startPoint (int) and an endpoint (int) of a Range. Imagine a fragment of the document looks as follows: This is an interesting problem issue isn't it? I have the topmost span as a Node and I want to set   More>>

this may sound simple for some of you for sure... i'm no java guru - sad but true ;)


I'm building a Transformer for Cocoon at the moment. I'm working on an xHTML document with DOM and my problem is as follows:

things I have : a certain Node, a startPoint (int) and an endpoint (int) of a Range.


Imagine a fragment of the document looks as follows:





This is an



interesting



  • problem


  • issue






isn't it?




I have the topmost span as a Node and I want to set a Range from a certain startpoint to an endpoint. the points however are counted from the beginning of the span contents, so for example start=8 to end=21 would give me a range "an interesting", since the tags aren't counted.


i don't get anything working to give me that range! this needs to be somehow recursive, since I don't know how far the childs of the topmost span are nested. furthermore some variable should count the total length of the text nodes, whilst another one counts the length of the current text node - and only textnode.



well, i'm here if you don't get it, just ask,... it's pretty hard to explain, but it would be great if some of you knew how to do this.

   <<Less

Re: Finding Range starting and ending points in nested nodes

Posted By:   Stefan_Pietschmann  
Posted On:   Thursday, July 10, 2003 03:49 AM

mx fixed it myself.
About | Sitemap | Contact