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

RE: xsd and org.apache.commons.digester.Digester

  • To: <xml-dev@l...>
  • Subject: RE: xsd and org.apache.commons.digester.Digester
  • From: "Darren Hall" <dhall@u...>
  • Date: Mon, 3 Jul 2006 10:56:21 -0400
  • Importance: Normal
  • In-reply-to: <001d01c69c87$48562140$800101df@u...>

org.apache.commons.digester.digester
I'm still receiving this problem. Does anyone have any suggestions?
Is it possible that I'm not configuring the Digester properly?
The 'Document is invalid: no grammar found.' error appears to be occurring
in my xml file right after the text 'uwaf-config' and before the 'xmlns'
text in my first element. I have no idea why this would be happening.
Any help would be appreciated.

Thanks,

Darren



-----Original Message-----
From: Darren Hall [mailto:dhall@u...] 
Sent: Friday, June 30, 2006 4:54 PM
To: xml-dev@l...
Subject: RE:  xsd and org.apache.commons.digester.Digester

Hello again,

I fixed the earlier problem I was having with parsing my xml doc, but now
I'm getting another one -

2006-06-30 16:04:40,469 ERROR org.apache.commons.digester.Digester - Parse
Error at line 2 column 13: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.

I'm using commons-digester 1.7 and an xsd to read from my xml file.

>From the research I've been doing online, it seems this error could be
related to the fact that I somehow need to configure the digester to let it
know I'm validating using XML schema... but I'm not sure.

Can anyone point me in the right direction as far as solving this problem?

Thanks,
Darren

<Relevant Code>
//Java code that creates the digester and calls parse
...
String configPath = "/WEB-INF/classes/uwaf-config.xml";

digester = new Digester();
digester.setNamespaceAware(true);
digester.setValidating(this.isValidating());
digester.setUseContextClassLoader(true);
digester.addRuleSet(new ConfigRuleSet());
digester.push(configPath);

InputStream input = null;
URL url = getServletContext().getResource(configPath);
InputSource is = new InputSource(url.toExternalForm());
input = url.openStream();
is.setByteStream(input);
digester.parse(is);
...

//uwaf-config.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<uwaf-config xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation =
"http://www.utrs.com/content/uwaf/v10/xsd/">
  <view-mappings type="com.utrs.framework.webapp.examples.PageProcessor">
    <view path="/home" forward="/home.jsp" >
        <set-property property="home" value="HOME" />
    </view>
  </view-mappings>
</uwaf-config>

//uwaf-config_1_0.xsd
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema version="1.1" 
targetNamespace="http://www.utrs.com/content/xml/xsd/uwaf/v10/config" 
           xmlns:waf="http://www.utrs.com/content/xml/xsd/uwaf/v10/config/" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           elementFormDefault="qualified" attributeFormDefault="qualified">
  <!-- definition of complex type elements -->
  <xs:element name="uwaf-config">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="view-mappings" type="map-list" maxOccurs="1"/>
        <xs:attribute name="id" type="id" use="optional"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
...





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.