Re: jade translates certain things to upper case

Subject: Re: jade translates certain things to upper case
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Tue, 15 Dec 1998 13:58:54 -0500
| Next problem was that my stylesheet frequently relied on
| things being upper case, as you both pointed out, e.g. I had 
| to adapt things like :
|         (attribute-string "ID" (current-node))).

If you want to adapt your stylesheet so that it's more forgiving, you
can use (normalize) to do the case folding:

      (attribute-string (normalize "id") (current-node)))

This will shift "id" to "ID" if NAMECASE GENERAL YES is in use, but
leave it "id" if NAMECASE GENERAL NO is in use.  This doesn't help
solve the problem caused by differing mixed case ("iD" vs "Id") when
NGN is in use, but there's not much you can do about that short of
fixing the instances.

For reference, here's (normalize):

(define (normalize str)
  ;; REFENTRY lib-normalize
  ;; PURP Normalize the str according to the SGML declaration in effect
  ;; DESC
  ;; Performs SGML general name normalization on the string;
  ;; used to compare attribute names and generic identifiers correctly
  ;; according to the SGML declaration in effect; this is necessary
  ;; since XML is case-sensitive but the reference concrete syntax and
  ;; many SGML DTDs are not.
  ;; /DESC
  ;; AUTHOR Chris Maden
  (if (string? str)
      (general-name-normalize str

Norman Walsh <ndw@xxxxxxxxxx>      | Those parts of the system that you                 | can hit with a hammer are called
                                   | hardware; those parts that you can
                                   | only curse at are called software.

 DSSSList info and archive:

Current Thread