RNG validation in oXygen 11
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 80
- Joined: Fri Apr 23, 2004 5:24 pm
- Location: Durham, NC, USA
RNG validation in oXygen 11
Hi George et al,
I just noticed a validation behavior in version 11 that strikes me as different from in the past. I'm wondering if I'm hallucinating.
I have a RNG schema like this:
<grammar
xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="root">
<element name="child">
<value>xyz</value>
</element>
</element>
</start>
</grammar>
I create a partial instance like this:
<root>
</root>
I would expect to get a red light, since I am missing required content. But instead I get a green light. What is going on?
John
I just noticed a validation behavior in version 11 that strikes me as different from in the past. I'm wondering if I'm hallucinating.
I have a RNG schema like this:
<grammar
xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="root">
<element name="child">
<value>xyz</value>
</element>
</element>
</start>
</grammar>
I create a partial instance like this:
<root>
</root>
I would expect to get a red light, since I am missing required content. But instead I get a green light. What is going on?
John
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: RNG validation in oXygen 11
Hi John,
Trying this but as expected oXygen gives me
Please note that Jing has a property exposed in the oXygen options that makes the validation check if the document is "feasibly valid", that means it can reach a valid state by adding content or markup. When this option is set Jing makes all the patterns optional and then performs the validation. If I enable that then of course I get no validation errors because the document will become valid by adding a child element. So, make sure you have the "Check feasibly valid" option disabled from Options->Preferences -- XML -- XML Parser page in the Relax NG group. You will need to use "Reset cache and validate" first time or reopen the XML file in order to have the new option applied when you perform the validation.
I included my test files below, I added a schema association on the XML file:
test.xml
test.rng
Best Regards,
George
Trying this but as expected oXygen gives me
Code: Select all
SystemID: /Users/george/test/test.xml
Engine name: Jing
Severity: error
Description: element "root" incomplete; missing required element "child"
Start location: 5:8
I included my test files below, I added a schema association on the XML file:
test.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="test.rng" type="xml"?>
<root>
</root>
Code: Select all
<grammar
xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="root">
<element name="child">
<value>xyz</value>
</element>
</element>
</start>
</grammar>
George
George Cristian Bina
-
- Posts: 80
- Joined: Fri Apr 23, 2004 5:24 pm
- Location: Durham, NC, USA
Re: RNG validation in oXygen 11
Thanks, George. That was it. When I installed the upgrade, I must have selected "check feasibly valid" in Preferences. (I never until now knew what that meant, so I learned something here.)
Also, the change in Jing did not take effect until I did a "Reset cache and validate" action, so I guess I overlooked it when I previously tried fiddling blindly with Preferences.
John
Also, the change in Jing did not take effect until I did a "Reset cache and validate" action, so I guess I overlooked it when I previously tried fiddling blindly with Preferences.
John
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