Posted on May 18, 2007 by sharat
A document type definition (DTD) describes the permissible tags of an XML document.
The DTD serves as a data template. It defines entities, elements, attributes, and notations, as well as the relationships between these.
For example, the DTD can state that a memo element consists of To, From, Subject, and Message elements.
You need to use a DTD [...]
Filed under: XML | 1 Comment »
Posted on May 18, 2007 by sharat
Schemas are becoming more popular and DTDs less so. A schema is an XML-based syntax for describing how the XML document is marked up or how it looks – very similar to a DTD, but a DTD has a lot of drawbacks.A DTD doesn’t use anything like XML syntax to describe the definition. You can’t [...]
Filed under: XML | Leave a Comment »
Posted on May 18, 2007 by sharat
An XML namespace is a collection of element names or attribute names to be defined within an XML document.Let’s say you have an invoice XML document and an order XML document and you want to put them together. You usually have certain names that overlap each other – like the date. You might have an [...]
Filed under: XML | Leave a Comment »
Posted on May 18, 2007 by sharat
XML is free form which means that you can configure it any way you want. It’s also very easy to read – you don’t have to read cryptic code to figure it out.It was designed specifically for internet protocols, and this makes it simple to transmit an XML document across, for example, a HTTP protocol.Strong [...]
Filed under: XML | 1 Comment »
Posted on May 18, 2007 by sharat
XML Schema
DTD
Markup validation
Any global element can be root. No ambiguous content support.
Can specify only the root element in the instance document. No ambiguous content support.
Namespace support
Yes. Declarations only where multiple namespaces are used.
No.
Code reuse
Can reuse definitions using named types.
Poorly supported. Can use parameter entities.
Datatype [...]
Filed under: XML | 7 Comments »
Posted on May 18, 2007 by sharat
They are not written in XML syntax, which means you have to learn a new syntax in order to write them
there is no support for namespaces
there are no constraints imposed on the kind of character data allowed, so datatyping is not possible
there is minimal support for code modularity and none for inheritance
large DTDs are hard [...]
Filed under: XML | Leave a Comment »
Posted on October 9, 2006 by sharat
Attributes are simple name/value pairs associated with an element.
They are attached to the start-tag, as shown below, but not to the end-tag:
<name nickname=”sharat”><first>sharat</first><middle></middle><last>lastname</last></name>
Attributes must have values–even if that value is just an empty string (like “”)–and those values must be in quotes.
Attributes Can Provide Meta Data that May Not be Relevant to Most Applications Dealing [...]
Filed under: XML | 1 Comment »
Posted on October 9, 2006 by sharat
XML documents must adhere to following rules to be well-formed.
Every start-tag must have a matching end-tag, or be a self-closing tag
Tags can’t overlap
XML documents can have only one root element
Element names must obey XML naming conventions
XML is case-sensitive
XML will keep whitespace in your text
Filed under: XML | Leave a Comment »
Posted on September 27, 2006 by sharat
SAX
DOM
Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation.
Parses node by node
Stores the entire XML document into memory before processing
Doesn’t store the XML in memory
Occupies more memory
We cant insert or delete a node
We can insert or delete [...]
Filed under: XML | 38 Comments »
Posted on September 26, 2006 by sharat
XML
HTML
User definable tags
Defined set of tags designed for web display
Content driven
Format driven
End tags required for well formed documents
End tags not required
Quotes required around attributes values
Quotes not required
Slash required in empty tags
Slash not required
Filed under: XML | 3 Comments »