Is it wrong in XML to have element nodes as siblings of text nodes?

后端 未结 3 1097
终归单人心
终归单人心 2021-01-20 07:42

Is the following \"allowed\" or simply bad use of XML? I cannot find restrictions on this, but it feels a bit weird.


    You can choose from
         


        
3条回答
  •  Happy的楠姐
    2021-01-20 08:09

    No, mixing elements and text is completely normal in XML.

    You may be more familiar with data-oriented uses of XML, but XML actually evolved from a basis in representing documents, where marking up text within other text is the norm. Its predecessor, SGML, was like this, and HTML is still like this today.

    In XML Schema (XSD), mixed="true" designates mixed text in a content model.

提交回复
热议问题