Plugin Help
Are you missing a feature? Request its implementation here.
-
- Posts: 2
- Joined: Sat May 30, 2009 12:30 am
Plugin Help
Hello
I am developing a plugin for oxygen xml editor. I'm following the steps given at this link.
http://www.oxygenxml.com/doc/ug-oxygen/ ... orial.html
I tried many ways around but It's not working in any way.
It's always giving me error when I validate an xml document. I tried to implement the class simple.documentation.framework.CustomRule with main method, without main method, etc
But when I connect class with data type association and then try to validate it It always shows "There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario."
Please help me!!!!
Thank you in advance
I am developing a plugin for oxygen xml editor. I'm following the steps given at this link.
http://www.oxygenxml.com/doc/ug-oxygen/ ... orial.html
I tried many ways around but It's not working in any way.
It's always giving me error when I validate an xml document. I tried to implement the class simple.documentation.framework.CustomRule with main method, without main method, etc
But when I connect class with data type association and then try to validate it It always shows "There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario."
Please help me!!!!
Thank you in advance
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Plugin Help
Post by sorin_ristache »
Hello,
That section of the User Manual specifies how to create a document type for XML documents that are edited in Author mode.
Please specify more details about the problem: how you want to match the XML documents that are in the document type that you define from Preferences -> Document Type Association (by root local name, by namespace, by file name, by other rule, etc). Give an example of your XML document and specify the values that you set in your document type from Preferences -> Document Type Association.
Regards,
Sorin
That section of the User Manual specifies how to create a document type for XML documents that are edited in Author mode.
Please specify more details about the problem: how you want to match the XML documents that are in the document type that you define from Preferences -> Document Type Association (by root local name, by namespace, by file name, by other rule, etc). Give an example of your XML document and specify the values that you set in your document type from Preferences -> Document Type Association.
Regards,
Sorin
-
- Posts: 2
- Joined: Sat May 30, 2009 12:30 am
Re: Plugin Help
Hi,
Alright here are the details of the classes.
I actually have 2 classes.
1) CustomRule.java
2) SaxParser.java
CustomRule.java is implementing the interface ro.sync.ecss.extensions.api.DocumentTypeCustomRuleMatcher and It's both methods,
public boolean matches(
String systemID,
String rootNamespace,
String rootLocalName,
String doctypePublicID,
Attributes rootAttributes)
public String getDescription()
Now, in the matches method I am creating a handler of SaxHandler class and calling it's parse method to parse a file which can be a .VCtrl or .xml file.
In parsing, I'm getting the value of some particular attributes by parsing the file, file's name will be in my systemID variable of matches() method.I will use the systemID variable to call parse method.
I want to check attribute's value, compare it with my value and return true or false accordingly.
So, return value(true or false) of matches() method will be depended on the value of attribute which we get by parsing that file.
The problem is I'm getting the value correctly from parsing the file but It's not returning false when the value is not equal to which I want. I am printing the value and checking the boolean variable on console. It is always showing true though the result of comparing two values is false.
Author always looks for xml schema. It validates file correctly only when the value of attribute in xml file equals to the value of attribute in schema.
But I don't want that.
I want to validate document If and only If it's attribute value is equal to my given value in java files not to be equal to the schema file.
I think now you get the idea that what problems I have.
Alright here are the details of the classes.
I actually have 2 classes.
1) CustomRule.java
2) SaxParser.java
CustomRule.java is implementing the interface ro.sync.ecss.extensions.api.DocumentTypeCustomRuleMatcher and It's both methods,
public boolean matches(
String systemID,
String rootNamespace,
String rootLocalName,
String doctypePublicID,
Attributes rootAttributes)
public String getDescription()
Now, in the matches method I am creating a handler of SaxHandler class and calling it's parse method to parse a file which can be a .VCtrl or .xml file.
In parsing, I'm getting the value of some particular attributes by parsing the file, file's name will be in my systemID variable of matches() method.I will use the systemID variable to call parse method.
I want to check attribute's value, compare it with my value and return true or false accordingly.
So, return value(true or false) of matches() method will be depended on the value of attribute which we get by parsing that file.
The problem is I'm getting the value correctly from parsing the file but It's not returning false when the value is not equal to which I want. I am printing the value and checking the boolean variable on console. It is always showing true though the result of comparing two values is false.
Author always looks for xml schema. It validates file correctly only when the value of attribute in xml file equals to the value of attribute in schema.
But I don't want that.
I want to validate document If and only If it's attribute value is equal to my given value in java files not to be equal to the schema file.
I think now you get the idea that what problems I have.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Plugin Help
Post by sorin_ristache »
Hello,
I think first we should solve this problem of matching the document type correctly before going to the validation of the XML document matched by the document type. The validation is done always against the schema specified on the Schema tab of the dialog for editing the matched document type.
Regards,
Sorin
It seems a simple problem of comparing two strings and returning the boolean value of that from the method matches(). Do you mean that the matches() method of your CustomRule class returns true regardless of the resut of comparing two strings? Did you print to console both the value of comparing the strings and the boolean value returned by matches()? Can you give a more detailed example, that is: the fragment of the XML file containing the attribute value that you extract with the SAX parser, the Java code that compares the two strings including the System.out code that prints to console the boolean value returned by matches(), a list with the lines of text printed to console?kshah wrote:The problem is I'm getting the value correctly from parsing the file but It's not returning false when the value is not equal to which I want. I am printing the value and checking the boolean variable on console. It is always showing true though the result of comparing two values is false.
I think first we should solve this problem of matching the document type correctly before going to the validation of the XML document matched by the document type. The validation is done always against the schema specified on the Schema tab of the dialog for editing the matched document type.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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