🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.sgml
Article #552

Re: Short Ref's Reparsed?

#552
From: Erik Naggum
Date: Mon, 24 Jun 1991 23:38
65 lines
2684 bytes
I wrote (despite the indent which looks like a quotation):
|
|    a corollary is that translation from short references to entity
|    references may modify the contents of entities referred to in the
|    replacement text of the entity referenced by the short reference,
|    according as the replacement text contains short reference
|    delimiters, demanding multiple versions of entities according to
|    context. 
|
| This seems to defeat the purpose of the simple translation, and I can
| readily foresee problems in this regard.

Jonathan Rosenberg <jxr@thumper.bellcore.com> responds:
|
|   Ugh.  This appears to be impossibly complicated.  Can this really happen?

I think my example with # for number and # for pounds shows that it
can get this complicated:

	<!ENTITY issue "Vol 5 #6">
	<!ENTITY pounds SDATA "[libra]">
	<!SHORTREF map "#" pounds>

	&issue;
	<!USEMAP map>
	&issue;

Conversion to a system without short references is left as an exercise
for the reader...

|   It is if I understand it correctly.  Are you saying that the following
|   "works correctly":
|
|	    <!ENTITY aaa CDATA "aa">
|	    <!ENTITY aa CDATA "a">
|	     <!SHORTREF map "aaa" aaa>
|	     <!SHORTREF map "aa" aa>
|
|   "Correctly" in the sense that the string
|	    aaa
|   would become simply
|	    aa
|   ??

Yes.

|   And, that the reason for this is is CDATA indicates that the
|   replacement string is unparseable character data?

Well, not exactly "unparseable" :-), but at least it will not be
treated as potential markup, just as data.  Specifically, if you need
to have markup characters in the text, you could do it like this:

	<!ENTITY tag CDATA "<tag>">

|   P.S.  Now I see why you use "|" instead of ">" in replying.

Well, it's actually because I think it looks better (and it's
different from everybody else's conventions).

</Erik>
--
Erik Naggum             Professional Programmer            +47-2-836-863
Naggum Software             Electronic Text             <erik@naggum.no>
0118 OSLO, NORWAY       Computer Communications        <enag@ifi.uio.no>
Technical Details
Message-ID: <ENAG.91Jun25013811@gyda.ifi.uio.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!sics.se!ifi.uio.no!enag
References: <489@salt.bellcore.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!sics.se!ifi.uio.no!enag
From: enag@ifi.uio.no (Erik Naggum)
Newsgroups: comp.text.sgml
Subject: Re: Short Ref's Reparsed?
Message-ID: <ENAG.91Jun25013811@gyda.ifi.uio.no>
Date: 24 Jun 91 23:38:14 GMT
References: <489@salt.bellcore.com>
Sender: enag@ifi.uio.no (Erik Naggum)
Organization: Naggum Software, Oslo, Norway
Lines: 65
Nntp-Posting-Host: gyda.ifi.uio.no
In-Reply-To: jxr@thumper.bellcore.com's message of 24 Jun 91 16: 47:29 GMT
Originator: enag@gyda.ifi.uio.no