Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 37 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
37
Dung lượng
533 KB
Nội dung
Schemas Chapter 5
Core XML / Chapter 5 / Slide 2 of 29Summary-1DOM stands for Document Object Model. It is a way by which, we can treat a document as an object, and extract information, make changes, and query the document through code. The three types of Document Models supported in XML are: Linear Model which is applied to static documents, Tree Model which is applied to dynamic documents and the Object Model where each and every element is considered as a object.The set of methods, which helps us to build complex documents from scratch, are called factory methods.
Core XML / Chapter 5 / Slide 3 of 29Summary-2XML DOM programming can be classified into two types of objects:•XML DOM Base Object•DOM ObjectsThe XML DOM Base Object is used to support namespaces, data types, XML Schemas, XSL operations, asynchronous loading and to save documents.DOM Objects are used to represent implementations of the XML DOM interfaces.The DOM Document object represents the top level of the XML source. It includes methods and properties used to obtain or to create all other XML objects.
Core XML / Chapter 5 / Slide 4 of 29Summary-3The object ‘XMLDOMNode’ extends the core XML DOM node interface. Most of the other DOM objects inherit the XMLDOMNODE object.The ‘XMLDOMNodeList’ object is a collection of nodes. Its methods allow us to iterate through all the children nodes of a node.The ‘XMLDOMNamedNodeMap’ objects can be accessed by an index. This index does not that the XML DOM specifies an order to these nodes. It is used to iterate through the attributes for a specific element.The ‘XMLDOMParseError’ object returns information about the last parse error. The information includes the error number, line number, character position, and a text description.The ‘XMLDOMAttribute’ object represents an attribute of an element. Attributes are properties of an element and not the child nodes of the element.
Core XML / Chapter 5 / Slide 5 of 29Summary-4The ‘XMLDOMCDATASection’ object represents the content of the CDATA section. The ‘XMLDOMDocumentType’ object contains information about all the entities and notations in a declared document type declaration of the XML file. The ‘XMLDOMEntity’ object represents a parsed or unparsed entity in the XML document. The XMLDOMEntity object represents the entity itself, rather than the entity declaration.The ‘XMLDOMProcessingInstruction’object represents a processing instruction. The content of the XMLDOMProcessingInstruction node is the entire content within the delimiters of the processing instruction (PI).
Core XML / Chapter 5 / Slide 6 of 29Summary-5The Simple API for XML (SAX) is a set of APIs for working with XML. SAX does not consume much memory. It is used frequently in server side applications, as it is fast. SAX Interfaces are used to provide support for various languages.DOM and SAX are the two most popular APIs for manipulating XML documents. The two APIs differ in their origination, scope and in programming style. Both the APIs have their own strengths and weaknesses.
Core XML / Chapter 5 / Slide 7 of 29ObjectivesDefine schemaDistinguish between a schema and DTDCreate schema using XML schema vocabularyIdentify the elements in an XML schemaDescribe validation and constraintsExplain element inheritance in an schema
Core XML / Chapter 5 / Slide 8 of 29SchemasSchemasRulesA model for a whole class of documentsOrganization1Organization2Common vocabularySchemasExchanging documents
Core XML / Chapter 5 / Slide 9 of 29Limitations of DTDDTDs are written in a non-XML syntax.DTDs are not extensible.They have no support for namespaces.They only offer extremely limited data typing.
Core XML / Chapter 5 / Slide 10 of 29XML Schema New FeaturesXML syntax is used as the basic for creating XML schema documentsXML schemas can be passed and manipulated just like any other XML document.Richer data typesArchetypesAttributes groupingRefinable archetypes
123doc.vn