Validate document
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Validate document
Post by SmitaPatil »
Hi Team,
Can you please tell me if there is any method using which we can validate the content at selected caret position in document.
Thanks & Regards,
Smita
Can you please tell me if there is any method using which we can validate the content at selected caret position in document.
Thanks & Regards,
Smita
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Validate document
Post by cristi_talau »
Hello,
In Web Author there is the notion of a "valid document". I am not sure if you want to validate smaller pieces of content inside the document (you mentioned the caret position), and how would you determine the validity of such a fragment - XML Schemas validate entire documents only.
If you want to validate the entire document, you can draw some inspiration from this plugin which blocks saving a document when it is invalid: https://github.com/oxygenxml/web-author ... if-invalid .
Best,
Cristian
In Web Author there is the notion of a "valid document". I am not sure if you want to validate smaller pieces of content inside the document (you mentioned the caret position), and how would you determine the validity of such a fragment - XML Schemas validate entire documents only.
If you want to validate the entire document, you can draw some inspiration from this plugin which blocks saving a document when it is invalid: https://github.com/oxygenxml/web-author ... if-invalid .
Best,
Cristian
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: Validate document
Post by SmitaPatil »
Hi Cristian,
Suppose user has removed the tag in that case, after this change if document is not valid I can see red lines in the document.
can you tell which api we can use to check whether current document is valid or not based on schema.
Thanks & Regards,
Smitz
Suppose user has removed the tag in that case, after this change if document is not valid I can see red lines in the document.
can you tell which api we can use to check whether current document is valid or not based on schema.
Thanks & Regards,
Smitz
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Validate document
Post by cristi_talau »
Hello,
The Java API is the following: WebappDocumentValidator.getValidationTask() (details here: https://www.oxygenxml.com/InstData/Edit ... tionTask--). You can see here how it is used: https://github.com/oxygenxml/web-author ... ess.js#L26
Best,
Cristian
The Java API is the following: WebappDocumentValidator.getValidationTask() (details here: https://www.oxygenxml.com/InstData/Edit ... tionTask--). You can see here how it is used: https://github.com/oxygenxml/web-author ... ess.js#L26
Best,
Cristian
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: Validate document
Post by SmitaPatil »
Hi Cristian,
I wonder how we can access authorDocumentModel at javascript side or client side.
Can you please tell me how we can access authorDocumentModel at js side. I want to call this method using js.
Thanks & Regards,
Smita
I wonder how we can access authorDocumentModel at javascript side or client side.
Can you please tell me how we can access authorDocumentModel at js side. I want to call this method using js.
Thanks & Regards,
Smita
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Validate document
Post by cristi_talau »
Hello,
The sample plugin I mentioned in the previous posts uses JS code that is run on the server using the Rhino JS engine. This code cannot run on the browser as it uses objects that are implemented in Java.
To call this API from JS code in browser, you can invoke AuthorOperations implemented in Java as described here: https://www.oxygenxml.com/maven/com/oxy ... esult.html .
Best,
Cristian
The sample plugin I mentioned in the previous posts uses JS code that is run on the server using the Rhino JS engine. This code cannot run on the browser as it uses objects that are implemented in Java.
To call this API from JS code in browser, you can invoke AuthorOperations implemented in Java as described here: https://www.oxygenxml.com/maven/com/oxy ... esult.html .
Best,
Cristian
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service