Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > [Newbie] Text in nested tags

Reply
Thread Tools

[Newbie] Text in nested tags

 
 
Federico
Guest
Posts: n/a
 
      07-14-2003
Hi all,

I have some texts codifed in XML and I'implementing eXist
(http://exist.sourceforge.net) for textual researches.

The XML file I obtain after the query from eXist, highlight the word
searched with the tag <exist:match>

So the situation is (if we have searched for the word "ago" for
example)

<p>Call me Ishmael. Some years <exist:match>ago</exist:match> -- never
mind how long precisely -- having little or no money....</p>

I should be able to select a prefixed number of words (four for
example) before and after the <exist:match>, so that the result should
be:

<p>me Ishmael. Some years <exist:match>ago</exist:match> -- never mind
how long</p>

Now I can apply an XSL Stylesheet to present this result in HTML.

But How can I select backwards the prefixed number of words before the
<exist:match> tag and forwards the words after the tag, eliminating
all the others?.

Is it possible using XSLT or should I use SAX?

Thank you
Federico
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      07-15-2003
On Mon, 14 Jul 2003 21:52:55 GMT, Federico <(E-Mail Removed)> wrote:

>Is it possible using XSLT or should I use SAX?


Sounds like a job for XSLT, with Javascript extensions. XSLT is good
at node structure , but falls down a bit within a #cdata.

Or you could certainly do it through the DOM. I guess the relative
ease depends on what you get back from your search routine - is this
just one search result you're given, or do you also have to extract
that from a results page ? (for which XSLT might be useful)

 
Reply With Quote
 
 
 
 
Federico
Guest
Posts: n/a
 
      07-15-2003

>Or you could certainly do it through the DOM. I guess the relative
>ease depends on what you get back from your search routine - is this
>just one search result you're given, or do you also have to extract
>that from a results page ? (for which XSLT might be useful)


The result is an XML file, I think I will use JDOM to manipulate the
XML file and then I will pass it to an XSLT stylesheet for the
visualization of the resutls.

Need only to find a way do manage the characters before and after the
nested tag

Thank you
Fede
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
Evaluating struts tags inside my own custom tags... A. Brinkmann Java 2 04-16-2004 07:44 AM
JSP newbie - use include, custom tags, standard tags - or what? Mike Java 3 01-09-2004 09:30 AM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM
Custom Tags within Custom Tags. Ranganath Java 2 10-21-2003 06:14 AM



Advertisments