《XML技术实务教材课程》由会员分享,可在线阅读,更多相关《XML技术实务教材课程(45页珍藏版)》请在金锄头文库上搜索。
1、XML技術實務,郭譽申 中央研究院 資訊科學研究所,Outline,XML XML Schema DOM and SAX XPath XSLT XQuery Web Service/SOA WS-BPEL Conclusion,XML Document, 郭譽申 Y. S. Kuo 博士 中央研究院 ,XML Characteristics,Coding Standard Flexible Data Structures Documents and Data Content and Presentation Separation Declarative Schemas XML Vocabula
2、ries XHTML, RosettaNet, UBL, Biztalk, Data Interchange/System Integration,XML Schema ,Element/Attribute Declarations,Element Declaration Taipei Attribute Declaration Global/Local,Data Types,Value Space Lexical Space Literals, e.g. 100, 1.0E2 Facets Aspects that characterize a value space Fundamental
3、 Facets, e.g. equal, order, Constraining Facets, e.g. length, pattern, ,Data Types,Simple Type Atomic/List/Union Complex Type Primitive Type Derived Type List, Union, Restriction, Extension Built-In (44)/User-Derived Type,Complex Types,Derivation by Extension Add element and attribute declarations D
4、erivation by Restriction Put constraints on element and attribute declarations, , , ,Complex Types,Simple Content Only Text and Attributes, No Element Complex Content Mixed Content Empty Content,Simple Types,Derivation by Restriction Constraining Facets length, minLength, maxLength min(max)Inclusive
5、, min(max)Exclusive totalDigits, fractionDigits pattern enumeration whiteSpace,Defining myInteger, Range 10000-99999 ,Using the Enumeration Facet ,Derivation by List, ,Derivation by Union, ,Conclusion,XSD is much richer in semantics than DTD. XSD appears like the declaration part of a programming la
6、nguage. XSD is not hard to learn. XSD is recommended by W3C. XSD will be the standard.,XML Schema versus DTD,Type Systems Built-In Types Type Derivation Content Model Mixed Content Element Occurrences Wildcards Semantic Constraints XSD is much richer in semantics than DTD.,Document Object Model (DOM
7、),Simple API for XML (SAX),XML Document Parsing Document input as stream Events startElement, endElement, Event Handling,XPath,Language for Addressing Parts of an XML Document Declarative Expressions Uses in XSLT, XPointer, XQuery, XPath 1.0, W3C REC., Nov. 1999 XPath 2.0,Location Paths,child:doc/ch
8、ild:chapterposition()=5/child:sectionposition()=2 Node-Sets Relative/Absolute Location Path Location Steps Axis Node Test Predicate,Evaluation Procedure,child:doc/child:chapterposition()=5/child:sectionposition()=2 Each Node in Node-Set as Context Node Node-Set Union Node-Sets into a New Node-Set Co
9、ntext Position / Context Size,Examples,child:text() child:chapter/descendant:para child:node() attribute:* following-sibling:chapterposition()=1 child:paraattribute:type=warning,Path Expressions,Data Types Node-Set (Location Path) Boolean Number String Variable Reference, e.g. $x Function Call, e.g.
10、 id(“foo”),XSLT,Document Transformation among XML Vocabularies XSLT is XML-based XSLT is rule and template based XSLT is a declaritve language matching is primary operations also support imperative-like primitives, eg. flow control, sorting, variables,How Does XSLT Work ?,How Does XSLT Work ?,During
11、 the transformation: XSLT processor reads both XML and XSLT documents Try to match elements in XML according to rules specified in XSLT If some elements are matched, processor generates result elements according to templates in XSLT After the transformation, you could obtain: a result XML document,X
12、SLT Processing Sequence,Hello, World ! (material), Hello, World ! Kuan-Ta Chen 2001/05/16 , ,Source XML,XSL Stylesheet,Hello, World ! result, Hello, World ! Kuan-Ta Chen 2001/05/16,Result XML,Result XML previewed in browser,Web Service/SOA,Support interoperable machine-to-machine interaction over a
13、network. RPC-Oriented (Remote Procedure Call) Message-Oriented REST,Web Service Triad,WS-BPEL (Business Process Execution Language),Process/Workflow Engine for SOA Application Integration Web Service Data Representation Data Types in XML Schemas Process Definitions in XML XML-Based Workflow Manageme
14、nt,BPEL versus XPDL,OASIS, IBM, Oracle, Microsoft Narrow Scope Web Service for Appl. Integration XML Schemas as Data Types,WfMC, Many WfMS Vendors Wide Scope API in Multiple Languages Traditional Data Types + XML,BPEL versus XPDL,Block-Structured + Links Transactions Exception Handling Event Handling,Graph-Based Process Model ? ? ?,Conclusion,XML is everywhere no matter whether you are aware of it or not. Technology and tools are maturing. Standards result in lower prices. Better to catch the train.,