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:noNamespace SchemaLocation= "staff.xsd" >
<person>
<name>Andrew Richards</name>
<dept>Trainin g</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:strin g"/>
<xsd:element name="dept" type="xsd:strin g"/>
<xsd:element name="person">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element ref="name"/>
<xsd:element ref="dept"/>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="staff">
<xsd:complexTyp e>
<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 5 3499
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 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*
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.c om/downloads/details.aspx?fa milyid=993c0bcf-3bcf-4009-be21-27e85e1857b1&di splaylang=en>
--
Martin Honnen http://JavaScript.FAQTs.com/
On Apr 5, 4:18 pm, Juergen Kahrs
<Juergen.KahrsD ELETET...@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
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 ! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 script that validates the form fields. the validation
procedure is called ONCLICK event of the submit button.
Follwowing is the structure of the validation procedure.
|
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 compare values in my database and if a
certain field equals something then the field is shown on the form. When
the form is displayed in the browser, it could any increment of the 10
fields on it. My problem is that unless all fields are being shown...
|
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 individual fields, such as an "Email Validation
Script" or a "Phone Validation Script".
Is it ok to put all these scripts on page as they are or should they be
joined in some way together to be one script?
I'm a total JavaScript newbie and am completely...
|
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 accept on an insert, however,
when it does a comparision validation it is failing. I have
StartDate = comparing to an invisible textbox that contains todays date
EndDate = comparing to StartDate needing to be >=
SetupDate = comparing to StartDate...
|
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. Page_ValidationSummaries has a length of 1 but
there are no array entries.
This is the line that fails:
summary.style.display = "none";
| |
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".
'Measurement Validation (Range Validator)
Dim MeasurementRangeValidator As New RangeValidator 'validate that the measure is numeric
MeasurementRangeValidator.ControlToValidate = txtMeasurement.ID|
MeasurementRangeValidator.Display =...
|
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 myself ?
Niclas
|
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 I' using
the leave event.
Right now I am creating a 'leave' sub for each of the fields.
However, I'd like to simplify that and just call the name of a
function and plug the field name as a variable and be done.
In other words, I would like...
|
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 Linux there is an error. The code that fails is the following:
SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
I´m sure that code is ok. In fact, I´ve found that in several...
|
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
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |