Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to XML Part 2. Related Standards XML documents and DTDs provide foundation for an Internet document paradigm – do not provide all necessary.

Similar presentations


Presentation on theme: "Introduction to XML Part 2. Related Standards XML documents and DTDs provide foundation for an Internet document paradigm – do not provide all necessary."— Presentation transcript:

1 Introduction to XML Part 2

2 Related Standards XML documents and DTDs provide foundation for an Internet document paradigm – do not provide all necessary features! Need for XML standards (some of which are still under development)

3 Standard Efforts StandardAbbreviationSpecification StatusPurpose XML NamespacesNamespacesRecommendationPrevent overlap of names used by different software XML Linking Language XLinkWorking DraftFlexible document linking Extensible Stylesheet Language XSLWorking DraftFlexible document presentation XSL TransformationsXSLTWorking DraftEasy transformation of XML content from one data format to another XML SchemaN/AWorking DraftMore extensive document definition rules than DTDs

4 XML Namespaces - XML is based on elements, each is distinguished by unique element name Applications process a document they associate element content with corresponding element name Naming collisions are problematic – for example both Accounting and Fullfillment applications use term ‘status’ to signify different meanings Using XML Namespaces developers can qualify the use of ‘status’ element in reconciliation document

5 XML Namespaces - Example http://www.foocompany.com/names/acct-REV10 Bar Corporation Accounts Payable – Bar Corporation invoice http://www.foocompany.com/names/ful-REV10 Bar Corporation Loading Dock shipped

6 Namespaces attached to element/attribute with colon : First time use namespace, associate namespace prefix with namespace name use reserved XML attribute ‘xmlns’ xmlns:acct xmlns:ful Repetition?

7 Default Namespace http://www.foocompany.com/names/acct-REV10 Bar Corporation Accounts Payable – Bar Corporation invoice http://www.foocompany.com/names/ful-REV10 Bar Corporation Loading Dock shipped

8 XML Linking Language - XLink Similar to HTML linking but XLink enables people to specify links with multiple target documents by using XLink namespaces Two forms – simple and extended

9 Simple XLink <BarCorpLink xlink:form=“simple” xlink:inline=“true” xlink:ref=http://www.foocompany.com/customers/barcorp.xmlhttp://www.foocompany.com/customers/barcorp.xml xlink:role=“link record” xlink:title=“Bar Corporation” xlink:show=“new” xlink:actuate=“user” xlink:content-role=“link BarCorp record” xlink:content-title=“Link to Bar Corporation Customer Record”>Bar Corporation

10 Extended XLink <BarCorpOrderTrackingLink xlink:form=“extended” xlink:inline=“false” xlink:role=“track order” xlink:content-role=“track BarCorp”> <Invoice xlink:form=“locator” xlink:href=“BarCorpInvoice.xml” xlink:title=“Bar Corporation Invoice” xlink:actuate=“user/> <Shipment xlink:form=“locator” xlink:href=“BarCorpShipment.xml” xlink:title=“Bar Corporation Shipment” xlink:actuate=“user/>

11 Extensible Stylesheet Language - XSL Used for formatting document display Three primary requirements for solution Apply formatting rules to elements Usable with different display technologies Document consumer may control application of stylesheets Define formatting templates that apply to an element and its subelements Select particular elements by using “xsl” namespace Instructions for formatting use “fo” namespace Common practice is to use XSL template syntax but directly insert HTML tags – XSL is used simply as transformation language (source doc – HTML)

12 XSL Example <xsl:template match=“address” fo:font-size=“large” fo:font-weight=“bold” fo:font-family=“Arial” fo:line-height=“2” fo:font-size=“small” fo:font-weight=“normal” fo:font-family=“Timesl” fo:line-height=“1”

13 XSL Transformations - XSLT XSLT is used to transform data from one format to another Used when two companies want to exchange same information but apply own internal DTD Provides mechanism to support customised data flow – delivers data to each application in format it desires

14 XSLT Example Ex 1 … Ex 2 USD …

15 XSLT code <xsl:for-each select=“order”

16 XML Schema Using XML Schema instead of DTDs to specify the content of XML documents offers advantages of using XML syntax and enforcing datatype restrictions on element content and attribute values Additional features to DTD, such as ability to define recurring blocks of elements or attributes once and then reuse definition many times

17 XML Tools Fundamental Components Web InfrastructureDevelopment Tools Authoring Tools Content Management Tools Applications Relationship of Major Tools

18 Fundamental Components Determining factor of XML’s success is availability of fundamental software components that provide processing documents and related standards XML parsers – typically embedded in applications. It reads in physical files associated with a document and converts the document text into programming constructs accessible to application logic Tree Based Event Based

19 Tree-based Parser XML DTD XML Document ValidValid Tree-Based Parser Application Logic Document Tree Uses App Prog Interface (API) Effective for apps that need random access to doc element However, building a complete tree for every doc is expensive in terms of memory Event-based parsers avoid this as they do not create data structure for entire document

20 Event-based Parsers XML DTD XML Document Event-Based Parser ValidValid Application Logic Parsing event Data Request Event-based parsers send parsing events directly to application logic (beg and end of element but not its attributes) If application logic interested in element it requests additional data from parser Effective when application needs only sequential access to certain kinds of elements

21 Web Browsers Internet Explorer Netscape Navigator Modzilla Firefox W3C – Amaya Web browser – derived for testing XML documents Download for FREE http://www.w3c.org/Amaya

22 XML Editor Windows Notepad or WordPad Microsoft XML Notepad http://msdn.microsoft.com/xml/notepad/intro.asp XML writer – available from Wattle Software http://www.xmlwriter.com/ Macintosh – Emile editor http://www.in-progress.com/emile/

23 Special XML characteristics Less than symbol (<) - < Greater than symbol (>) - > Quote symbol (“) - " Apostrophe symbol (‘) - &apos; Ampersand symbol (&) - &

24 Real world XML WML – Web pages for mobile devices XMLNews – news stories CDF – Web channels OSD – descriptions of software OFX – financial information (EFT, etc.) RDF – descriptions of info in web pages (helps to aid search engines) MathML – mathematical equations P3P – Web privacy policies RELML – real estate listings HRMML – human resource infomration (resumes, etc.) VoxML – voice response scripts (Press 1 for this, Press 2 for that, etc.) VML – vector graphics SVG – vector graphics SMIL – multimedia presentations 3DML – three-dimensional virtual worlds

25 Application Areas Information accessibility and sharing Information distribution capabilities Document life cycle and content management Accumulating knowledge from employees (tacit and explicit) Searching knowledge repositories, such as database systems and the Internet Knowledge categorisation systems and limitations of classifications Workflow systems and integration barriers Application integration System architecture standardisation and compatibility Customized publishing File configuration and logging Electronic commerce


Download ppt "Introduction to XML Part 2. Related Standards XML documents and DTDs provide foundation for an Internet document paradigm – do not provide all necessary."

Similar presentations


Ads by Google