DOC PREVIEW
Columbia COMS 3156 - Lecture notes

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 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 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Software EngineeringRecitation 1Suhit GuptaToday we will be covering…n CVSn XMLCVSn Why do we need CVS?n How do we use CVS on a remote server?n How will we be using it?2CVS [II]n Make a new ‘tempdir’n setenv CVSROOT = `pwd`\/tempdirn set up new group = ‘group’n create <group_name>n add <cunix_user> <group_name>n Do this for all your team membersCVS [III]n umaskn chgrp <group_name> tempdirn chmod 2770 tempdirn cvs initCVS [IV]n cvs loginn cvs addn cvs importn cvs checkoutn cvs updaten cvs commitn cvs logout3CVS [V] – Remember…n You will need this, start nown Please update before committingn No locking featuren You can tag a commitn http://www.cvshome.orgn man cvsn Office hours of the ta’s JXML [I]n The new HTML<HTML><HEAD><TITLE>Test</TITLE></HEAD><BODY><a href="http://a176.g.akamai .net/7/176">test</a></BODY></HTML>n http://www.w3.orgXML [II]n Create your own tagsn Samplen Validaten Samplen Where can you validate http://www.w3.org/2001/03/webdata/xsv4XML – DOM [I]n The XML Document Object Model (DOM) is a programming interface for XML documents. It defines the way an XML document can be accessed and manipulated.n DOM data structures used with XML are essentially trees.n http://www.w3schools.com/dom/dom_intro.aspNode PropertiesName Descriptionattributes Returns a NamedNodeMapcontaining all attributes for this nodechildNodes Returns a NodeListcontaining all the child nodes for this nodefirstChild Returns the first child node for this nodelastChild Returns the last child node for this nodenextSibling Returns the next sibling node. Two nodes are siblings if they ha ve the same parent nodenodeName Returns the nodeName , depending on the typenodeType Returns the nodeType as a numbernodeValue Returns, or sets, the value of this node, depending on the typeownerDocument Returns the root node of the documentparentNode Returns the parent node for this nodepreviousSibling Returns the previous sibling node. Two nodes are siblings if they have the same parent nodeNode MethodsName DescriptionappendChild(newChild) Appends the node newChild at the end of the child nodes for this nodecloneNode (boolean ) Returns an exact clone of this node. If the booleanvalue is set to true, the cloned node contains all the child nodes as wellhasChildNodes () Returns true if this node has any child nodesinsertBefore (newNode ,refNode)Inserts a new node,newNode , before the existing node,refNoderemoveChild(nodeName)Removes the specified node,nodeNamereplaceChild(newNode,oldNode )Replaces the oldNode, with the newNode5XML – DOM [II]n DOM validate XML– http://www.w3schools.com/dom/dom_validate.aspn Some DOM resources –– http://www.w3schools.com/dom/dom_resources.aspSample Code<html><body><script type="text/vbscript">txt="<h1>Traversing the node tree</h1>"document.write(txt)setxmlDoc =CreateObject("Microsoft.XMLDOM")xmlDoc.async ="false"xmlDoc.load("note.xml")for each x in xmlDoc .documentElement.childNodesdocument.write("<b>" & x.nodename & "</b>")document.write(": ")document.write(x.text)document.write("<br >")next</script></body></html>Sample codepublic class OtherParser implements Parser {private Document doc;public OtherParser(Documentarg) {doc = arg;}public SourceTuple parseDoc () {String protocol=null;String url=null;intsize=-1;String type=null;long created= -1;long last_mod=-1;String src=null;String opt[] = null;Element root;root = doc.getRootElement();try {created = root.getAttribute (" createDate ").getLongValue ();} catch (Exception e) {}protocol = root.getChild ("Protocol").getText();url = root.getChild("Name").getText();type = root.getChild ("Type").getText();try {size = Integer.parseInt(root.getChild ("Size").getText());last_mod = Long.parseLong(root.getChild("Last-Modified").getText());} catch (Exception e) {}System.err.println(url);return new SourceTuple(-1, protocol, url, size, type, created, last_mod,src1, opt);} }6Conclusionn Some stuff to read– http://www.cvshome.org– man cvs– http://www.w3.org– Primer 0 - http://www.w3.org/TR/2000/WD-xmlschema-0-20000407/– http://www.w3schools.com– Schemas -


View Full Document

Columbia COMS 3156 - Lecture notes

Download Lecture notes
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 Lecture notes 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 Lecture notes 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?