GrayR
GrayR

Reputation: 1385

Benefits of XML character data outside of tag

This question is based on my previous one.

I belive we are all used that data in xml is located between tags, like:

<root>
  <tag>useful text</tag>
</root>

But following xml is also valid:

<root>
  <tag>useful text</tag> more text
</root>

Usually you don't see this too often in real life. Can you please give me several examples of usage and benefits which this xml's feature gives?

Upvotes: 0

Views: 303

Answers (1)

Dog Ears
Dog Ears

Reputation: 10005

Without this things such as XHTML wouldn't be possible.

A complete valid XHTML example:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head><title>Zebra</title></head>
   <body>
     <div><h1><em>useful</em> text more text</h1></div>
   </body>
 </html>

Upvotes: 2

Related Questions