RE: Validate xml file using xml schema

2004-02-23 Thread Samuel Cheung
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.

Re: Validate xml file using xml schema

2004-02-23 Thread John A. Mitchell
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.

Re: Validate xml file using xml schema

2004-02-23 Thread Michael Glavassevich
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

Validate xml file using xml schema

2004-02-23 Thread Samuel Cheung
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

Re: XML validation using xml schema string

2003-01-27 Thread Praveen Peddi
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

Re: XML validation using xml schema string

2003-01-24 Thread Jeff Greif
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

Re: XML validation using xml schema string

2003-01-24 Thread Praveen Peddi
} 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

Re: XML validation using xml schema string

2003-01-23 Thread Jeff Greif
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. >

Re: XML validation using xml schema string

2003-01-23 Thread Praveen Peddi
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

Re: XML validation using xml schema string

2003-01-23 Thread Jeff Greif
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

Re: XML validation using xml schema string

2003-01-23 Thread Praveen Peddi
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

Re: XML validation using xml schema string

2003-01-22 Thread Praveen Peddi
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

Re: XML validation using xml schema string

2003-01-20 Thread sandygao
XML validation using xml schema string 01/20/2003 09:16

RE: XML validation using xml schema string

2003-01-20 Thread McEvoy, Peter
/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&#

Re: XML validation using xml schema string

2003-01-20 Thread Praveen Peddi
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

XML validation using xml schema string

2003-01-15 Thread Praveen Peddi
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

AW: problem using XML schema w/ Xerces 2

2002-11-05 Thread Amthauer, Heiner
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: ---

problem using XML schema w/ Xerces 2

2002-11-04 Thread cruegger
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

Re: How to implement getElementById() with Xerces using XML Schema?

2002-08-29 Thread H.-Gerd Rosarius
() 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

Re: How to implement getElementById() with Xerces using XML Schema?

2002-08-28 Thread Elena Litani
"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

How to implement getElementById() with Xerces using XML Schema?

2002-08-27 Thread H.-Gerd Rosarius
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

Identify errors on attribute values using XML Schema

2001-08-20 Thread Nikolaos Giannadakis
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.

Re: Using xml schema

2001-02-27 Thread Michael Duffy
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/

Re: Using xml schema

2001-02-27 Thread Edwin Goei
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

Re: Using xml schema

2001-02-23 Thread Michael Duffy
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

Re: Using xml schema

2001-02-23 Thread neilg
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]

Re: Using xml schema

2001-02-23 Thread Ian Roberts
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

Re: Using xml schema

2001-02-23 Thread Alex Neth
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

Re: Using xml schema

2001-02-23 Thread Michael Duffy
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

Re: Using xml schema

2001-02-22 Thread Alex Neth
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

Re: Using xml schema

2001-02-22 Thread Ian Roberts
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

Using xml schema

2001-02-22 Thread Alex Neth
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