← Prev in month ← Prev in thread

What does "equivalent" mean for empty elements?

From
Roger L Costello <>
To
"" <>
Date
2022-02-05T19:39:40Z
ID
<>
Thread
What does "equivalent" mean for empty elements?
Hi Folks,

By definition these two forms are equivalent:

	<A></A>
	<A/>

Suppose a parser processes the first form and produces, among other things, a series of pairs (token kind, token value). Upon encountering this:

	<A>

the parser produces:

	(START_TAG_NAME, "A")

Upon encountering this:

	</A>

the parser produces:

	(END_TAG_NAME, "A")

Should this:

	<A/>

result in the parser producing the same two pairs?

What does "equivalent" mean? 

Assertion: "equivalent" means both forms result in the parser producing the same two pairs:

	(START_TAG_NAME, "A")
	(END_TAG_NAME, "A")

Do you agree?

/Roger
← Prev in month ← Prev in thread