Secondary menu

Main menu

Q & A - Using Quotation Marks With XML Attribute Values


Q: On page 5 (see below) you wrote, "An attribute's value must always be enclosed in either matching single or double quotation marks." But in your example, you used a file, not a value.

A: That's a good observation. The term "value" is used here in the generic sense of the word, meaning the information stored in the attribute. It does not mean a numeric value, or even a number.

Further, the value of the attribute used in the example, "colossus.jpg," is not actually a file. While it looks like a filename, unitl it is specifically associated or used within in a file system, it's only a set of characters.

Values must be enclosed in quotation marks
An attribute’s value must always be enclosed in either
matching single or double quotation marks (Figure 1.6).

Figure 1.6 - Attribute value

Figure 1.6 The quotation marks are required. They
can be single or double, as long as they match each
other. Note that the value of the
file attribute doesn’t
necessarily refer to an image; it could just as easily say
"
The picture from last summer's vacation".

 

Back to the Q & A page



© 2009 - 2017 Kevin Howard Goldberg