Answer the question
In order to leave comments, you need to log in
What are xml files?
In my work, I have come across several "kinds" of XML files.
For example:
<?xml version="1.0" encoding="windows-1251"?>
<ROOT>
<REC VALUE="ONE" CODENAME="T21" DATE="01.05.2019" NEWDATE="31.12.2021"/>
<REC VALUE="TWO" CODENAME="D37" DATE="08.01.2014" NEWDATE="31.12.2021"/>
</ROOT>
<?xml version="1.0" encoding="Windows-1251"?>
<NEW_LIST>
<ZAGOLOVOK>
<VERSION>1.0</VERSION>
<DATE>09-01-2020</DATE>
</ZAGOLOVOK>
<SUMMARY>
<NUMBER>34550677</NUMBER>
<YEAR>2015</YEAR>
</SUMMARY>
<RECORD>
<NUMBER_RECORD>1</NUMBER_RECORD>
<SUBNUMBER>0</SUBNUMBER>
<CLIENT>
<ID_CLIENT>904-374-395-424</ID_CLIENT>
<POL>1</POL>
</CLIENT>
<CASE>
<CASE_NUMBER>18534026</CASE_NUMBER>
<OK>1</OK>
<C_TYPE>1</C_TYPE>
<C_POD>22</C_POD>
<IDNUM>566743434</IDNUM>
<TURN>
<IDTURN>5680</IDTURN>
<TVAL>6676766669</TVAL>
<DONE>1</DONE>
</TURN>
</CASE>
</RECORD>
</NEW_LIST>
Answer the question
In order to leave comments, you need to log in
Both of the examples you've given are valid and not something separate and isolated - both have both root elements and tags (in the first - empty with attributes, in the second - initial without attributes and end).
XML has its own standard: in an element, attributes can only be used in the start tag and the empty element tag. In your examples: in the first - empty tags have attributes, in the second there are no attributes - simply because they are not needed. Just read about XML - attributes there have the same meaning as in HTML: not every tag in HTML must have an attribute - they put it where it is needed by the task.
Those. if extrapolated to HTML, then your question looks like this and looks strange:
What are HTML files?
Here is example 1
<p>
<img src="example.gif" alt="example" style="width:42px;height:42px;" />
</p>
<table>
<tr>
<th>Имя</th>
<th>Фамилия</th>
<th>Возраст</th>
</tr>
</table>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question