[Newbie] Text in nested tags

Discussion in 'XML' started by Federico, Jul 14, 2003.

  1. Federico

    Federico Guest

    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
     
    Federico, Jul 14, 2003
    #1
    1. Advertising

  2. Federico

    Andy Dingley Guest

    On Mon, 14 Jul 2003 21:52:55 GMT, Federico <> 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)
     
    Andy Dingley, Jul 15, 2003
    #2
    1. Advertising

  3. Federico

    Federico Guest


    >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
     
    Federico, Jul 15, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dean H. Saxe
    Replies:
    0
    Views:
    1,041
    Dean H. Saxe
    Jan 3, 2004
  2. Rob Nicholson
    Replies:
    3
    Views:
    755
    Rob Nicholson
    May 28, 2005
  3. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    464
    Ranganath
    Oct 21, 2003
  4. Mike
    Replies:
    3
    Views:
    879
    Michael Borgwardt
    Jan 9, 2004
  5. A. Brinkmann
    Replies:
    2
    Views:
    1,079
    A. Brinkmann
    Apr 16, 2004
Loading...

Share This Page