Presentation is loading. Please wait.

Presentation is loading. Please wait.

DSA Semester 2. XML Tagged data Hello A really interesting course, well taught Interchange of data RSS, BPEL4WS, RossettaNet … Structure document representation.

Similar presentations


Presentation on theme: "DSA Semester 2. XML Tagged data Hello A really interesting course, well taught Interchange of data RSS, BPEL4WS, RossettaNet … Structure document representation."— Presentation transcript:

1 DSA Semester 2

2 XML Tagged data Hello A really interesting course, well taught Interchange of data RSS, BPEL4WS, RossettaNet … Structure document representation Module specifications Languages XSLT, XSchema, Soap

3 XML – a sample system eXist Native XML Database XQuery process Java Stores XML, XQuery,XSL CSS and binary files (JPEG) XSLT process CSS process Server Client Browser

4 Example – Family History Photo Image: jpeg Description: string Date: date Media: string Inscription: string Person Event Name: string Date : date age Place Address : string Lat: decimal Long: decimal BirthDeathMarriage

5 Many-many resolution in XML Photo Image: jpeg Description: string Date: date Media: string Inscription: string (Subject: ( Person: name Age: integer) | Animal : name )* Place: (address, lat, log) | name B/W photograph Family sitting round the fireplace Robin Wallace Kenneth Wallace 12 Francis Wallace Cat Miss Whitfield Claremont, Brows Lane, Formby -3.06608 53.55555

6 Example – Events Person Event Name: string Date : date Birth DeathMarriage child father mother Birth Francis Wallace 1911-04-26 Kenneth Wallace Ida Wallace New Brighton

7 xquery version "1.0"; (: List events for a person :) declare namespace request="http://exist-db.org/xquery/request"; declare namespace transform = "http://exist-db.org/xquery/transform"; let $person := request:request-parameter('person',''), (: get the seet of events in which this person is involved :) $events := document(/'db/history/events.xml')/eventList/event[.//person = $person], (: get the stylesheet :) $ss := document('/db/history/eventList.xsl'), (: set the 'focus' of the event list to the person :) $params :=, (: order the events in ascending date order :) $elist := {for $e in $events order by $e/date return $e } return (: return the event list transformed by the stylesheet :) transform:transform($elist,$ss,$params) XQuery

8 XSLT Event List Matches the top- level Document Apply matching templates in the given node-set Evaluate an expression and insert the result Elements written directly to the result

9 XSLT … : Born at Father, Mother : Child born at Mother Match the node named eventList XPath Filter conditions, implicitly anded

10 XSLT process XML document XSLT document XSLT process XML or plain text parameters Parse inputs, set context to root; While nodes in context, for each node, check if any templates match – choose the most specific and apply the template Apply this recursively

11 XSLT language Multilingual Output Imperative Control structures Procedural programming Template matching Functional XPath Functions Process Control Debugging

12 Multi-lingual Plain text and plain xml xsl (identified by the xsl:namespace) XPath to define node-sets Filter conditions to select subsets XPath functions to manipulate the nodes Comments –

13 Result output Insert evaluated expression Insert plain text – …. Insert processing instruction – Insert a number – like a level number – Copy nodes into the output – Create a node –

14 Imperative Control Structures Imperative Control structures –Sequence of data and instructions –Selection One option – Multiple options – –Iteration Iterate over nodes in a sequence – Order nodes in the iteration –

15 Procedural programming Procedure call - –.. Call Parameters – Procedure definition –.. Procedure parameters –

16 Template matching Template definition – Template application – Recursive Apply most specific template to a node Declarative code a challenge to debug

17 Functional variables can be defined but they are constants –

18 XPath Functions Boolean Functions String functions Numeric Functions Node sequence functions

19 Modular Programming Inclusion of another stylesheet – Inclusion of tempates from a stylesheet –

20 Process control Stylesheet declaration – Output control – Serialisation – Key – Define attributes –

21 Debugging Output Debug message –


Download ppt "DSA Semester 2. XML Tagged data Hello A really interesting course, well taught Interchange of data RSS, BPEL4WS, RossettaNet … Structure document representation."

Similar presentations


Ads by Google