WTP Structured Model
For another WTP important data model Istructureddocument has been introduced before, today we look at another core data model Istructuredmodel. Before continuing with the following, make sure that the current workspace has been imported (either in source or binary mode) the following works:
Org.eclipse.jst.jsp.core
Org.eclipse.jst.jsp.ui
Org.eclipse.wst.css.core
Org.eclipse.wst.css.ui
Org.eclipse.wst.html.core
Org.eclipse.wst.html.ui
Org.eclipse.wst.javascript.core
Org.eclipse.wst.javascript.ui
Org.eclipse.wst.sse.core
Org.eclipse.wst.sse.ui
Org.eclipse.wst.xml.core
Org.eclipse.wst.xml.ui
In the previous introduction of Istructureddocument, we know that the concrete implementation of Istructureddocument is actually jface Text Framework IDocument interface Implementation, Its core role also focuses on the regional division of specific texts according to specific grammatical rules, providing corresponding location information, which establishes the core data model for WTP page Resource Editor. However, it is not enough to have a istrucutureddocument of syntax alone, and we need another set of semantic-oriented data models, which is Istructuredmodel and the WTP XMLDOM implementation behind it (note: For CSS models, is completely by the WTP own realization, and this series of articles is not very related, this article does not do detailed introduction.
Note: Istructuredmodel is built on a istrucutureddocument basis, istructureddocument does not know Istructuredmodel, But Istructuredmodel knows that the model corresponds to the istrucutureddocument!!! Now a rough guess of the reason, if it is directly to the content of specific page resources directly converted to Istructuredmodel certainly not easy, because the content of our page resources are often not so rules, that transformation process will certainly not avoid their own to do a lot of analysis, leading to the construction Istructuredmodel construction process is very complex, if you use the existing istrucutureddocument build mechanism, first of all, the specific content parsing into istrucutureddocument complete the grammar division, Building Istrucuturedmodel based on highly structured istrucutureddocument will certainly greatly simplify the build process and, to some extent, interpret the build process as The list of nodes in the istrucutureddocument is converted to the node list of the document held by Istrucuturedmodel. The Istructuredmodel build process is generally indicative of the following:
"Istructuredmodel: Handle"