Re: Using SUBDOCs

Subject: Re: Using SUBDOCs
From: Alexander Taranov <tay@xxxxxxxxxx>
Date: Thu, 15 Oct 1998 11:15:53 +0400 (MSD)
Chuck, below is full toy example
It is assumed that master doc contains    
  <docref ref="some-entity">
and "some-entity" is docbook ARTICLE.

result is -- identical transformation of master doc
and substitution in place of docref 
<ARTICLE-TITLE>..whatever title is</ARTICLE-TITLE>

-------------- cut here --------------------------------------

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

  <style-specification id="main" use="ext-defs ident">

(default (same-element))

 (let ((file (entity-system-id (attribute-string "ref"))))
  (with-mode mk-xref
	      (sgml-parse file)))))

;;;;;;;;;;;;;; subdoc processed here ;;;;;;;;;;;;;;
;; it is toy subdoc processing
;; it just extracts from ARTICLE its title  and inserts it into
;; main doc

(mode mk-xref
  (default (empty-sosfo))

  (element ARTICLE
  (element ARTHEADER (process-children))
  (element TITLE (make element
			   gi: "ARTICLE-TITLE" ;; just for example

  <style-specification id="ident" use="ext-defs">
(define (copy-attributes #!optional (nd (current-node)))
  (let loop ((atts (named-node-list-names (attributes nd))))
    (if (null? atts)
        (let* ((name (car atts))
               (value (attribute-string name nd)))
          (if value
              (cons (list name value)
                    (loop (cdr atts)))
              (loop (cdr atts)))))))

(define (same-element #!optional (nd (current-node)))
  (make element
	gi: (gi nd)
	attributes: (copy-attributes nd)))
  <style-specification id="ext-defs">
(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 document-type
  "UNREGISTERED::James Clark//Flow Object Class::document-type")
(declare-flow-object-class processing-instruction
  "UNREGISTERED::James Clark//Flow Object Class::processing-instruction")
(declare-flow-object-class entity
  "UNREGISTERED::James Clark//Flow Object Class::entity")
(declare-flow-object-class entity-ref
  "UNREGISTERED::James Clark//Flow Object Class::entity-ref")
(declare-flow-object-class formatting-instruction
  "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")
(declare-characteristic preserve-sdata?
  "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"

 DSSSList info and archive:

Current Thread