Validate XML against XSD generated by Oxygen
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 17
- Joined: Fri Aug 21, 2020 5:40 pm
Validate XML against XSD generated by Oxygen
Post by Fiona Chen »
Hello:
I use Oxygen to generate XSD. However, Oxygen hinted Error:
This predicament causes me to comment out below:
If I comment out the subsequent referenced schema in the orignial XML:
My Java API will fail the XSD validation, as the original XML referenced the import ns:
The Java API validation throws error:
I review below post but as the "CD" uses , it wouldn't work.
topic616.html
Do you have a realistic solution for this problem?
I use Oxygen to generate XSD. However, Oxygen hinted Error:
Code: Select all
The {target namespace} of an attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'.
Code: Select all
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="xsi.xsd"/>
Code: Select all
<xs:attribute ref="xsi:schemaLocation" use="required"/>
Code: Select all
<xs:attribute ref="xsi:type" use="required"/>
Code: Select all
<value nullFlavor="OTH" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CD">
Code: Select all
cvc-elt.4.2: Cannot resolve 'CD' to a type definition for element 'value'.
Code: Select all
xmlns:xsi
topic616.html
Do you have a realistic solution for this problem?
-
- Posts: 387
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Validate XML against XSD generated by Oxygen
Hello,
We are using Trang to generate an XSD schema from XML files. It seems that Trang generates an xsi.xsd schema when you use attributes from "http://www.w3.org/2001/XMLSchema-instance" namespace. There is already an issue for this on the Trang project:
https://github.com/relaxng/jing-trang/issues/132
As an workaround you can remove the "xsi.xsd" schema import from your generated XSD schema. You need to delete the following line:
Best Regards,
Octavian
We are using Trang to generate an XSD schema from XML files. It seems that Trang generates an xsi.xsd schema when you use attributes from "http://www.w3.org/2001/XMLSchema-instance" namespace. There is already an issue for this on the Trang project:
https://github.com/relaxng/jing-trang/issues/132
As an workaround you can remove the "xsi.xsd" schema import from your generated XSD schema. You need to delete the following line:
Code: Select all
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="xsi.xsd"/>
Octavian
Octavian Nadolu
<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