|
Subject: Re: Problem : search and sort From: Jany Quintard <quintard.j@xxxxxx> Date: Fri, 12 May 2000 09:42:15 +0200 (CEST) |
nOn Thu, 11 May 2000, Hans Eberle wrote:
> Hi all,
>
> I hope anybody could help me.
> I have a sgml-tree....
>
> <DOC>
> <MAIN>
> <PH>
> <WERK>
> <ANZ>1</ANZ>
> .../...
> </PH>
> </MAIN>
> </DOC>
>
> I'm looking for a function in a kind of this
> (get-sort-subtree (current-node) "PH/WERK" "ANZ" "SONW/#ANKER")
.../...
Here is the beginning of an answer :
> - only the nodes under the current-node and PH/WERK
This can be achieved using
(select-elements (descendants (current-node)) '("PH" "WERK"))
which returns a node-list comprising elements in the subtree with WERK as
gi and whose parent's gi is PH.
See the specification
10.2.5. SGML Property Operations
> - unique SONW ANKER
For this, I should compare each node in the the node list with the
following ones and copy it to a second list if there is no match. But
there may be other (and probably better) methods.
> - sort by ANZ
I don't know.
> This function should return thr follow nodelist :
> <WERK>
> <ANZ>1</ANZ>
> <SONW ANKER="LNK#21">
> <BENENNUNG>blabla</BENENNUNG>
> </SONW>
> </WERK
> <WERK>
> <ANZ>1</ANZ>
> <SONW ANKER="LNK#33">
> <BENENNUNG>jojo</BENENNUNG>
> </SONW>
> </WERK
> <WERK>
> <ANZ>2</ANZ>
> <SONW ANKER="LNK#16">
> <BENENNUNG>blabla</BENENNUNG>
> </SONW>
> </WERK
>
Hope it helps.
Jany.
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Problem : search and sort, Hans Eberle | Thread | sgml-parse question, Kathie Drake |
| Re: sgml-parse question, Brandon Ibach | Date | Output a line-break in an ASCII fil, Jany Quintard |
| Month |