Problem Validating XForm Against Schema
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 37
- Joined: Tue Nov 25, 2003 3:31 am
Problem Validating XForm Against Schema
I have an xforms file which is failing validation for no
reason I can see. The first few lines of the file are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xforms:model
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:schemaLocation="http://www.w3.org/2002/xforms
http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd"
> <!-- error diagnosed on this line -->
<xforms:instance>
<credit-card>
<type/>
..... etc.
The document was developed outside Oxygen, but I believe that it
is probably valid, and that the syntax errors are probably invalid.
---------------
The validation failure is diagnosed as follows
Severity 2
Description cvc-elt.1: Cannot find the declaration of element 'xforms:model'.
Resource xforms-credit-card-model.xml
In Folder vendorSite/webRoot/WEB-INF/resources/pagesets/checkout
Location line 7
Creation Time September 24, 2004 8:25:18 AM
------------
If anybody can tell me what am I doing to cause the above error, and
how I can get the document to to validate, I would appreciate it.
Bill.[/code]
reason I can see. The first few lines of the file are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xforms:model
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:schemaLocation="http://www.w3.org/2002/xforms
http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd"
> <!-- error diagnosed on this line -->
<xforms:instance>
<credit-card>
<type/>
..... etc.
The document was developed outside Oxygen, but I believe that it
is probably valid, and that the syntax errors are probably invalid.
---------------
The validation failure is diagnosed as follows
Severity 2
Description cvc-elt.1: Cannot find the declaration of element 'xforms:model'.
Resource xforms-credit-card-model.xml
In Folder vendorSite/webRoot/WEB-INF/resources/pagesets/checkout
Location line 7
Creation Time September 24, 2004 8:25:18 AM
------------
If anybody can tell me what am I doing to cause the above error, and
how I can get the document to to validate, I would appreciate it.
Bill.[/code]
Bill W.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Bill,
To associate a schema with a target namespace with an instance document you need to use the xsi:schemaLocation attribute from the http://www.w3.org/2001/XMLSchema-instance namespace like below:
Best Regards,
George
To associate a schema with a target namespace with an instance document you need to use the xsi:schemaLocation attribute from the http://www.w3.org/2001/XMLSchema-instance namespace like below:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xforms:model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2002/xforms http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd"
xmlns:xforms="http://www.w3.org/2002/xforms">
...
George
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Bill,
I remember I wanted to add this to my previous post but I forgot...
If you start with a document like:
<?xml version="1.0" encoding="UTF-8"?>
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
...
</xforms:model>
and use the Associate schema action and provide http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd as the schema you will get the schema instance namespace binding to xsi and xsi:schemaLocation added automatically in your document.
Best Regards,
George
I remember I wanted to add this to my previous post but I forgot...
If you start with a document like:
<?xml version="1.0" encoding="UTF-8"?>
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
...
</xforms:model>
and use the Associate schema action and provide http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd as the schema you will get the schema instance namespace binding to xsi and xsi:schemaLocation added automatically in your document.
Best Regards,
George
-
- Posts: 37
- Joined: Tue Nov 25, 2003 3:31 am
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