DOC PREVIEW
TRINITY CSCI 1320 - Extensible Markup Language

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12XML11-14-2011Opening DiscussionMinute essay comments:Can you write web pages using XML?Discrete and 1120 in the major/minor.FYs in 3194. Role of 3194.ASIMO is made by Honda, not sponsored.What were my influences for CS?What is the wackiest programming error I've ever seen?Assignment #2 grades should be expected this week.MotivationWe have been using “flat” text files to store things.Advantage: it is human readable and simple.Disadvantages: everything else.SlowLargeLacks meaningHard to editHard to debugXMLThe eXtensible Markup Language (XML) is a standard for text encoding of data.If you have ever done HTML, XML is similar. XHTML is HTML that follows the XML standard.The advantage of XML is that it can encode pretty much anything and it is human readable text.The downside is that it can be very verbose.Composed of markup (between < and > or & and ;) or content (anything not markup).TagsThe primary markup used in XML is the tag.A tag begins with a < and ends with a >.There are three types of tags.Start-tag: <student>End-tag: </student>Empty-element tag: <quiz/>ElementsThe structure of XML documents comes primarily from elements.An element is one of the following:Everything from a start-tag to the matching end-tag.An empty-element tag.Elements have to be properly nested. The nesting can imply information.AttributesAn attribute is a name value pair.They can be put in start-tags or empty-element tags.Examples:<student name=”Jason” id=”0123456”><quiz grade=”55”/>XML DeclarationAn XML file can begin with a declaration telling information about it.<?xml version="1.0" encoding="UTF-8" ?>We won't worry about these in this class.XML in ScalaThe Scala language supports XML at the language level.Go to the REPL and enter some XML.There is a scala.xml package that contains the libraries for XML.The NodeSeq, Node, and Elem types are particularly useful. I'll typically just use the word Node to describe something from the XML.So is the XML object.The XML ObjectThe loadFile method can be passed a file name and it will read in the file and return a NodeSeq that allows you to get to the contents.There is also a save method that takes a file name and an XML node and writes it to file.Using \ and \\Use the \ operation on a node to search for the occurrences of something at the top level.The second argument is a string.Normal string searches for tags with that label.If the string starts with @ it searches for attributes.Use \\ to search deeply.Minute EssayQuestions about XML?Valero will be presenting at the ACM meeting starting at


View Full Document

TRINITY CSCI 1320 - Extensible Markup Language

Documents in this Course
Functions

Functions

10 pages

Functions

Functions

10 pages

Graphics

Graphics

10 pages

Graphics

Graphics

11 pages

Loops

Loops

4 pages

Loops

Loops

3 pages

Strings

Strings

9 pages

Functions

Functions

10 pages

Loops

Loops

11 pages

Graphics

Graphics

11 pages

Graphics

Graphics

12 pages

Sorting

Sorting

11 pages

Sorting

Sorting

10 pages

Arrays

Arrays

10 pages

Loops

Loops

18 pages

Load more
Download Extensible Markup Language
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Extensible Markup Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Extensible Markup Language 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?