Hello:
I am working on a richtext and it may have one, two or three paragraphs and then a table. I thought that using getnextelement paragraph was going to stop as soon as it reach the table but it is not the case. I do the getnextelement paragraph and I get into the columns of my table. How do I know what is still a paragraph and what is text inside the table? As I said at the beginning my richtext may several paragraphs before the table but I don’t know how may they are. Is this a bug in the code or is it actually the way it is suppose to work? If any body knows please let me know, I know that the new classes for richtext are new but I think it does not make sense to jump from one element type to another without flagging it somehow.
Thanks
Mynor
Subject: Because the content of a table cell is one or more paragraphs
I’m sorry, but I can’t explain it any more simply than to reiterate your question back at you as a statement. Table cells contain paragraphs. That’s all there is to it.
Subject: Yes, but why don’t call cell paragraph
My point is that when you do a search for paragraphs you end up inside a table which is a complete different element. If you do a search for first paragraph it takes you inside the first cell without telling you that you are now inside a table. I know that these new classes are just in the starting point of development but if they don’t pay attention to this type of issues it will be difficult to fix later on. I also think that it will be nice to have a navigator that allows you to navigate inside a rich text field element by element without having to specified what the element is just go from paragraph to paragraph to table or links or attachments and as you get to the elements you will be able to see what type they are. I know it sounds easy but I think that will give any one working with richtext the real tools to create good applications.
Mynor
Subject: RE: Yes, but why don’t call cell paragraph
I don’t suppose you had considered looking at DXL. You can get a lot more control, and can tell whether your current paragraph has a tablecell as a parent (DOM), or capture a tablecell element event before entering a paragraph element (SAX). The solutions are there already, you just have to use them.
Subject: RE: Yes, but why don’t call cell paragraph
Thanks, I will take a look at DXL and SAX. I know what DXL stands for but I have no idea about SAX.
Mynor
Subject: RE: Yes, but why don’t call cell paragraph
SAX is “Simple API for XML”, and it’s a standard method (like the DOM), so there are a boatload of resources out there to help you. In effect, it starts at the beginning of an XML document and reads from top to bottom. Every node of the document will raise an event as it is read, and you can use those events to control your code’s output.
Subject: Thanks I will read about it