|
Subject: Re: Accessing declared value of attribute in Jade From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx> Date: Tue, 7 Oct 1997 16:19:01 -0400 (EDT) |
At 7 Oct 1997 15:42 -0400, Daniel Speck wrote:
> (define (generate-data-entity-declaration entity-node)
> (let* ((entity-name (node-property "name" entity-node))
> (entity-extid (node-property "external-id" entity-node))
> (entity-sysid (node-property "system-id" entity-extid default: #f))
> (entity-pubid (node-property "public-id" entity-extid default: #f))
> (entity-notation (node-property "notation" entity-node))
> (entity-notation-name (node-property 'name entity-notation))
> )
> (string-append
> "<!ENTITY "
> entity-name
> (if entity-pubid
> (string-append " PUBLIC \"" entity-pubid "\"")
> "")
> (if entity-sysid
> (string-append " SYSTEM \"" entity-sysid "\"")
> "")
> " NDATA " entity-notation-name
> ">&#RE;")))
An external identifier should include either the "PUBLIC" or "SYSTEM"
syntactic literal, but not both. To modify your procedure slightly:
(define (generate-data-entity-declaration entity-node)
(let* ((entity-name (node-property "name" entity-node))
(entity-extid (node-property "external-id" entity-node))
(entity-sysid (node-property "system-id" entity-extid default: #f))
(entity-pubid (node-property "public-id" entity-extid default: #f))
(entity-notation (node-property "notation" entity-node))
(entity-notation-name (node-property 'name entity-notation))
)
(string-append
"<!ENTITY "
entity-name
(if entity-pubid
(string-append " PUBLIC \"" entity-pubid "\"")
"")
(if entity-sysid
(string-append
(if (not entity-pubid)
" SYSTEM"
"")
" \"" entity-sysid "\"")
"")
" NDATA " entity-notation-name
">&#RE;")))
This procedure doesn't handle SUBDOC, CDATA, or SDATA entity types, so
it is not (yet) universally useful.
Regards,
Tony Graham
=======================================================================
Tony Graham
Mulberry Technologies, Inc. Phone: 301-315-9632
17 West Jefferson Street, Suite 207 Fax: 301-315-8285
Rockville, MD USA 20850 email: tgraham@xxxxxxxxxxxxxxxx
=======================================================================
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: Accessing declared value of att, Daniel Speck | Thread | Re: Accessing declared value of att, G. Ken Holman |
| Re: Accessing declared value of att, Daniel Speck | Date | Re: Accessing declared value of att, G. Ken Holman |
| Month |