Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-incubator-dev] Adding Embedded Content/Regions to XML Editor


A good example, I think, of where partitions are handy is the HTML Script tag ... maybe you could see if XSL fits this model. In the following examples, from the spec, the main partitioner doesn't need to know much about the difference between vbscript, javascript, and tlk, ... just know how to create partitions of the type SCRIPT_VB, SCRIPT_JS, or SCRIPT_TLK, (based solely on the <script tag, then others can create "smart processors" for those different languages contained within the script tag. and, I believe, attributes such as "onmouseover", etc., can also have different languages, so that's where the similarity to XSL is. But ... can you really have different "languages" in the select attributes? Or, is it something you, and the XSL_Select processor would know about (i.e. always XPATH)?

<example>

<SCRIPT type="text/javascript">
... (SCRIPT_JS Partition)
</SCRIPT>

<SCRIPT type="text/vbscript">
... (SCRIPT_VB Partition)
</SCRIPT>

<SCRIPT type="text/tcl">
... (SCRIPT_TCL Partition)
</SCRIPT>

</example>

Hope it helps ...

David, This is very close to what I need. I've reviewed the code and I'm mostly doing this but I'm getting a little lost on how and when it knows to use the CSS Structured Editor and Parsers and when it uses the appropriate language parser in the scripts. The closest thing I can find is that it's basing it somehow off the mime type, but I haven't found anything that tells me how those "smart processors" for the JavaScript and CSS information is called and activated within that content type. It appears that I might have to setup a dummy XPath content type, which I can do as I have a feeling that XPointer and XQuery are going to need their own as well (if the XQuery editor gets off the ground). XPointer is used by XInclude, so I may eventually have to do something for it as well.

Is there a document that shows how the HTML editor is constructed, and particularly how the Structured Text editor knows to import other parsing for the various partioners.

Dave




Back to the top