Subject: (dsssl) Sibling issues From: tmcd@xxxxxxxxx Date: Mon, 12 May 2003 16:10:20 -0400 (EDT) |
In my XML, an item header (indented out 0.5in) is followed by a sequence of paragraphs (flush left) and blockquotes (indented, and can contain multiple paragraphs). I want a "space-before: 0pt" on a paragraph if either A: this is the first child of its parent. It's either the first paragraph of an item or the first paragraph of a blockquote. Either way, that means it's indented 0.5in more than the preceding text, so it doesn't need space-before to set it off visually. B: the preceding sibling of the current node is a <blockquote>, which indents. Therefore, this paragraph is indented -0.5in from the preceding (blockquoted) paragraph, so as with A, it is already visually distinguishable. Otherwise, I want "space-before: 5pt". Do I understand right that test A is (= (child-number (current-node) 1) (I'm pretty sure of that) and test B is either (string=? (gi (ipreced (current-node))) "blockquote") or (match-element? 'blockquote (ipreced (current-node))) ? I'm weak on sibling issues. ============================================================ While I'm here, can anyone explain the rsiblings function in English? Note that by "explain ... in English", I exclude the text in the DSSSL standard, which I can't understand at all. (rsiblings nl) Returns the mapping over nl of the function on a node that returns the reflexive siblings of the node, where the reflexive siblings of a node are defined to be the value of the origin-to-subnode relationship property of the node(Bs (Borigin, if the node has an origin, and otherwise the node itself. This could be defined as follows: (define (rsiblings nl) (node-list-map (lambda (snl) (let ((rel (origin-to-subnode-rel snl))) (if rel (node-property rel (origin snl) default: (empty-node-list)) snl))) nl)) Also, the standard uses "(siblings ...)" in the definition of functions ipreced, ifollow, preced, and follow. It doesn't define it anywhere. What is the siblings function, and does it differ from rsiblings? -- Tim McDaniel, tmcd@xxxxxxxxx; tmcd@xxxxxxxxxx is my work address DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: (dsssl) Superscripts, Dan Richter | Thread | (dsssl) width of table-columns, Ronald_Roessgen |
Re: (dsssl) Superscripts, Dan Richter | Date | (dsssl) width of table-columns, Ronald_Roessgen |
Month |