... This means two same start tags, but one single end tag... H" /> ... This means two same start tags, but one single end tag... H" /> ... This means two same start tags, but one single end tag... H"/>

How to have multiple same start tags but single end tag?

259 Views Asked by At

So I have an .XML file which has a start tag

abc "some text">  <abc "some text" > </abc>... 

This means two same start tags, but one single end tag...
How's this possible?

2

There are 2 best solutions below

0
zx485 On

It's not possible, it's invalid markup.

Every tag has to be closed in XML!
(Except for processing instructions - which are not considered to be "tags").

0
kjhughes On

All start tags must have matching end tags in XML. Your textual data is not XML if this property is untrue.

Note that your example has two other problems:

  1. The < on the first abc opening tag is missing.
  2. "some text" must be preceded by an attribute name and an = character.

So, this would be well-formed (meets the requirements for being XML):

<abc d="some text">  <abc d="some text" > </abc></abc>

For further details on what well-formed means, see Well-formed vs Valid XML.