Provide whitespace?, filter-out-whitespace p, em, img gallery (title), picture (has src=,
Fill out feedback sheets.
- Structured data; strings fail. (colon separated; backslash separated; tab-separated; newlines significant?, no standard)
A few years ago, a standard has been converged upon: "Xml" ("extensible markup language"). It encodes structure into a string by marking it up with tags. We will not need to know XML for this lab, but we'll be dealing with an scheme equivalent of XML; there is an optional exercise at the end of the lab where we'll convert between the scheme code and XML files on disk.
Here are some examples of XML; note how every tag is opened and then closed. (What the tags mean is up to whoever reads the file.)
<gallery>
<title>Welcome to the Comp210 House of Horrors</title>
<caption>This gallery contains a title and a caption
but nothing else.</caption>
</gallery>
This is like a structure containing two strings.
Every open tag has a matching close,
and that tags (like parentheses) must be properly nested.
<gallery>
<title>Welcome to the Comp210 House of Horrors</title>
<caption>This gallery has two pictures.</caption>
<picture src="http://www.owlnet.rice.edu/~comp210/Gifs/smiley.gif">
<caption> the first day of class.</caption>
</picture>
<picture src="http://www.owlnet.rice.edu/~comp210/Gifs/smiley.gif">
<caption> the last day of class.</caption>
</picture>
</gallery>
So we see that within a gallery tag, we can have any number of other tags.
We introduced one further thing here, attributes:
within each picture (sub)tag, there is a "src" attribute.
<p>This is a paragraph with <em>emphasized</em> text, if you interpret these tags as html.</p>
<p>A detail: What if you want a less-than character in your text, and don't want it to be confused with an open-tag? To get around that, there are three important entities: < for less-than, > for greater-than, and & for ampersand. </p>
<p>This is a paragraph with <em>emphasized</em> text, if you interpret these tags as html.</p>
<p>A detail: What if you want a less-than character in your text, and don't want it to be confused with an open-tag? To get around that, there are three important entities: < for less-than, > for greater-than, and & for ampersand. </p>