Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Tag start is not closed" when commenting inside XML element's start and end tag

<!-- Comment --> is the way to add comments in an XML file. Doesn't that actually means, that this part is not "compiled"?

However, when I do something like this:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error "Tag start is not closed". Why?

like image 609
user3801167 Avatar asked Sep 07 '14 21:09

user3801167


People also ask

Does XML have a closing tag?

All XML Elements Must Have a Closing Tag This is not an error.

How do you end a tag in XML?

The end tag functions exactly like a right parenthesis or a closing quotation mark or a right curly brace. It contains no data of its own; it simply ends the most recent (innermost) tag with the same name. XML requires a matching end tag for each start tag.

What is start tag in XML?

XML data is a serial stream. The start tag informs the receiving software that all the incoming data will belong to this element until the matching end tag is encountered. Very often, more start tags are encountered before the end tag.


1 Answers

Comments are not allowed inside tags. You have to close the tag first with ">" or "/>" and then you can add your comment there.

like image 102
Miro Lehtonen Avatar answered Jan 05 '23 11:01

Miro Lehtonen