473,506 Members | 16,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation in IE never fails!

Hi

I'm new to this group, so apologies if it's an old chestnut, or not
appropriate to this group....

I have been playing around with creating xml files and schemas with
which to validate them. In order to validate them, I've downloaded the
"Tools for validating XML and viewing XSL output" from Microsoft and
installed them. I've tried this on various machines, with various
browser versions and OS's.

However, when the file is valid, right-clicking --Validate XML
reports "Validation Successful". But then introducing deliberate (and
quite major) errors still results in "Validation Successful".

As an example:

staff.xml

<staff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="staff.xsd" >
<person>
<name>Andrew Richards</name>
<dept>Training</dept>
</person>
</staff>
This will validate as is - even if the named xsd file doesn't exist!
But, I then create this:

staff.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="dept" type="xsd:string"/>
<xsd:element name="person">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="name"/>
<xsd:element ref="dept"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="staff">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="person"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

And as expected, the xml file once again validates successfully.

But if I "break" the schema - perhaps by changing the element
declaration for "dept" to "Department", it STILL validates!!!

Am I doing something wrong? Or is IE unable to validate against
schemas? And if so, what's the best way of validating an XML file?
Thanks for your help

Andrew

Apr 5 '07 #1
5 3484
On Apr 5, 4:00 pm, "Andrew" <andrewmricha...@yahoo.co.uk>
wrote:
Am I doing something wrong? Or is IE unable to validate
against schemas? And if so, what's the best way of
validating an XML file?
I would recommend using a standalone validating parser.
xmllint is great, but:

- I like small tools. YMMV.
- I've no idea if there's a native Windows port. If there
isn't one, you can always install Cygwin with libxml2
package.

Even if xmllint doesn't work for you, there's a number of
software packages that come with similar functionality,
both command line and GUI. Ask Google for details.

--
Pavel Lepin

Apr 5 '07 #2
p.*****@ctncorp.com wrote:
I would recommend using a standalone validating parser.
xmllint is great, but:

- I like small tools. YMMV.
I always thought that xmllint was a small tool:

ldd `which xmllint`
libxml2.so.2 =/usr/lib/libxml2.so.2 (0x00979000)
libpthread.so.0 =/lib/tls/libpthread.so.0 (0x00dcd000)
libz.so.1 =/usr/lib/libz.so.1 (0x00dab000)
libm.so.6 =/lib/tls/libm.so.6 (0x00d80000)
libc.so.6 =/lib/tls/libc.so.6 (0x00101000)
/lib/ld-linux.so.2 (0x005a2000)
ll `which xmllint`
-rwxr-xr-x 1 root root 50250 Oct 26 2005 /usr/bin/xmllint*

If that aint small enough, then maybe xmlwf is:

ldd `which xmlwf`
libexpat.so.0 =/usr/lib/libexpat.so.0 (0x00369000)
libc.so.6 =/lib/tls/libc.so.6 (0x00101000)
/lib/ld-linux.so.2 (0x005a2000)
ll `which xmlwf`
-rwxr-xr-x 1 root root 21828 Oct 24 2005 /usr/bin/xmlwf*
Apr 5 '07 #3
Andrew wrote:
Am I doing something wrong? Or is IE unable to validate against
schemas?
IE supports validating against a DTD. If you want to validate against a
schema (or multiple schemas) then you need to install and use MSXML 6
and script the validation.
MSXML 6 is available for download here
<http://www.microsoft.com/downloads/details.aspx?familyid=993c0bcf-3bcf-4009-be21-27e85e1857b1&displaylang=en>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Apr 5 '07 #4
On Apr 5, 4:18 pm, Juergen Kahrs
<Juergen.KahrsDELETET...@vr-web.dewrote:
p.le...@ctncorp.com wrote:
I would recommend using a standalone validating parser.
xmllint is great, but:
- I like small tools. YMMV.

I always thought that xmllint was a small tool:

-rwxr-xr-x 1 root root 50250 Oct 26 2005 /usr/bin/xmllint*
That's why I like it. Not everyone has a soft spot for
small tools, however, and for people like that xmllint
might not be the best option. That's what my warning was
about.

--
Pavel Lepin

Apr 5 '07 #5
Andrew wrote:
Hi

I'm new to this group, so apologies if it's an old chestnut, or not
appropriate to this group....

I have been playing around with creating xml files and schemas with
which to validate them. In order to validate them, I've downloaded the
"Tools for validating XML and viewing XSL output" from Microsoft and
installed them. I've tried this on various machines, with various
browser versions and OS's.

However, when the file is valid, right-clicking --Validate XML
reports "Validation Successful". But then introducing deliberate (and
quite major) errors still results in "Validation Successful".
It sounds like if IE was validating only regarding DTDs, not schema :)

Perhaps you should use a more suitable tool for validating ; the MSXMLn
suite contains various classes for that purpose ; Java has also numbers
of tools

--
Cordialement,

///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
Apr 5 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2612
by: bnp | last post by:
Hi All, I am quite new the JavaScript. Basically I am a C++ programmer, but now I am working on JavaScript since last 5 days. I have a problem regarding the form validation. I have created a...
6
507
by: Darren | last post by:
I have a form that has 10 fields on it. I have made all of them "Required". I also am using vb if statements to decide whether or not each field should be on the page. I am using the vb to...
16
2192
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
0
1965
by: Brian Conway | last post by:
I am having some validation and insertion problems. I am using a date picker that takes the selected date and puts it to ("dd-MMM-yyyy") format, as this was the only format that Oracle would...
3
3030
by: Gary Varga | last post by:
In the file WebUIValidation.js, when a postback that doesn't fail the validation has a javascript error saying summary is undefined in the ValidationSummaryOnSubmit function....
2
2906
by: Chad | last post by:
I have a textbox control, txtMeasurement, that I want to allow only numeric decimal input. I thought to use a client side validation control to ensure that the data entered is of type "Double". ...
1
1811
by: Niclas | last post by:
Hi, How do I indicate what field fails a validation, usually you see a red star next to the faild field on a form. Is this built in functionality in the valdaition controls or shall I code this...
2
6728
by: John Smith | last post by:
Hello, I have a VB.NET application with a Windows form that have several textboxes fields where I have dates entered. I would like to do a date validation check after the the field is updated, so...
1
4286
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in...
8
2721
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.