Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 15204 invoked from network); 24 Jul 2004 07:06:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 24 Jul 2004 07:06:55 -0000 Received: (qmail 11034 invoked by uid 500); 24 Jul 2004 07:06:47 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 11003 invoked by uid 500); 24 Jul 2004 07:06:47 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 10989 invoked by uid 99); 24 Jul 2004 07:06:47 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_BY_IP,SB_NEW_BULK,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received: from [216.239.56.248] (HELO mproxy.gmail.com) (216.239.56.248) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sat, 24 Jul 2004 00:06:44 -0700 Received: by mproxy.gmail.com with SMTP id w29so850366cwb for ; Sat, 24 Jul 2004 00:06:44 -0700 (PDT) Received: by 10.11.116.63 with SMTP id o63mr16716cwc; Sat, 24 Jul 2004 00:06:44 -0700 (PDT) Message-ID: Date: Sat, 24 Jul 2004 17:06:44 +1000 From: Dion Gillard To: Jakarta Commons Users List Subject: Re: [Jelly] Problems with XML schema using Jelly and Avalon In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Sounds like a dom4j bug we're exposing. On Fri, 23 Jul 2004 15:05:00 -0500, Jon Brisbin wrote: > I can't find anything in the archives about this, even though I'm sure > something like this is in there. Call me stupid... > > Anyway, I have this XML configuration file that I'm loading with Jelly. I > have a special class that loads the XML file through Jelly, then builds an > Avalon Configuration with it. The problem comes when I'm trying to do XML > Schema validation with the XML file. > > In XML Spy, everything works great, but when I tried to load the XML file > through the Jelly XMLParser with validation turned on, it consistently > fails. If anyone can shed light on why, I'd appreciate it... > > Avalon Framework: 4.2.0 > Jelly: 1.0-beta3 > Xerces: 2.6.2 > > Code: > > StringWriter sw = new StringWriter(); > > XMLSerializer ser = new XMLSerializer(sw, (new OutputFormat())); > > XMLParser jellyParser = new XMLParser(); > > jellyParser.getXMLReader().setFeature( > "http://apache.org/xml/features/validation/schema", true); > jellyParser.getXMLReader().setFeature( > "http://xml.org/sax/features/validation", true); > jellyParser.getXMLReader().setFeature( > "http://xml.org/sax/features/namespaces", true); > jellyParser.getXMLReader().setFeature( > "http://xml.org/sax/features/namespace-prefixes", false); > jellyParser.setValidating(true); > > XMLOutput jellyOutput = new XMLOutput(ser.asContentHandler()); > > Script jellyScript = jellyParser > > ..parse("d:/projects/xportal-definitions/actions/sql/payroll/get_check_hdr.xm > l"); > jellyScript.compile(); > jellyScript.run((new JellyContext()), jellyOutput); > > System.out.println("[After]: " + sw.toString()); > > ByteArrayInputStream bais = new ByteArrayInputStream(sw.toString() > .getBytes()); > > DefaultConfigurationBuilder configBuilder = new > DefaultConfigurationBuilder(); > > Configuration config = configBuilder.build(bais); > > System.out.println("[Config]: " > + ConfigurationUtil.toString(config)); > > Root XML element (validates fine in XMLSpy): > > xmlns="http://npci.com/xportal/1.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:x="http://npci.com/xportal/1.0" > xsi:schemaLocation="-//http://npci.com/xportal/1.0//- > D:\projects\xportal-definitions\xsd\jdbc-handler.xsd"> > > Root XML element (after parsing in Jelly): > [After]: > schemaLocation="-//http://npci.com/xportal/1.0//- > D:\projects\xportal-definitions\xsd\jdbc-handler.xsd" > xmlns="http://npci.com/xportal/1.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > BTW- Why are these two elements different? Shouldn't the namespace info > come across just as it went in? > > Thanks! > > Jon Brisbin > ======================================= > Development Programmer > NPC International > (620) 235-7726 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > -- http://www.multitask.com.au/people/dion/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org