Subject: RE: The menu experiment From: "Didier PH Martin" <martind@xxxxxxxxxxxxx> Date: Thu, 28 Jan 1999 20:02:53 -0500 |
HI Peter, I modified the root to element to: (root (sosofo-append (make document-type name: "HTML" public-id: "-//W3C//DTD HTML 4.0" ) (make element gi: "HTML" (process-children)))) And this generates: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0"> <HTML> ... </HTML> -----Original Message----- From: owner-dssslist@xxxxxxxxxxxxxxxx [mailto:owner-dssslist@xxxxxxxxxxxxxxxx]On Behalf Of Peter Nilsson Sent: Thursday, January 28, 1999 10:39 AM To: dssslist@xxxxxxxxxxxxxxxx Subject: RE: The menu experiment On Wed, 27 Jan 1999, Didier PH Martin wrote: > I works! I now have exactly the same output as the XSL script. I modified > two rules > > (element description > (make element > gi: "DIV" > attributes: '(("STYLE" > "margin-left:20px;margin-bottom:1em;font-size:10pt;")) > (make sequence > (process-children) > (process-node-list (select-elements (children (parent > (current-node))) "calories" ))))) > > (element calories > (make element > gi: "SPAN" > attributes: '(("STYLE" "font-style:italic")) > (literal " (") > (process-children) > (literal " calories per serving)") )) > Here is another modified version of your style sheet. This one might be clearer. Instead of taking the parens child named calories in the rule for the description, I make the DIV element in the food rule. I think this is more straight forward to read. (BTW I added a document-type, which makes the generated markup more HTML-compliant.) The style sheet: <!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 document-type "UNREGISTERED::James Clark//Flow Object Class::document-type") (root (make sequence (make document-type name: "HTML" public-id: "-//W3C//DTD HTML 4.0") (make element gi: "HTML" (process-children)))) (element breakfast-menu (make element gi: "BODY" attributes: '(("STYLE" "font-family:helvetica,sans sherif;font-size:12pt;background-color:#EEEEEE")) (process-children))) (element food (make display-group (make element gi: "DIV" attributes: '(("STYLE" "background-color:teal;color:white;padding:4px")) (process-matching-children "name") (literal " - ") (process-matching-children "price")) (make element gi: "DIV" attributes: '(("STYLE" "margin-left:20px;margin-bottom:1em;font-size:10pt;")) (process-matching-children "description") (process-matching-children "calories")))) (element name (make element gi: "SPAN" attributes: '(("STYLE" "font-weight:bold;color:white")) )) ;; Is the following really necessary? (element price (make sequence)) ;; The rule for description is removed. (element calories (make element gi: "SPAN" attributes: '(("STYLE" "font-style:italic")) (literal "calories per serving") (process-children))) Regards, /Peter Nilsson -- '(?P . (?e . (?t . (?e . (?r))))) DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: The menu experiment, Didier PH Martin | Thread | Announcement, Didier PH Martin |
RE: The menu experiment, Didier PH Martin | Date | Problem with Docbook style sheets, Didier PH Martin |
Month |