Subject: Case independence and (case) From: Chris Maden <crism@xxxxxxx> Date: Fri, 17 Apr 1998 12:56:41 -0400 |
I'm returning to the HTML table stylesheet I released last October, trying to make it independent of the SGML declaration in effect (so that it's usable with XML, for instance). DSSSL automatically normalizes the GI in the element construction rules, but most other string comparisons are case sensitive; comparing GIs or attribute name token values, or looking for ancestors or attributes is case sensitive. I'm using (general-name-normalize) to make this independent of the declaration: (if (equal? (gi (current-node)) (norm "colgroup")) ... where (define (norm str) (general-name-normalize str (current-node))) However, I use a lot of (case) statements on attribute values, where the value is a name token. The case keys are defined as _datum_, which means that I can't use an expression. How can I do something like (case (attribute-string (norm "align") (current-node)) (((norm "left") 'start)) (((norm "center") 'center)) (((norm "right") (norm "char") 'end)) (((norm "justify") 'justify)) (else (inherited-quadding))) except without an expression and in a case-independent way? The attribute value has already been normalized, but I don't know to what. With the reference concrete syntax, it'll be all-caps, but with XML it'll be exactly as entered or as defaulted in the DTD. -Chris -- <!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN"> <!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN" "<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487 <USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek> DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
FOT -> tex/html stylesheet, Daniel Wang | Thread | Re: Case independence and (case), Henry S. Thompson |
FOT -> tex/html stylesheet, Daniel Wang | Date | (case) correction, Chris Maden |
Month |