Community
Participate
Working Groups
When I generate the the Spring Roo vote example and refresh the project several of the exceptions below are logged: org.w3c.dom.DOMException at org.eclipse.wst.xml.core.internal.document.ElementImpl.insertBefore(ElementImpl.java:715) at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertNode(XMLModelParser.java:1351) at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertNode(XMLModelParser.java:1325) at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertCDATASection(XMLModelParser.java:913) at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertStructuredDocumentRegion(XMLModelParser.java:1520) at org.eclipse.wst.xml.core.internal.document.XMLModelParser.replaceStructuredDocumentRegions(XMLModelParser.java:2345) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.internalSetNewDocument(DOMModelImpl.java:595) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.setStructuredDocument(DOMModelImpl.java:870) at org.eclipse.wst.sse.core.internal.model.AbstractModelLoader.createModel(AbstractModelLoader.java:127) at org.eclipse.wst.sse.core.internal.FileBufferModelManager.getModel(FileBufferModelManager.java:719) at org.eclipse.wst.sse.core.internal.FileBufferModelManager.getModel(FileBufferModelManager.java:679) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl._doCommonGetModel(ModelManagerImpl.java:541) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl._commonGetModel(ModelManagerImpl.java:508) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl._commonGetModel(ModelManagerImpl.java:481) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getModelForRead(ModelManagerImpl.java:1410) at org.eclipse.wst.sse.core.internal.validate.ValidatorGroupListener.validationStarting(ValidatorGroupListener.java:72) at org.eclipse.wst.validation.internal.ValManager$2.run(ValManager.java:854) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.wst.validation.internal.ValManager.notifyGroupListenersStarting(ValManager.java:852) at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:807) at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:669) at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:321) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79) at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48) at org.eclipse.wst.validation.internal.ValBuilderJob.deltaBuild(ValBuilderJob.java:211) at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:179) at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:126) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Created attachment 172010 [details] sample file: /vote/src/main/webapp/WEB-INF/layouts/default.jspx
Created attachment 172588 [details] Patch We should not scan CDATA when we are in ST_BLOCK_TAG_SCAN state in JSPTokenizer.I have used JFlex to create JSPTokernizer.java ,but had to do some changes manually.
Hi, Rakesh. I don't think we really need to tweak the JSPTokenizer for the solution (though it does work, but you'll notice that the CDATA tag is no longer syntax highlighted). I think the solution will actually be within the ElementImpl#insertBefore method if we could tweak the if() statement to not only exclude TEXT_NODE nodes, but also CDATA_SECTION_NODE nodes. Also, I think we could use some unit tests for this. Thanks!
Created attachment 173193 [details] Patch I have added a check and a test file in jsp.core . This exception will occur only in jsp files whenever CDATA is first child of script or style.For example it occurs in <script><![CDATA[]]></script> but not in <script> <![CDATA[]]></script> Please let me know if i need to make changes in test.I added test in jsp.core since it looks like a change related to jsp , although change is actually made in xml.core.
Patch looks good, Rakesh. Only thing I would change is to make the unit test part of HTML core's suite. There are a set under o.e.wst.html.core.tests.parser. Just extend the ModelTest base class, and you can call createHTMLModel() to get your HTML model for edit. Add your nodes, and do a catch(DOMException) { fail("Did not permit CDATA section in script element."); } Then make sure to add it to the ModelParserTests test suite. Thanks.
Created attachment 173272 [details] patch TestCase changed
Released. Thanks, Rakesh.