CS174
Chris Pollett
Nov. 1, 2010
<engine>an example of the content of an engine</engine>
<xsd:element name="engine" type="xsd:string" default="V-6" /> <xsd:element name="plane" type="xsd:string" fixed="single wing" />
<xsd:simpleType name="firstName"> <xsd:restriction base="xsd:string"> <xsd:maxLength value="10" /> </xsd:restriction> </ xsd:simpleType>
<xsd:complexType name="car"> <xsd:sequence> <xsd:element name="make" type="xsd:string" /> <xsd:element name="year" type="xsd:decimal" /> </xsd:sequence> <!-- you can use minOccurs, maxOccurs to specify number of occurrences ; you can have more than one sequence, all tag here--> </ xsd:complexType>
<xsd:element name="year"> <xsd:simpleType > <xsd:restriction base="xsd:decimal"> <xsd:minInclusive value="1900" /> <xsd:maxInclusive value="2010" /> </xsd:restriction> </ xsd:simpleType> </xsd:element> <xsd:complexType name="car"> <xsd:sequence> <xsd:element name="make" type="xsd:string" /> <xsd:element ref="year" /> </xsd:sequence> </ xsd:complexType> <xsd:element name="sport_car" type="car"> <xsd:attribute name="color" type="xsd:string" /> </xsd:element>
<?xml version="1.0" ?> <patient xmlns="http://somewhere.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://somewhere.com patient.xsd" > <!-- other tags for this particular patient record --> </patient>
Which of the following statements is true?
plane {display:block; border 3px;}
<?xml-stylesheet type="text/css" href="mystyles.css" ?>
<?xml version="1.0" encoding="utf-8" ?> <?xml-stylesheet type="text/xsl" href="xslplane.xsl" ?> <plane> <year>1970</year> </plane>
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" xmlns = "http://www.w3.org/1999/xhtml" > <xsl:template match="plane"> <html><head> <title>result of applying a stylesheet to plane</title> </head><body><h1>Plane Description</h1> <xsl:apply-templates /> </body></html> </xsl:template> <xsl:template match="year"> <p style="color:red"> <xsl:value-of select="." /> </p> </xsl:template> </xsl:stylesheet>
request = new XMLHttpRequest()
request = new ActiveXObject('MSXML2.XMLHTTP')
request = new ActiveXObject('Microsoft.XMLHTTP')
request.setRequestHeader("name", "value")
request.open(theHTTPmethod, theURL, theAsync flag) or request.open(theHTTPmethod, theURL, theAsync flag, username, password)
request.open("GET", "progress.php", true)
var self = this; /* remember scope of enclosing object */ request.onreadystatechange = function() { switch(request.readyState) { case 0:// handle uninitialized case case 1: // handle open but no send case case 2: // handle send but no response case case 3: // handle response is being downloaded case case 4: // handle response has completed being downloaded case } }
document.getElementById("myDivTag").innerHTML = request.responseText; /*not really a DOM standard but all browsers happy with */ //or we could do... myDiv = document.getElementById("myDivTag") if(myDiv.firstChild) { myDiv.removeChild(myDiv.firstChild); } myDiv.appendChild(document.createTextNode(request.responseText));
request.send(null);Note: send's argument can be used if using POST method to send the posted data