[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to make REXML respect   (in 1.9

Phlip

11/8/2008 2:13:00 PM

Rubies:

This fails on the second line...

REXML::Document.new('<b>&amp;</b>')
REXML::Document.new('<b>&nbsp;</b>')

....with Undeclared entity '&nbsp;'

If I make that real XHTML, with a DOCTYPE and a html xmlns="...xhtml", it
still fails.

I fixed the &nbsp; itself by adding [<!ENTITY nbsp " ">] to the DOCTYPE.
This seems extremely tacky, because it disregards all the other fun stuff in
XHTML.

(I suspect REXML with 1.8 did not have this issue.)

If I should call Entity.new('nbsp', ' '), I don't understand how to .add
that before the call to .new, and I don't understand how to easily add new
HTML content to a preexisting Document object.

Any tips?

--
Phlip


1 Answer

David Tenner

10/12/2011 7:33:00 PM

0

Anthony Buckland <anthonybucklandnospam@telus.net> wrote in
news:i4GdnWLHzYIRWgjTnZ2dnUVZ_u-dnZ2d@giganews.com :

> On 10/10/2011 8:16 AM, David Tenner wrote:
>> ae597<althistorian@gmail.com> wrote in
>> news:53f880bd-8e42-4a55-9b57-22f8979dab9e@i28g2000yqn.googlegroups.com :
>>> In early 1950, the Soviet Union refused to seat a delegate on the U.N.
>>> Security Council in protest over the fact that the Republic of China
>>> (Taiwan) had a permanent seat on the council but the People's Republic
>>> of China (PRC) did not.
>>>
>>> The USSR had veto power on the council, a fact that would become
>>> vitally important in June of that year when North Korea invaded South
>>> Korea. With no Soviet delegate present, UN Security Council Resolution
>>> 84 received 7 "yes" votes with three nations abstaining. This vote
>>> gave international sanction for the defense of South Korea. But what
>>> if the Soviet delegate to the council had been present and had vetoed
>>> the resolution?..
>>>
>>> Article continues at
>>> http://www.todayinah.co.uk/index.php?sto...
>>>
>>
>> A Soviet veto IMO would have made very little difference because the US
>> would simply have gotten the General Assembly to pass the "uniting for
>> peace" resolution a few months earlier than it did in OTL.
>> http://groups.google.com/group/soc.history.what-if/msg/2eab9d...
>>
>
> Considering how things went in OTL, "very little difference"
> could easily have consisted of the complete takeover of the
> peninsula by the communist North. Once that happened,
> nothing short of nuclear war would ever have been of any
> help.
>

An emergency General Assembly meeting could be called very quickly, but
it's not as though Truman would think his hands were tied in the meantime,
anyway. He would presumably rely on Article 51 of the UN Charter [1]:

"Article 51 provides for the right of countries to engage in self-defence,
including collective self-defence, against an armed attack.

'Nothing in the present Charter shall impair the inherent right of
individual or collective self-defence if an armed attack occurs against a
Member of the United Nations, until the Security Council has taken
measures necessary to maintain international peace and security. Measures
taken by Members in the exercise of this right of self-defence shall be
immediately reported to the Security Council and shall not in any way
affect the authority and responsibility of the Security Council under the
present Charter to take at any time such action as it deems necessary in
order to maintain or restore international peace and security.'

"This article has been cited by the United States as support for the
legality of the Vietnam War. According to that argument, 'although South
Vietnam is not an independent sovereign State or a member of the United
Nations, it nevertheless enjoys the right of self-defense, and the United
States is entitled to participate in its collective defense'..."
http://en.wikipedia.org/wiki/Chapter_VII_of_the_United_Natio...

A General Assembly meeting would simply be useful in providing
retrospective justification for the intervention Truman had already
authorized. (Incidentally, Truman did not grant MacArthur's request to
transfer two whole divisions from Japan to Korea until June 30. What led
to this delay was not the lack of UN authorization--the Security Council
had acted--but simply that by then it was clear that lesser measures of
military assistance had failed. The authorization would probably have
been made at the exact same time in a Soviet-veto ATL, whether or not the
General Assembly had already met.)

Basically, when presidents are convinced there is an emergency and that
they cannot wait for some deliberative body to consider the mattter, they
act first and get retrospective justification--from Congress or the UN or
whoever--afterwards. (Compare with the way Congress in the summer of 1861
retrospectively ratified Lincoln's unilateral suspension of habeas corpus.)

[1] I do not of ocurse claim this as an original insight. See, e.g., John
W. Spanier in *The Truman-MacArthur Controversy and the Korean War* and
David Rees, *Korea: The Limited War.*
http://www.google.com/search?tbm=bks&q=%22if+the+soviet+union%22++%22invoked+art...

--
David Tenner
dtenner@ameritech.net