The prolog of an XML document is an optional special processing instruction at the top of the XML document (see the answer to "What's XML?" for more information). When it is included, the prolog must be the first entry (no leading whitespace, data, or markup) of the XML document. The prolog generally includes a version number, and can also include an encoding specifier. The version number indicates the version of the W3C XML recommendation that your XML document conforms to. The prolog can also include an encoding specifier. The encoding is generally ISO- 8859-1, UTF-8, WINDOWS-1252, or UTF-16. If specified, the encoding must match the character encoding used in the source XML data. For instance, if your source XML is Unicode (nvarchar in SQL) data, you can't use an 8-bit character encoding such as ISO-8859-1. Keep in mind that the prolog isn't required, but if it is included, it must match the source XML data's encoding.
XML allows you to mark up textual data, but it assigns special meaning to certain characters, such as the greater-than and less-than symbols (< and >). Entitizing is the process of converting these characters that have special meaning in XML to special codes known as entities. The less-than symbol (<), for instance, must be converted to the entity <. XML defines five predeclared XML entities, which all programs that process XML must recognize. In addition to these predeclared XML entities, you can use numeric character references to represent any character in your XML data. Numeric character references resemble entities with a decimal or hexadecimal character code. SQL Server's XML parser automatically expands XML entities when you retrieve XML data.
The XML standard supports a special construct known as a document type definition (DTD). In simple terms, the XML recommendation defines a DTD as a basic mechanism for constraining your XML structure and content. SQL Server supports a minimal subset of the DTD standard; specifically, you can use DTDs in your XML documents to declare your own user-defined entities. The CONVERT function accepts three parameters: the target data type (in this case xml), the source data (an XML document with DTD), and a third style parameter. The third parameter must be set to the number 2 or 3 when you want SQL Server to parse an XML document containing a DTD. First, the SQL Server XML parser replaces the XML entities in your document with the equivalent character data. Second, the SQL Server XML parser strips away the DTD when it has finished parsing the XML data. Finally, note that SQL Server doesn't natively support external DTDs, or DTDs that are stored outside of the current XML document.
Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.
Note: This article was sent to us by: Dale Olson at 01092010
1. Definitions and uses of functions in Python
All articles are property of their respective authors. Please read our Privacy Policy!
© 2009 ArticleInput.com.