Feature Proposal: Nested searchs in nested forms for SearchPatternCookbook
A similar question was answered in support web (
NestedSearch ) a few weeks ago ; this an explanation of nested searchs with nested forms for
SearchPatternCookbook.
Problem
We define the following form :
PublisherForm?
...
The form is given to the following topics :
BooksFromOreilly?
|
|
| Publisher |
OReilly |
| BookList? |
BeautifulCode? , PerlHacks? |
|
|
|
BooksFromAddisonWesley?
|
|
| Publisher |
Addison Wesley |
| BookList? |
PerlMedic? |
|
|
|
Now here is
BookForm? :
BookForm? is given to the following topics ( referenced by
BookList? ) :
BeautifulCode?
PerlHacks?
PerlMedic?
For each Publisher we would like to display a
BookList? of published books, and then each book's ISBN 's value.
Solution
Type this:
%SEARCH{ "^%META.*BookList.*value\=.*" topic="Books*" nosearch="on" multiple="on" nototal="on" web="%WEB%" type="regex" format=" * $topic $n$percntSEARCH{ search=\"^%META.*ISBN.*value\" topic=\"$formfield(BookList)\" type=\"regex\" multiple=\"on\" format=\" * $dollartopic : ISBN $dollarformfield(ISBN) \" nosearch=\"on\" nototal=\"on\" separator=\"$dollarn\" }$nop%" nosearch="on" separator="$n" nototal="on" }%
To get this :
- BooksFromOreilly?
- BeautifulCode? : ISBN 978-0-596-51004-6
- PerlHacks? : ISBN 978-0-59-652674-0
- BooksFromAddisonWesley?
- PerlMedic? : ISBN 978-0-201-79526-4
--
Contributors: OlivierThompson - 25 Aug 2008
Breaking up that long line makes it is easier to understand, which important to us cookbook readers.
It also makes it easier to see that you repeated a couple of terms.
%SEARCH{
"^%META.*BookList.*value\=.*"
topic="Books*"
nosearch="on"
multiple="on"
nototal="on"
web="%WEB%"
type="regex"
format=" * $topic $n$percntSEARCH{ search=\"^%META.*ISBN.*value\" topic=\"$formfield(BookList)\" type=\"regex\" multiple=\"on\" format=\" * $dollartopic : ISBN $dollarformfield(ISBN) \" nosearch=\"on\" nototal=\"on\" separator=\"$dollarn\" }$nop%"
nosearch="on"
separator="$n"
nototal="on"
}%
--
SeanCMorgan - 26 Aug 2008
Oops ! You're right
--
OlivierThompson - 26 Aug 2008