xsl-list
[Top] [All Lists]

RE: Detecting character combination in XML

2005-07-24 13:45:29
Karl,

See the "contains" function -- you'd check to see whether the description contains the string " q", etc. Thus:

<xsl:template match="book[contains(description, ' q')]">
   <xsl:value-of select="title"/>
</xsl:template>

--A


<bookshelf>
  <book>
    <title>A</book>
    <desc>This qis an interesting qbook about...</desc>
  </book>
  <book>
    <title>B</book>
    <desc>This is another good book</desc>
  </book>
</bookshelf>

When you look at the description (desc) you can see that the first text
contains sometimes a "q" (non capital letters) before a word. I would like a
script that detects all books and return their titles, when the description
contrains a space and a q next to each other somewhere in the text. This
should be only if the q is a non-capital letter. I am using Xalan and don't
really want to change the parser for this task...

This text output here would look that:

A


I am aware that this might be sometimes incorrect but I just want to use
this output to crosscheck and support my manual work.

Also, I have some variations for this:

variation a) I would like to detect the following ". q".
variation b) I would like to detect teh following "? q".

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>