HTMLDocument::InvalidNesting(3) The specified range causes invalid nesting


HTMLDocument::InvalidNesting( String )


The String contains details of the error


This Exception is thrown by HTMLDocument.addInlineElementAt(3kaya) if the start or end positions would cause invalid nesting.

 p = addParagraph(parent,"This paragraph");
 em = addInlineElementAt(p,Emphasis,3,7);
 code = addInlineElementAt(p,ComputerCode,6,9);
 // this attempts to make <p>Thi<em>s p<code>a</em>ra</code>graph</p>
 // which is invalid, and so an Exception is thrown.

This Exception is also thrown by several other functions if you try to add an element inside another element which cannot contain it.

 p = addParagraph(parent,"");
 list = addList(p,Unordered,0);
 // lists cannot be contained inside paragraphs, so an exception is thrown


Kaya standard library by Edwin Brady, Chris Morris and others ([email protected]). For further information see


The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation.