Re: The DSSSList Digest V4 #71

Subject: Re: The DSSSList Digest V4 #71
From: Kathie Drake <KDrake@xxxxxxxxxxxxx>
Date: Fri, 27 Oct 2000 17:51:54 -0700

One answer for the multiple file output:


I could not read your sample outputs, but what I understand is that you want separate pages with text and an index that will hyperlink to them. Also you would like the file names to be generated rather than hard coded. I modified your input file slightly so it would be easier to see what output went where.

The dsl will create three files: a1.htm, a2.htm and index.htm.
It should give you a pretty good idea of how to do multiple output files

Kathie Drake
kdrake@xxxxxxxxxxxxx

Input:
<?xml version='1.0' encoding="ISO-8859-2"?>
<root>
  <a>
    <b>text 1</b>
    <b>text 2</b>
  </a>
  <a>
    <b>text 3</b>
    <b>text 4</b>
  </a>
</root>

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

(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")
(declare-flow-object-class empty-element
  "UNREGISTERED::James Clark//Flow Object Class::empty-element")
(declare-flow-object-class entity
  "UNREGISTERED::James Clark//Flow Object Class::entity")

(root (make simple-page-sequence
          input-whitespace-treatment: 'collapse
          (make scroll)))

(mode getContents
(element root
(process-children))
(element a
(make sequence
(make entity
system-id: (string-append (gi (current-node)) (number->string(child-number(current-node))) ".htm")
(make element gi: "html"
(process-children)))


))

    (element b
       (make sequence
          (make element gi: "p"
             (literal (data(node-list-first(current-node))))
          )
          (make empty-element gi: "br")
       )
    )

)
(mode getOtherOuput
   (element root
      (make sequence
         (make entity
            system-id: "index.htm"
            (make element gi: "html"
            (process-children)))

))
(element a
(make sequence
(make element gi: "a"
attributes: `(("href" ,(string-append(gi(current-node))
(number->string(child-number(current-node))) ".htm")))
(literal "link " (number->string(child-number(current-node)))))
))
(element b
(empty-sosofo))


)

(element root
   (make sequence
      (with-mode getContents (process-node-list(current-node)))
      (with-mode getOtherOuput (process-node-list(current-node)))
   )
)
(element a
   (empty-sosofo))
(element b
   (empty-sosofo))





DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist


Current Thread