I think the problem might be different. It's just some time ago that I've written the SimpleXMLExtractor thing. If I find the time I'll look at it tomorrow. My first guess would be that it was developed using a different version of jdom. Something might have changed as Slide was updated to jdom1.0 AFAK.
Cheers, Daniel "Slide Developers Mailing List" <slide-dev@jakarta.apache.org> schrieb am 11.01.05 22:33:44: > > Nope...same deal. > The "compiled" path for that example is > /child::article/child::headline > and propertyValue is still null. > > -Eirikur, idega. > > > On 11.1.2005, at 20:27, Flick, Tim wrote: > > > It may be simpler than you think! > > > > Try this: > > > > "/article/headline" > > > > This should return the value of article/headline, which in your example > > would be "Header". I hope? > > > > Regards, > > Tim > > > > > > -----Original Message----- > > From: Eirikur Hrafnsson [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, January 11, 2005 2:52 PM > > To: Slide Developers Mailing List > > Subject: Re: Need simple XPath help > > > > The problem is that I trying to get the SimpleXMLExtractor to extract > > those values as properties for the Lucene index but this code in > > SimpleXMLExtractor always returns "propertyValue" as null. > > > > public Map extract(InputStream content) throws ExtractorException { > > Map properties = new HashMap(); > > try { > > SAXBuilder saxBuilder = new SAXBuilder(); > > Document document = saxBuilder.build(content); > > for (Iterator i = instructions.iterator(); i.hasNext();) { > > Instruction instruction = (Instruction) i.next(); > > XPath xPath = instruction.getxPath(); > > List nodeList = xPath.selectNodes(document); > > Object propertyValue = filter(nodeList, instruction); > > if (propertyValue != null) { > > properties.put(instruction.getPropertyName(), > > propertyValue); > > } > > in Domain.xml I have the third try...I obviously know nothing about > > XPath ;) > > <!-- Extractor configuration --> > > <extractors> > > <!--XML extractors--> > > <extractor > > classname="org.apache.slide.extractor.SimpleXmlExtractor" uri="/files"> > > <configuration> > > <instruction property="headline" > > xpath="/article/headline[1]" /> > > <instruction property="teaser" > > xpath="/article/teaser[1]" /> > > <instruction property="body" xpath="/article/body[1]" > > /> > > <instruction property="author" > > xpath="/article/author[1]" /> > > <instruction property="source" > > xpath="/article/source[1]" /> > > <instruction property="comment" > > xpath="/article/comment[1]" /> > > </configuration> > > </extractor> > > ... > > > > -Eirikur, Idega. > > > > > > > > > > On 11.1.2005, at 19:36, Daniel Florey wrote: > > > >> A assume your examples didn't work... The xpath expression looks > >> correct to me. What exactly is the encountered problem? > >> Cheers, > >> Daniel > >> > >> "Slide Developers Mailing List" <slide-dev@jakarta.apache.org> schrieb > > > >> am 11.01.05 20:18:45: > >>> > >>> Anyone know what is the XPath to the content of the xml tags in this > >>> example? I've tried some paths but I'm barely a novice in XPath... > >>> > >>> <article xmlns="http://idega.com/block/article/bean"> > >>> <headline>Header</headline> > >>> <teaser>Teaser</teaser> > >>> <body>Body</body> > >>> <author>Author</author> > >>> <source/> > >>> <comment>Comment</comment> > >>> </article> > >>> > >>> I tried e.g. : > >>> "/article/headline[1]/text()" > >>> and just > >>> "/article/headline/text()" > >>> > >>> best regards > >>> > >>> Eirikur, idega. > >>> > >> > >> > >> __________________________________________________________ > >> Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. > >> weltweit telefonieren! http://freephone.web.de/?mc=021201 > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > Best Regards > > > > Eirikur S. Hrafnsson, [EMAIL PROTECTED] > > Chief Software Engineer > > Idega Software > > http://www.idega.com > > > > > Best Regards > > Eirikur S. Hrafnsson, [EMAIL PROTECTED] > Chief Software Engineer > Idega Software > http://www.idega.com > ________________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]