Using Schema+Schematron on XML files with XMLNS error
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 43
- Joined: Thu Feb 16, 2023 11:00 pm
Using Schema+Schematron on XML files with XMLNS error
I'm having issues using schema validation along with Schematron validation when the XML file contains a XMLNS tag.
We are developing a framework to work with ATA2300, and in this specification, the namespace xmlns="http://www.ataebiz.org/XMLSchema" is used. A catalog file was created to apply the schema to the XML files. A Schematron was also created to validate some rules apart from the schema. However, when we have the XMLNS tag, Oxygen doesn't take the Schematron into account. When I remove the XMLNS tag, the Schematron works, but the schema stops working.
Am I doing something wrong, or is it really a tool issue?
Validation scenario:
We are having the same problem when using xsi:noNamespaceSchemaLocation instead of xsi:schemaLocation
We are developing a framework to work with ATA2300, and in this specification, the namespace xmlns="http://www.ataebiz.org/XMLSchema" is used. A catalog file was created to apply the schema to the XML files. A Schematron was also created to validate some rules apart from the schema. However, when we have the XMLNS tag, Oxygen doesn't take the Schematron into account. When I remove the XMLNS tag, the Schematron works, but the schema stops working.
Am I doing something wrong, or is it really a tool issue?
Validation scenario:
image.png
Catalog:
image.png
Simple Schematron:
image.png
File with XMLNS working with Schema, but not with schematron:
image.png
File without XMLNS working with Schematron, but not with schema:
image.png
We are having the same problem when using xsi:noNamespaceSchemaLocation instead of xsi:schemaLocation
You do not have the required permissions to view the files attached to this post.
-
- Posts: 43
- Joined: Thu Feb 16, 2023 11:00 pm
Re: Using Schema+Schematron on XML files with XMLNS error
I found the solution.
The following declaration is missing in schematron:
<sch:ns uri="http://www.ataebiz.org/XMLSchema" prefix="ata"/>
Now it working fine.
I'm sorry.
The following declaration is missing in schematron:
<sch:ns uri="http://www.ataebiz.org/XMLSchema" prefix="ata"/>
Now it working fine.
I'm sorry.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Using Schema+Schematron on XML files with XMLNS error
Hi,
Right, once your XML is in a certain namespace, the XPath expressions in the Schematron need to match elements in that namespace.
So either write flexible matches like *:para or match directly elements in the namespace by using ata:para and mapping the "ata" prefix to the namespace.
Regards,
Radu
Right, once your XML is in a certain namespace, the XPath expressions in the Schematron need to match elements in that namespace.
So either write flexible matches like *:para or match directly elements in the namespace by using ata:para and mapping the "ata" prefix to the namespace.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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