[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: problem with noNamespaceSchemaLocation.....urgent ! !!


xml nonamespaceschemalocation
Okay, here's the pertinent hrefs:

Properties:
http://xml.apache.org/xerces2-j/features.html#validation

FAQ:
http://xml.apache.org/xerces2-j/faq-pcfp.html


Now, these are Xerces 2.0.1 docs. I've tried setting this up in 1.4.1 as
follows. Everything runs, the schema is located, but no validation occurs:

public class TrivialApplication
{
 public static void main( String argv[] )
  throws SAXException, 
   FileNotFoundException, IOException
 {
  File inFile = new File( "d:\\xml\\schemas\\order.xml" );
  InputStream is = new FileInputStream( inFile );
  InputSource input = new InputSource( is );
  
  DefaultHandler handler = new OrderReporter();
  
  XMLReader parser = new SAXParser();
   try {
            parser.setFeature("http://xml.org/sax/features/namespaces",
true);
            parser.setFeature("http://xml.org/sax/features/validation",
true);
 
parser.setFeature("http://apache.org/xml/features/validation/dynamic",
true);
 
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
//
parser.setFeature("http://apache.org/xml/features/validation/schema-full-che
cking", true);
 
parser.setProperty("http://apache.org/xml/properties/schema/external-noNames
paceSchemaLocation", "file:///d:/xml/schemas/order.xsd");
        }
        catch (SAXException e) {
            e.printStackTrace(System.err);
        }

  parser.setContentHandler( handler );
  parser.parse( input );
 }
}

Note that this code is not compatible with 2.0.1. I'm d/ling 2.0.1 and
trying again. If I succeed, you'll know; if I don't, we'll pretend this
conversation never occurred.

-- Jeff

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.