Title: RE: Validate xml file using xml schema
Thanks for the help.
Now, I am trying to validate my xml file, but it said it is missing the declaration of 'Rsp'.
my xml file looks like this:
5.3.0
20040223
And I check the url of my schema, it is valid.
At one time in the recent past I saw this and I think that it may be
because its not finding your schema definition.
Samuel Cheung wrote:
Validate xml file using xml schema
I am trying to use the Counter example to validate
(I use the "-v" option) the personal-schema.
Hi Samuel,
You need use the -s option as well (this corresponds to the feature
http://apache.org/xml/features/validation/schema). This will turn on
schema validation. When you don't supply the parser will attempt to
validate against a DTD, hence the error messages you received.
On Mon, 23 Feb 200
Title: Validate xml file using xml schema
I am trying to use the Counter example to validate (I use the "-v" option) the personal-schema.xml in the data directory in the sample.
But I get these errors instead, could someone please tell me why?
[Error] personal-schema.xml:2:11
Thanks Jeff. It worked perfectly
Praveen
- Original Message -
From: "Jeff Greif" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 3:11 PM
Subject: Re: XML validation using xml schema string
> Try setting the sche
etEntityResolver(new
SchemaEntityResolver(parser.getEntityResolver(), schemaString,
"http://www.contextmedia.com";));
Jeff
- Original Message -
From: Praveen Peddi
To: [EMAIL PROTECTED]
Sent: Friday, January 24, 2003 11:34 AM
Subject: Re: XML validation using xml schema string
Hi Jef
}
catch (java.io.IOException
ex){
System.out.println("IOException Exception");throw
new SAXException("Error Validating the content
XML."); }
finally { long endTime =
System.currentTimeMillis();
System.out.println("Total time of
SAXValidat
ity(pubId, sysId);
}
}
Jeff
- Original Message -
From: "Praveen Peddi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 10:51 AM
Subject: Re: XML validation using xml schema string
> Jeff,
> I think I didn't get you completely.
>
day, January 23, 2003 11:28 AM
Subject: Re: XML validation using xml schema string
> I'm not able to give information correct in detail, but here is an outline
> of what must happen:
>
> The entity resolver is called with a namespace URI or a schema location as
> an argument, I
t; <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 7:44 AM
Subject: Re: XML validation using xml schema string
> I posted a question yesterday about the validation of XML against the
local
> schema (in memory). Could anyone please look at the messa
lt;[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 1:35 PM
Subject: Re: XML validation using xml schema string
> As you said I wrote an EntityResolver but it didn't work. Could you send
me
> a sample code (just the validation code) if u already ha
return source;
}
}
When I try to validate an xml with the schema string, I get the following
error:
Line:1
URI: null
Message: cvc-elt.1: Cannot find the declaration of element 'content'.
Am I doing it wrong? If so please tell me how to use the entityresolv
XML validation
using xml schema string
01/20/2003 09:16
/xmlvalidate.html
Pete
-Original Message-From: Praveen Peddi
[mailto:[EMAIL PROTECTED]Sent: 20 January 2003
14:17To: [EMAIL PROTECTED]Subject: Re: XML
validation using xml schema string
Hi all,
Last week I sent an email regarding the xml
validation against the schema, but didn
Hi all,
Last week I sent an email regarding the xml
validation against the schema, but didn't get any reply. Please reply if
any one has answer to my question. Is it possible to validate an xml document
using a schema document (not the schema url) that is present with in the
application. If
Hi all,
I want to validate an xml document with an existing
schema. I know there is a code to do it when the schema is present as a URL. BUt
in my case schema is present with in the application memory (since it is stored
in the database) and that is not the url or on the hard disk.
I have th
CTED] [mailto:[EMAIL PROTECTED]
Gesendet am: Montag, 4. November 2002 17:08
An: [EMAIL PROTECTED]
Betreff: problem using XML schema w/ Xerces 2
Situation:
I'm using Xerces 2.0 and trying to parse/validate
an XML document against a schema. Here are the xml and
schema files:
foo.xsd:
---
Situation:
I'm using Xerces 2.0 and trying to parse/validate
an XML document against a schema. Here are the xml and
schema files:
foo.xsd:
http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
foo.xml:
---
ABD
ABD
Gree
() with Xerces using XML
Schema?
"H.-Gerd Rosarius" wrote:
> If I use a DTD to specify my id-attribute and assign it to my
> XML file, getElementById() returns an object of type Element.
> If I use a XML Schema I get 'null' instead.
> I tried Xerces 2.0.1 and 2
"H.-Gerd Rosarius" wrote:
> If I use a DTD to specify my id-attribute and assign it to my
> XML file, getElementById() returns an object of type Element.
> If I use a XML Schema I get 'null' instead.
> I tried Xerces 2.0.1 and 2.0.2 .
You need to turn on both validation and schema validation featu
According to the Xerces Java API it should be possible to search
an entire DOM-Document for an Element with a specific ID using
getElementById( String elementId ).
The documentation states that I have to tell the
DOM-Implementation what the name of the id-Attribute is.
Either by use of a DTD or a
Hi. I am declaring a
dateTime attribute for an element among other attributes. In the XML instance, I
am inserting an incorrect value for the former attribute. When I use sax to
validate the XML instance, I get the error callback before the startElement
callback for the element, as expected.
Alex is exactly right, of course. I was able to get
schema support out of Xerces using the JAXP API, as he
recommended.
However, I did finally figure out how to get schema
support out of the Xerces API without using JAXP.
There are four features that must be set to true:
http://apache.org/xml/
Alex Neth wrote:
>
> I don't use the DOMParser class. What is the purpose of this class?
> I use the following method to parse the document:
>
>DocumentBuilderFactory docFactory =
> DocumentBuilderFactory.newInstance();
As someone else mentioned (Ian Roberts) on this thread, JAXP is an XML
Alex:
Thank you - you've hit it precisely on the head.
When I use the JAXP API as you suggested and pass the
altered personal-schema.xml document to it, I get a
SAXParseException, as I should. I DON'T get the
exception unless I set an ErrorHandler that throws it.
This ran counter to my intui
conjunction with the DOM.
Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone: 416-448-3519, T/L 778-3519
E-mail: [EMAIL PROTECTED]
"Alex Neth" <[EMAIL PROTECTED]> on 02/23/2001 01:25:34 AM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
On Thu, 22 Feb 2001, Alex Neth wrote:
>
> The DocumentBuilder API is part of the Sun API, whereas the DOMParser is
> proprietary to Xerces.
>
> I was just wondering why this class exists when it is redundant.
DocumentBuilder is part of JAXP, a standard API for XML parsing. The idea
is that if
The DocumentBuilder API is part of the Sun API, whereas the DOMParser is
proprietary to Xerces.
I was just wondering why this class exists when it is redundant.
I guess you are actually setting the sax feature
http://xml.org/sax/features/validation
to true in order to enable parsing on the DOMP
The name says it all, Alex: it's a parser that parses
an XML document and creates a DOM tree.
Your DocumentBuilder is probably using one behind the
scenes to do the same thing.
The only difference is that you're
DocumentBuilderFactory uses methods like
setNamespaceAware() and setValidating() i
I don't use the DOMParser class. What is the purpose of this class? I use the following method to parse the document:
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setNamespaceAware(true);
docFactory.setValidating(true);
try {
docBuild
On Wed, 21 Feb 2001, Alex Neth wrote:
> Also, does validation have to be enabled in order to get the parser to load
> the schema and apply fixed/default attribute values?
To get the parser to do schema validation at all, you need to set the
validation, validation/schema and namespaces features (s
When using an xml schema, I am getting the error:
myNamespace grammar not found
and can not figure out why. (myNamespace is actually a url of course)
The parser doesn't seem to be even finding the schema file, even though it
is in the same directory. I have tried an absolute path as wel
32 matches
Mail list logo