How to use XSD 1.1 in xProc?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 22
- Joined: Tue Oct 17, 2017 5:05 pm
How to use XSD 1.1 in xProc?
Post by serioadamo97 »
Hi,
I use the following xProc file to validate xml.
But if BookStore.xsd is a xsd 1.1 (eg: use xs:all with more than one maxOccuars), then errors occur:
Engine name: Calabash XProc
Severity: error
Description: Within <xs:all>, an <xs:element> must have @maxOccurs equal to 0 or 1
How to use xsd 1.1 in XProc?
Thanks.
I use the following xProc file to validate xml.
Code: Select all
<p:declare-step version="1.0" xmlns:p="http://www.w3.org/ns/xproc">
<p:input port="source">
<p:document href="BookStore.xml"/>
</p:input>
<p:output port="result">
<p:pipe step="myValidate" port="result"/>
</p:output>
<p:validate-with-xml-schema assert-valid="true" mode="strict" name="myValidate">
<p:input port="schema">
<p:document href="BookStore.xsd"/>
</p:input>
</p:validate-with-xml-schema>
</p:declare-step>
Engine name: Calabash XProc
Severity: error
Description: Within <xs:all>, an <xs:element> must have @maxOccurs equal to 0 or 1
How to use xsd 1.1 in XProc?
Thanks.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: How to use XSD 1.1 in xProc?
Hi,
What version of Oxygen are you using?
Older versions of Calabash XProc (prior to 2014) could not be configured to use Saxon-EE with a custom configuration. It seems there was a bug in XProc that made it ignore the Saxon config file.
For recent versions, you should copy/edit the file Oxygen\lib\xproc\calabash\lib\saxon.config and add within the configuration element a line with:
Note that if Oxygen is installed in "Program Files" (it is by default) you will first have to copy the saxon.config file to a folder with write access (e.g. your user profile or desktop), modify it there and then copy it back to its original location, overwriting the existing file.
Regards,
Adrian
What version of Oxygen are you using?
Older versions of Calabash XProc (prior to 2014) could not be configured to use Saxon-EE with a custom configuration. It seems there was a bug in XProc that made it ignore the Saxon config file.
For recent versions, you should copy/edit the file Oxygen\lib\xproc\calabash\lib\saxon.config and add within the configuration element a line with:
Code: Select all
<xsd version="1.1"/>
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
-
- Posts: 22
- Joined: Tue Oct 17, 2017 5:05 pm
Re: How to use XSD 1.1 in xProc?
Post by serioadamo97 »
It works now, very thanks.adrian wrote:Hi,
What version of Oxygen are you using?
Older versions of Calabash XProc (prior to 2014) could not be configured to use Saxon-EE with a custom configuration. It seems there was a bug in XProc that made it ignore the Saxon config file.
For recent versions, you should copy/edit the file Oxygen\lib\xproc\calabash\lib\saxon.config and add within the configuration element a line with:Note that if Oxygen is installed in "Program Files" (it is by default) you will first have to copy the saxon.config file to a folder with write access (e.g. your user profile or desktop), modify it there and then copy it back to its original location, overwriting the existing file.Code: Select all
<xsd version="1.1"/>
Regards,
Adrian
But I have another question:
How to make XProc to prompt detail information, when schema validate failed? (eg: line number and element name in source document)
I use the XProc file below,
when source document is valid, it will print the document,
but if source document is invalid, it will report dynamic error instead of detail infomation.
Description: err:XC0053 : XProc error err:XC0053 It is a dynamic error if the assert-valid option is true and the input document is not valid. One or more validation errors were reported
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: How to use XSD 1.1 in xProc?
Hi,
I'm afraid I don't have a solution for this one. I've searched around the web, but can't find anything in this regard. This is between XML Calabash and Saxon-EE. It could be that it's not possible to obtain more detailed information about the error with XProc.
The XProc specs mention that:
Regards,
Adrian
I'm afraid I don't have a solution for this one. I've searched around the web, but can't find anything in this regard. This is between XML Calabash and Saxon-EE. It could be that it's not possible to obtain more detailed information about the error with XProc.
The XProc specs mention that:
The last part indicates the PSVI info may not necessarily be useful in case of an error. But again, not sure if XMLCalabash+Saxon-EE support PSVI and even if supporting PSVI could provide detailed error info.It is a dynamic error (err:XC0053) if the assert-valid option is true and the input document is not valid. If the assert-valid option is false, it is not an error for the document to be invalid. In this case, if the implementation does not support the PSVI, p:validate-with-xml-schema is essentially just an “identity” step, but if the implementation does support the PSVI, then the resulting document will have additional type information (at least for the subtrees that are valid).
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)
- ↳ 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