How to access to the DocumentController from text editor ?

Are you missing a feature? Request its implementation here.
Vince
Posts: 64
Joined: Wed Dec 03, 2014 11:25 am

How to access to the DocumentController from text editor ?

Post by Vince »

Hello,

I need to access the AuthorDocumentController from WSEditorTextPage.

It's for evaluate an XPath 2.0 expression on current editing document.

Thanks a lot

Vincent
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: How to access to the DocumentController from text editor ?

Post by mihaela »

Hello,

If you are referring to Oxygen XML Editor (not Oxygen Web Author), you can use the following API to evaluate an XPATH expression:
ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage.evaluateXPath(String)

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Vince
Posts: 64
Joined: Wed Dec 03, 2014 11:25 am

Re: How to access to the DocumentController from text editor ?

Post by Vince »

Hi,

Thanks. It works !

But is there any approach that doesn't depend on the selected editing page ?

i.e. I want to evaluate XPath against my current document, whatever I display author page, text page or grid page.

Regards,
Vincent
Vince
Posts: 64
Joined: Wed Dec 03, 2014 11:25 am

Re: How to access to the DocumentController from text editor ?

Post by Vince »

I notice that XPath evaluation dn't give me same results between

ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage.evaluateXPath(String)

and

ro.sync.ecss.extensions.api.AuthorDocumentController#evaluateXPath(String, boolean, boolean, boolean)


Why this ?

My xpath:

Code: Select all

//*[contains(@class, ' topic/image ')]/@href

Thanks
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to access to the DocumentController from text editor ?

Post by Radu »

Hi,
When an XML document is loaded in Oxygen desktop, it has 3 edit modes Text/Grid/Author. These three modes have totally different internal models so the APIs to access them is totally different. For the Grid mode we provide no API to access and change its internal model, for the Author mode we provide extensive API to access and change its internal model. For the Text mode (which you seem to be interested in) we provide some API to access its contents, run XPath but the Text mode does not have a nodes structure underneath, it's plain XML content placed in a text area so the API is not similar to when working with the Author mode.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply