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

后端 未结 3 1068
终归单人心
终归单人心 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条回答
  •  醉梦人生
    2021-01-20 08:21

    I think it's best to reserve mixed content for one purpose only: to annotate (or "mark-up") sections of natural language text. So a good test to apply is, does the text still make sense if the markup is removed?

    In your example, my only criticism would be that if you remove the markup, what's left isn't grammatical: it's missing a full-stop after the first sentence.

提交回复
热议问题