Elements view: surrounding with tag / inserting the tag on doubleclick

Are you missing a feature? Request its implementation here.
dma_k
Posts: 32
Joined: Fri Aug 05, 2011 8:27 pm

Elements view: surrounding with tag / inserting the tag on doubleclick

Post by dma_k »

Dear oXygen community,

I personally find that oXygen Elements view (Window → Show view → Other... → oXygen XML → Elements) is not useful: it shows the elements allowed at current caret position (super), but how to apply the element?!?

Suggestion:
- When the text is selected and selection allows the tag insertion (selection encloses the valid XML fragment), doubleclicking of the tag same in Elements view should perform "surround with tag" action.
- When there is no selection, the start tag is inserted.

That is at least some use from this list.

Additional info:
oXygen XML Editor and XSLT Debugger v12.1.0.v2011031114
Eclipse Helios SR2 v3.6.2.r362_v20110210
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by adrian »

Hello,

Both these features are already implemented in the Elements view in v12.2("surround with element" and "insert element"), but I believe they have been implemented a long time ago so they should work in v12.1 as well.

In what context are you using the Elements view, what type of file are you editing(XML, XSD)? Can you give an example of a context/file where this doesn't work?

Note that elements that are gray(instead of black) are not available in the current context even if they are available in the current element.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
dma_k
Posts: 32
Joined: Fri Aug 05, 2011 8:27 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by dma_k »

adrian wrote:Note that elements that are gray(instead of black) are not available in the current context even if they are available in the current element.
Ah, grayed! I have this very case.... What does it mean "not available in the current context"?

In my case the <author> inside <bibl> is perfectly OK, but all nodes are grayed:
Image

Here is the referred example.html
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by adrian »

"not available in the current context" means that the schema doesn't allow the element in that context(in that parent element).
e.g.
If you have a sequence of optional elements defined in a schema: a, b, c
after omitting a and adding b you can only add c not another b(already present) or a(can only be inserted before b).

Your example is an XHTML document with embedded TEI, however the associated schema only covers TEI and Oxygen does not validate the XHTML side of it. As a result the embedded TEI snippets don't have the proper context so both the content completion(when editing) and Elements view don't work as expected.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
dma_k
Posts: 32
Joined: Fri Aug 05, 2011 8:27 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by dma_k »

adrian wrote:Your example is an XHTML document with embedded TEI, however the associated schema only covers TEI and Oxygen does not validate the XHTML side of it. As a result the embedded TEI snippets don't have the proper context so both the content completion(when editing) and Elements view don't work as expected.
I think, this is a string limitation: it limits the oXygen functionality to only perfectly valid XML. Even if I enable the XHTML XSD, my XML won't be valid, because HTML tags do not allow anything non-HTML so I need to hack XHTML XSD... Currently the functionality of Elements view and Surround with Tags is useless for me. To my opinion it's better to enable (probably incorrect) tags which are possible in current context, rather then disable them all. I think that choosing the right context in this case is perfectly possible.

Suggestion: oXygen should recover the context despite of schema errors.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by george »

You need an NVDL script that describes how the HTML and the TEI languages are combined, referring each to its schema. oXygen supports NVDL and it will offer you the elements from both schemas.

Best Regards,
George
George Cristian Bina
dma_k
Posts: 32
Joined: Fri Aug 05, 2011 8:27 pm

Re: Elements view: surrounding with tag / inserting the tag on doubleclick

Post by dma_k »

george wrote:You need an NVDL script that describes how the HTML and the TEI languages are combined
Thank you. Thank worked absolutely fine for me.
Post Reply