Validate against an inline schema
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Mon Oct 22, 2012 5:14 pm
Validate against an inline schema
Post by JoeMooreBrk »
Maybe I'm missing something very obvious, but I'm using the simple inline example found at: http://msdn.microsoft.com/en-us/library/aa302288.aspx . I'm wondering how to tell oXygen to validate the <f:a.../> node. If I press the validation button, it says there is no associated schema, but if I don't do anything it obviously is not validating the node (I can change it to <f:b.../> with no error.
What am I missing?
What am I missing?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Validate against an inline schema
Hello,
The default validation from Oxygen first tries to determine the associated schema. If it can't find one, it reports the error:
1. Go to main menu > Document -> Validate -> Configure Validation Scenario(s) (there's a corresponding action in the toolbar).
2. In the Configure Validation Scenario(s) dialog press New, choose a name for the scenario and change the Validation engine to MSXML.NET. Leave the other fields from the validation unit to their default values.
3. Press OK in the "Edit scenario" dialog and "Apply associated".
Now each time you press the validation button, Oxygen uses the associated validation scenario. Note that because "MSXML.NET" is an external engine, it will validate the saved file from the file system. This means that "Automatic validation" (validate as you type) is not available and also when you manually validate with this scenario, Oxygen will prompt you to save all opened files (if any) prior to validating.
If you need to associate this validation scenario with multiple files, you can do so from the project view. Select the XML files(or their parent folder) in the project view and right clicking and selecting Validate -> Configure Validation Scenario. Then enable the scenario from the list and press OK. If you've chosen a folder this will associate the scenario with all the files from that folder (even if they are of other type than XML). So you should make sure you don't accidentally associate validation scenarios to files that the scenario won't apply to.
Regards,
Adrian
The default validation from Oxygen first tries to determine the associated schema. If it can't find one, it reports the error:
In addition, by default Oxygen validates XML files with Xerces, which does not support inline schemas. The solution is to use a different validator that supports inline schemas, namely MSXML.NET. To accomplish this you have to create a custom validation scenario: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.
1. Go to main menu > Document -> Validate -> Configure Validation Scenario(s) (there's a corresponding action in the toolbar).
2. In the Configure Validation Scenario(s) dialog press New, choose a name for the scenario and change the Validation engine to MSXML.NET. Leave the other fields from the validation unit to their default values.
3. Press OK in the "Edit scenario" dialog and "Apply associated".
Now each time you press the validation button, Oxygen uses the associated validation scenario. Note that because "MSXML.NET" is an external engine, it will validate the saved file from the file system. This means that "Automatic validation" (validate as you type) is not available and also when you manually validate with this scenario, Oxygen will prompt you to save all opened files (if any) prior to validating.
If you need to associate this validation scenario with multiple files, you can do so from the project view. Select the XML files(or their parent folder) in the project view and right clicking and selecting Validate -> Configure Validation Scenario. Then enable the scenario from the list and press OK. If you've chosen a folder this will associate the scenario with all the files from that folder (even if they are of other type than XML). So you should make sure you don't accidentally associate validation scenarios to files that the scenario won't apply to.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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