Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] using xom/xerces for JSP app (tomcat 4.1.18)

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: luca passani <passani AT eunet.no>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] using xom/xerces for JSP app (tomcat 4.1.18)
  • Date: Wed, 2 Apr 2003 07:14:15 -0500

Hallo, I am building a library to be used with JSP and Servlets. The problem seems to be
with the XOM/Xerces. The msg is:

javax.servlet.ServletException: Cannot inherit from final class
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)


Looking at the exception message, I doubt this has anything to do with XOM. That's not a class XOM uses or knows about. It may have something to do with which classes are loaded form where in the CLASSPATH. Servlet environments are tricky that way, and can have problems if you're trying to load the same or inherited classes with different classloaders.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| Processing XML with Java (Addison-Wesley, 2002) |
| http://www.cafeconleche.org/books/xmljava |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
From elharo AT metalab.unc.edu Sun Apr 6 21:05:36 2003
Return-Path: <elharo AT metalab.unc.edu>
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216])
by happyhouse.metalab.unc.edu (Postfix) with ESMTP id 716B820018
for <XOM-interest AT lists.ibiblio.org>;
Sun, 6 Apr 2003 21:05:36 -0400 (EDT)
Received: (qmail 26205 invoked from network); 7 Apr 2003 01:05:47 -0000
Received: from unknown (HELO [192.168.254.4]) ([216.254.85.72])
(envelope-sender <elharo AT metalab.unc.edu>)
by mail16.speakeasy.net (qmail-ldap-1.03) with SMTP
for <laurent.bihanic AT atosorigin.com>; 7 Apr 2003 01:05:47 -0000
Mime-Version: 1.0
X-Sender: elharo AT mail.ibiblio.org
Message-Id: <p04330115bab66208745f@[192.168.254.4]>
In-Reply-To: <3E3941C4.1070904 AT atosorigin.com>
References: <3E3941C4.1070904 AT atosorigin.com>
Date: Sun, 6 Apr 2003 18:01:57 -0500
To: Laurent Bihanic <laurent.bihanic AT atosorigin.com>,
XOM-interest <XOM-interest AT lists.ibiblio.org>
From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
Subject: Re: [XOM-interest] XPath support for XOM
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: <xom-interest.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Apr 2003 01:05:37 -0000

At 4:16 PM +0100 1/30/03, Laurent Bihanic wrote:
[Same mail but with the source code attached!]

Hi,

Attached are 2 classes that add XPath support to XOM using the Jaxen path
engine (1.0 FCS). I ran quick tests including tests on XPath functions and
namespace support and so far everything seems OK.

I put these classes in a package nu.xom.xpath.jaxen thinking XOM should wrap
them into an engine-independent XPath class, the way JDOM does. Opinions?


public class XOMXPath extends BaseXPath
public class DocumentNavigator extends DefaultNavigator {

Will these work if the classes are non-public? I'd like to hide the implementation and keep the JavaDocs as small as possible. I'm thinking just a single query method in the Node interface which might be backed by Jaxen but not directly expose it.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| Processing XML with Java (Addison-Wesley, 2002) |
| http://www.cafeconleche.org/books/xmljava |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
From elharo AT metalab.unc.edu Mon Apr 7 12:01:38 2003
Return-Path: <elharo AT metalab.unc.edu>
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211])
by happyhouse.metalab.unc.edu (Postfix) with ESMTP id ABA44200F9
for <xom-interest AT lists.ibiblio.org>;
Mon, 7 Apr 2003 12:01:34 -0400 (EDT)
Received: (qmail 18669 invoked from network); 7 Apr 2003 16:01:36 -0000
Received: from unknown (HELO [192.168.254.4]) ([216.254.85.72])
(envelope-sender <elharo AT metalab.unc.edu>)
by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP
for <passani AT eunet.no>; 7 Apr 2003 16:01:36 -0000
Mime-Version: 1.0
X-Sender: elharo AT mail.ibiblio.org
Message-Id: <p0433010abab74f337724@[192.168.254.4]>
In-Reply-To: <3E85FE17.7070902 AT eunet.no>
References: <3E85FE17.7070902 AT eunet.no>
Date: Mon, 7 Apr 2003 11:53:15 -0400
To: luca passani <passani AT eunet.no>,
xom <xom-interest AT lists.ibiblio.org>
From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
Subject: Re: [XOM-interest] loop in loop? xpath?
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: <xom-interest.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Apr 2003 16:01:38 -0000

At 9:12 PM +0100 3/29/03, luca passani wrote:
Assuming I have a bit of XML like the following, what's the best (most efficient) way
to retrieve the list of capability names and stick them into an ArrayList?

I already have:

Element genericElement = (Element)deviceElementsList.get("generic");

I can only think of nested loops, but maybe there is some XOM shorthand notation?
What about XPATH?

XPath will eventually be added, but not today. (Today I'm fixing bugs. :-) ) You can use nested loops or you can use recursive descent, which ever seems more natural to you.

<device id="generic">
<group id="ui">
<capability name="proportional_font" value="false"/>
<capability name="built_in_back_button_support" value="false"/>
</group>
<group id="cache">
<capability name="total_cache_disable_support" value="false"/>
<capability name="time_to_live_support" value="false"/>
</group>
</device>

--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| Processing XML with Java (Addison-Wesley, 2002) |
| http://www.cafeconleche.org/books/xmljava |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
From Nils_Kilden-Pedersen AT Countrywide.Com Mon Apr 7 14:01:25 2003
Return-Path: <Nils_Kilden-Pedersen AT Countrywide.Com>
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from simsmtp1.cwdir.com (simsmtp1.cwdir.com [63.166.226.150])
by happyhouse.metalab.unc.edu (Postfix) with SMTP id 2B88720013
for <xom-interest AT lists.ibiblio.org>;
Mon, 7 Apr 2003 14:01:25 -0400 (EDT)
Received: from 63.166.226.133 by simsmtp1.cwdir.com with ESMTP ( (MMS
v5.0)); Mon, 07 Apr 2003 11:01:20 -0700
X-Server-Uuid: 217DC97D-783B-48DA-932A-43F4820B4412
To: xom-interest AT lists.ibiblio.org
MIME-Version: 1.0
X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001
Message-ID: <OFF0C2B548.26CCCAEC-ON88256D01.0062A735 AT countrywide.com>
From: Nils_Kilden-Pedersen AT Countrywide.Com
Date: Mon, 7 Apr 2003 10:59:18 -0700
X-Form: Reply
X-MIMETrack: Serialize by Router on Emerald/Servers/CWExternal(Release
6.0.1CF1 | March 06, 2003) at 04/07/2003 10:59:21 AM, Serialize
complete at 04/07/2003 10:59:21 AM
X-WSS-ID: 128F63651331825-15-01
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: [XOM-interest] Easy schema validation
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: <xom-interest.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Apr 2003 18:01:25 -0000

Is there an easy way to validate an XML document (with no schema reference) against a schema, in XOM?

Thanks,
Nils




Archive powered by MHonArc 2.6.24.

Top of Page