You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Rahul Srivastava <rs...@firstam.com> on 2003/04/01 16:31:11 UTC

RE: Validating against an explicitly provided schema with SAX

Hi Andy,

If you want to override the schema referred from the instance document, you
can use the http://apache.org/xml/properties/schema/external-schemaLocation
property.

See:
http://xml.apache.org/xerces2-j/properties.html#schema.external-schemaLocati
on for more details.

Cheers,
Rahul.
  -----Original Message-----
  From: Andy Taylor [mailto:andytaylormxmg@hotmail.com]
  Sent: Tuesday, April 01, 2003 6:12 PM
  To: xerces-j-user@xml.apache.org
  Subject: Validating against an explicitly provided schema with SAX


  Hi,

  I'm writing an application which allows users to upload XML files to an
online J2EE application, which then inserts their data into a database for
processing. I am providing users with an XML schema file online, which will
allow them to validate any files they create before they upload them.

  Once a file has been uploaded, I want my server-side application to
re-validate their XML files before attempting to process their data. To do
this, I need to ignore the schema they have (maybe) specified with the root
element, and re-specify the schema which is to be used. This should stop
users from simply uploading any old valid XML file, for example a completely
unrelated XML file which is valid as no schema has been specified.

  O'Reilly's XML In A Nutshell tells me I should be able to do this with
SAX, but I can't seem to find any info on how. Can anyone help me out?

  Andy


----------------------------------------------------------------------------
--
  Protect your PC from e-mail viruses. Get MSN 8
today. ---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org For
additional commands, e-mail: xerces-j-user-help@xml.apache.org