www.w3.org : XML 1.0 specification: talks about how the tags should appear etc. http://www.w3.org/TR/2000/REC-xml-20001006 The XML specification itself is also available in XML format. excerpts from that xml doc: ]>
Extensible Markup Language (XML) 1.0 (Second Edition) REC-xml-&iso6.doc.date; W3C Recommendation &draft.day;&draft.month; &draft.year; Note: &draft.day refers to constant string defined in DOCTYPE document data definition. The "" tag enables this document data type ??? there could be multiple doctypes in doc ??? .... &http-ident; -&iso6.doc.date; with color-coded revision indicators) Note: What is publoc ?? What is loc ?? It is left to the interpretation of the software which processes this document. However, these tags types are defined in xmlspec-v2.1.dtd : What is %p.pcd.mix ??? It is a class ENTITY which describes the types of component elements. Another example would be This indicates mybook should have these three elements. These 3 elements will define the component types elsewhere. #PCDATA is a reserved type. Anything which is not enclosed in tags like ... gets matched with #PCDATA. ednote.class is defined as: Note that this enables one to add the definition for ednote.class by indirectly defining local.ednote.class ENTITY in the inline DTD after including std DTD. More on this later. For example, locally local.ednote.class can be defined as a constant: "|myednote" ???? What is ednote ??? Note: In terms of parsing, there is no ambiguity since, any thing which is defined as element will have unambiguous prefix like " ......" What is "%" used for ? The % entities are called "parameter entities". They can be used only in DTD. The normal entity can be refered from doc also. They also have diff namespaces. i.e. there could be same two %mydefn and mydefn. They are diff. This is to avoid surprising collisions with doc defined constants. What is %common.att ? This supports optional attributes id, role, diff. It is defined as entities. This means ENTITY is nothing more than a #define mechanism: Note: What is ID, NMTOKEN ? Are they reserved words ?? Yes. what about "chg|add" etc. ? If the attribute value is not reserved word, then the litteral value will be taken as possible attribute value. Note: Similar to #IMPLIED (optional), #REQUIRED, there is #FIXED "fixvalue" which always defines the fixed attribute for the tags.
...
The whole xml specification doc (in .xml format) is enclosed in ... which is also name of the doctype. There is also a element defined in this DTD. Note that it is a validity requirement. Now let us look at xml specification itself: document ::= prolog element Misc* prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? XMLDecl ::= Misc ::= comment | PI PI(processing instn) ::= doctypedecl ::= markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl| PI | comment The Name in the document type declaration must match the element type of the root element. If an element wants to preserve white space, it can declare xml:space attribute as one of its attribute: e.g: Note: default, preserve are enumerated types. Note: In valid docs attribute should be declared if used. The language xml:lang can be defined to specify languages. eg.: The quick brown fox jumps over the lazy dog. Note: Attributes must be unique. Attribute value should not have "<" in the replaced text. Attribute must have been declared and must be of the type declared elementdecl ::= '' contentspec ::= 'EMPTY' | 'ANY' | Mixed | children #PCDATA -- Parsed character data. e.g. Attribute decln: [52] AttlistDecl ::= '' [53] AttDef ::= S Name S AttType S DefaultDecl [54] AttType ::= StringType | TokenizedType | EnumeratedType [55] StringType ::= 'CDATA' [56] TokenizedType ::= 'ID' | 'IDREF' [VC: IDREF] | 'IDREFS' [VC: IDREF] | 'ENTITY' [VC: Entity Name] | 'ENTITIES' [VC: Entity Name] | 'NMTOKEN' [VC: Name Token] | 'NMTOKENS' [VC: Name Token] Note: ID must be unique. ID must have declared default of #IMPLIED or #REQUIRED. Atmost one notation attribute could be defined for an element which is used to associate element with notation in DTD ???? Note: [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) REQUIRED means required. #IMPLIED means no default value and if the attribute not specified, then processor assumes no attribute. For #FIXED, there is default and default can't be changed. If none of #REQUIRED or #IMPLIED or #FIXED specified, default value should be provided-- XML processor would act as if the default value were provided even if not specified. e.g. The attribute value is passed with replacing entity references; the multiple spaces replaced by single space unless attrib type is CDATA All attributes for which no declaration has been read should be treated by a non-validating processor as if declared CDATA. Examples of external entities decln: Note: NDATA gif: The notation called "gif" must have been declared in DTD. what does it mean ???? char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */ legal characters are Unicode and ISO/IEC 10646. i.e. UTF-8, UTF-16 and 10646. What the hell is this ???? NmToken is a mix of letter, digits, -, _, ".", ":" The XML processor should accept ":" as part of name however, colon is also used for name spaces as recommended in XML spec. ???? How to use name spaces ? The namespace is just an unique URI which does not point to anything. It is just used for uniqueness. .... .... ... ... ... The attributes are either "Name space decln" or "attrib=value". The xmlns:xlink="..." declares a namespace. The decln: ..... declares default name space directly associated for this block. Note: At any context there is only one default name space. This is not nested. i.e. unqualified names are tied/searched in the single name space which is the default name space at that point. The disjoint name space partitions in any XML namespace is as follows: 1) All element type partitions. like x, y in etc. 2) All global attributes partition. How to declare this ???? 3) Per element type namespace partition. i.e. Note att1 in x and y are in different ns partition. If there is a global attribute att1 and also per element attribute "att1", do they conflict ???? How to associate a DTD with one namespace ? This is xml doc: .... In mydoc.dtd, you define the element type for mydoc: Then provide xmlns attribute for the root element with something like below: Now refering to the namespace selects the DTD. Since this also provides default ns, the xml doc which refers to dtd defn, does not have to specify xmlns tag. What is schema ? XML schema is an XML document which makes use of XML schema DTD to predefine a set of built in elements and types. This makes the parsing of an XML schema is easier and also it is easier to extend and define new types based on the standard schema document. w3c provides a standard .dtd schema doc. However anyone can create a schema defn from the scratch based on DTD specification and use it. XML schema dtd at w3.org : http://www.w3.org/2001/XMLSchema.dtd http://www.w3.org/2001/datatypes.dtd Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN" Namespace: http://www.w3.org/2001/XMLSchema What is XHTML ? It is more strict regular XML compatible HTML which lets you easily define your own tags based on existing tags. You just need to add your .dtd document to define your tags. The www.w3.org front page is in xhtml. The first few lines of this xhtml file: Example of xhtml new tag ?? XML SunVTS implementation: - should be simple xml. - can use non-validating parser. - Example xml file: Save options: vts_cmd save_genopt -[options] -v Enable verbose messages. -e Mark option file for exclusive load. This will deselect all tests first when the saved file is loaded. (i.e. By default generic option files are used for cumulative loads in sequence which will not deselect other tests before starting the load. This option will override that behaviour ) -a Save all machine specific options in generic option file format. Will only be used from command line. If stable will be used for option files as well. -n Do sanity check and display a report without really saving generic option file. GUI: Save Option File: Mutually exclusive bullets: Save all options for host (X) /* By default enabled. */ Save as host independent generic options ( ) Following list of options enabled only when Generic Options Format is enabled: Mark generic option file to : deselect all tests first ( ) Enable (X) Disable genoption_file ::= body body ::= vts_info? ( sysdefn | grpdefn | tstdefns | actdefns )* vts_info ::= sysdefn ::= opdefns grpdefn ::= (opdefns | tstops)* tstdefns ::= (opdefns | instdefns |devdefns)* devdefns ::= (opdefns|instdefns)* instdefns ::= (opdefns)* actdefns ::= opdefns ::=