Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

Q&A

  1. We've been using elements such as <!DOCTYPE> and <!ELEMENT> today. Is it okay to use lowercase for these element names?

  1. No. You need to call them <!DOCTYPE> and <!ELEMENT>, not <!doctype> and <!element>. The capitalization is specified in the XML 1.0 specification, and XML processors accept only the versions in the XML 1.0 specification.

  1. Is there any way to create a mixed content model by using a DTD where you can mix both text data and elements on the same level (that is, as siblings), like this: <document>Here is an element:<element>Hello!</element></document>?

  1. Yes, you can use the ANY keyword. Beyond that, there's no way to do this. The XML 1.0 specification only allows you to create mixed content models by using choices, which means that in mixed content models, you can have either text data or elements, but not both at the same time (the elements themselves can contain text, of course).

  • + Share This
  • 🔖 Save To Your Account