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


> > XSL has some special attributes that can contain
> > XPath expressions.

> I might be missing the bigger picture, but isn't it so that almost all
> attributes in XSL can contain XPath expressions, from the "{xpath-expr}"
> notation?
> So why bother with the partition type at all?

Maybe I'm missing the finer detailed picture :) but in general, partition types are merely a handy way to configure things in the Eclipse Document/Editor framework ... so that, at least to some degree, what ever produces the partition type, doesn't have to know anything about who uses that partition (and vice versa).

So, I think there's some sense in having an XSL_Partition, though I might call it an XSL_Select_Partition. That would just allow some code divisions of all the complications of select attributes. But, I'm not sure there would be much advantage on a finer level of detail in partition types (but, I don't know XSL all that well).  

Don't forget, the processors ... content assist, highlighting, etc., can still do _some_ smart (complicated) things where they (possibly) re-parse the attribute value, and do different things based on exactly what's there and where the cursor is, etc. And, then, that could be your own mini-parser that's specialized for that case, instead of having to fit in and handle xml parsing in general.

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 ...



Back to the top