Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: Re: RE: getChildren problem

Subject: Re: RE: getChildren problem

2007-09-26       - By zongo46@(protected)

 Back
Hi Rolf, thanks for your help. It works now. The different namespaces are
intentional (though the XML is not from me). The children of "Post" are again
in other namespaces, e.g. Dublin Core.

Best, -P-


-- ----- Original-Nachricht -- -----
> Datum: Wed, 26 Sep 2007 10:16:38 -0400
> Von: rolf.lear@(protected)
> An: zongo46@(protected), jdom-interest@(protected)
> Betreff: RE: [jdom-interest] getChildren problem

> See:
> http://www.jdom.org/docs/apidocs/org/jdom/Element.html#getChildren(java.lang
.String)
>
> Especially the part wherre it says it gets Child Elements which have no
> namespace.
>
> Your XML document has a default namespace (which is not the 'no
> namespace') of "http://www.connotea.org/2005/01/schema#", so, you need to use
the
> second form of getChildren (String, Namespace) with the arguments:
>
> posts = element.getChildren("Post",
> Namespace.getNamespace("http://www.connotea.org/2005/01/schema#"));
>
> Also, it is probably intentional, but I just want to confirm that the root
> element RDF is supposed to be in a different namespace than the child
> element Post?
>
> Rolf
>
>
> -- --Original Message-- --
> From: jdom-interest-bounces@(protected)
> [mailto:jdom-interest-bounces@(protected)]On Behalf Of zongo46@(protected)
> Sent: Wednesday, September 26, 2007 5:32 AM
> To: jdom-interest@(protected)
> Subject: [jdom-interest] getChildren problem
>
>
> hello together,
> I got a strange problem with getChildren(). i get the following xml
> inputstream by a http GET request:
>  
> <?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
> xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc
/terms/"
> xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/"
> xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns="http://www.connotea.org/2005
/01/schema#">
>  
>   <Post rdf:about="A_URL">
>   <!-- more elements here -->
>   </Post>
>  
> </rdf:RDF>
>
> my sendRequest() method returns the above xml as a String. From that
> String I build a Document:
>
> String in = sendRequest();
> SAXBuilder parser = new SAXBuilder();
> Document doc = parser.build(new InputSource(new StringReader(in)));
>
> Then I search for the child "Post" of the root element:
>
> List posts = doc.getRootElement().getChildren("Post");
> System.out.println(posts.size()); // output: 0
>
> There is no child "Post"? I think there should be. I tested the following:
>
> List posts = doc.getRootElement().getChildren();
> Element el = (Element)posts.get(0);
> System.out.println(el.getName()); // output: Post
>
> The first output says there is no child post of the root element, the
> second output says that the first child of root element is named "Post". What
's
> wrong here?
>
> Thank you in advance! -P-
> --
> Psssst! Schon vom neuen GMX MultiMessenger geh?rt?
> Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
>  
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> This email and any files transmitted with it are confidential and
> proprietary to Algorithmics Incorporated and its affiliates ("Algorithmics").
If
> received in error, use is prohibited. Please destroy, and notify sender.
> Sender does not waive confidentiality or privilege. Internet communications
> cannot be guaranteed to be timely, secure, error or virus-free. Algorithmics
> does not accept liability for any errors or omissions. Any commitment
> intended to bind Algorithmics must be reduced to writing and signed by an
> authorized signatory.
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---

--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.