Home>

I'm new to programming.

How can xml make sense?

For example, in the case of HTML, tags such as
andthemselves have white space and the body of the document, but xml can be freely assigned to elements and attributes by
I learned that it can be set like this.

However, with this alone, you can decide the elements and attributes as you like, conversely, you can just name them, and the elements and attributes that you decide are HTML, as I mentioned earlier Isn't the tag itself meaningful? How do you use it?

Even if you think of it, you can search for tags in the xml file to find out what kind of data is available. I feel like that.

I'm currently studying app development at android studio, but since this describes the app layout in xml, it definitely has some meaning and is being processed accordingly I think.

Are you going to use something that makes sense in xml, like a compiler?

If so, I would like to know what kind of processing is done on attributes and elements. Is there such information in libraries and documentation?

I didn't know even if I looked it up and asked a question here
I'm sure there are some things that don't come true, but thank you.

※ Additional
Thank you very much for your answers.
Since tanat's answer fell to the most trap, I decided to be the best answer.

Error message
Error message
Applicable source code
Source code

Please describe what you tried for the problem here.

Supplemental information (FW/tool version etc.)

Please provide more detailed information here.

  • Answer # 1

      

    I'm currently studying app development at android studio, but since this describes the app layout in xml, it definitely has some meaning and is being processed accordingly I think.

      

    Are you going to use something that makes sense in xml, like a compiler?

    It is the specifications and definitions related to XML that make XML meaningful.
    The final implementation will be implementation within the application.

    A common flow is

    Parsing XML with a parser that allows the language to handle it as an object or array (at this point, it does not interpret the meaning of XML, but parses it mechanically according to the XML grammar)

    Application uses parsed data according to specification (interpretation and execution of XML semantics here)
    It is a flow. (1 and 2 may be executed at the same time.)

      

    If so, I would like to know what kind of processing is done on attributes and elements. Is there such information in libraries and documentation?

    In this case

    Android Developers Docs guide Layout resource

    Is it

    ?
    I think there are many cases that exist as documents of applications that use XML.

  • Answer # 2

    You can write programs that are resistant to change.

    For example, if the character string "ABC" is embedded everywhere in the code of several hundred lines,
    Suppose you want to rewrite this as "XYZ".

    If you have written directly in the code, you must rewrite all ABCs to XYZ.
    It is troublesome and leaks because of people.

    However, if you are coding in the form of acquiring XML elements, you can change everything in the code simply by rewriting the XML elements.