Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Validating an XForms document

Reply
Thread Tools

Validating an XForms document

 
 
Will
Guest
Posts: n/a
 
      08-12-2004
I have been having problems validating an XForms document against the
XForms schema located at
http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd.

I have reduced the XForm to its bare bones as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<xf:model xmlnsf="http://www.w3.org/2002/xforms">
<xf:instance xmlns=""/>
</xf:model>

However, it still does not validate according to any of:

1) http://www.gotdotnet.com/services/xsdvalidator/
2) http://tools.decisionsoft.com/schemaValidate.html
3) msxml 4.0 sp2

I get errors relating to "model" and "instance" not being declared in
the schema.

Can anyone shed any light on this.

Regards

WH
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-12-2004


Will wrote:

> I have been having problems validating an XForms document against the
> XForms schema located at
> http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd.
>
> I have reduced the XForm to its bare bones as follows:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xf:model xmlnsf="http://www.w3.org/2002/xforms">
> <xf:instance xmlns=""/>
> </xf:model>
>
> However, it still does not validate according to any of:
>
> 1) http://www.gotdotnet.com/services/xsdvalidator/
> 2) http://tools.decisionsoft.com/schemaValidate.html
> 3) msxml 4.0 sp2


I have tried validating your simple document against the schema you have
listed above with MSXML 4 with the following JScript program

var schemaCache = new ActiveXObject('Msxml2.XMLSchemaCache.4.0');
schemaCache.add('http://www.w3.org/2002/xforms',
'http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd');

var xmlDocument = new ActiveXObject('Msxml2.DOMDocument.4.0');
xmlDocument.async = false;
xmlDocument.schemas = schemaCache;

var loaded = xmlDocument.load('test2004081204.xml');
if (!loaded) {
alert(xmlDocument.parseError.reason + '\r\n' +
xmlDocument.parseError.line + '\r\n' +
xmlDocument.parseError.srcText);
}
else {
alert("valid");
}

and I already get an error when the schema is processed, the error
happens when the included schema for XML schema
http://www.w3.org/2001/XMLSchema.xsd
is processed so it doesn't look like MSXML 4 is able to help you with
validation here.


--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-12-2004


Will wrote:

> I have been having problems validating an XForms document against the
> XForms schema located at
> http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd.
>
> I have reduced the XForm to its bare bones as follows:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xf:model xmlnsf="http://www.w3.org/2002/xforms">
> <xf:instance xmlns=""/>
> </xf:model>
>
> However, it still does not validate according to any of:
>
> 1) http://www.gotdotnet.com/services/xsdvalidator/
> 2) http://tools.decisionsoft.com/schemaValidate.html
> 3) msxml 4.0 sp2
>
> I get errors relating to "model" and "instance" not being declared in
> the schema.
>
> Can anyone shed any light on this.


Trying jEdit on your file by adding the schemaLocation attribute e.g.

<?xml version="1.0" encoding="iso-8859-1"?>
<xf:model
xmlnsf="http://www.w3.org/2002/xforms"
xmlnssi="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">
<xf:instance xmlns=""/>
</xf:model>

I do not get any validation errors, jEdit uses Xerces-J from
http://xml.apache.org/.


--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between ASP.Net Forms and XForms Kiran ASP .Net 1 11-26-2004 01:34 PM
XFORMS Roedy Green Java 4 05-17-2004 07:18 PM
Avoiding duplication of XML Schema in XForms document Victor Engmark XML 0 04-14-2004 07:58 AM
XForms and Schemas Jonathan XML 1 01-02-2004 03:28 PM
standalone xforms? (via swing or xul?) Herr Fuchs Java 2 10-17-2003 01:03 PM



Advertisments