RE: Indexing

Subject: RE: Indexing
From: "Harbarth, Juliane" <jhb@xxxxxxxxxxxxxx>
Date: Thu, 27 May 1999 15:39:48 +0200
Title: RE: Indexing

-----Original Message-----
From: Jakub Nosek [mailto:kuba@xxxxxxxxxxxxxxxxxxx]
Sent: Thursday, May 27, 1999 11:14 AM
To: DSSSL List
Subject: Indexing

> I would to like to create index for my elements in the page, but I don't
> know how.
> E.g. if I have
>  <NAME>Bill Clinton</NAME>
>  <TEXT>and</TEXT>
>  ...

Complete your example to a well-formed XML document, e.g.
        <?xml version="1.0" encoding="ISO-8859-1"?>
        <NAME>Bill Clinton</NAME>

and try the following DSSSL :

<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")
(element index
        (make element gi: "HTML"
                (make sequence
                        (make element gi: "HEAD"
                                (make element gi: "TITLE"
                                        (literal "Index")))
                        (make element gi:"BODY"
                                (make sequence
                                        (literal "INDEX of famous people")
                                        (make-names-list (current-node))
(element name
(element text
(define (make-names-list nd)
         ((names (select-elements (children (current-node)) (list 'NAME))))
         (make element
          gi: "OL"
                (process names))))
(define (process nl)
        (if (node-list-empty? nl)
                (make sequence
                        (make element
                         gi: "LI"
                                (literal (data (node-list-first nl))))
                        (process (node-list-rest nl)))))


Current Thread
  • RE: Indexing
    • Harbarth, Juliane - Thu, 27 May 1999 10:16:21 -0400 (EDT) <=