OSUsushichic
Fired up! Ready to go!
Does anyone know XML? I'm trying to create a relatively simple document but I cannot get it to validate with the DTD. I was just wondering if anyone could help.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
Taosman;1104161; said:
OSUsushichic;1104086; said:Does anyone know XML? I'm trying to create a relatively simple document but I cannot get it to validate with the DTD. I was just wondering if anyone could help.
MililaniBuckeye;1104802; said:Common mistakes that will prevent validation:
Tag cases not matching, e.g., you declared a <Car> tag and then used <car>
Missing closing tags, e.g., you forgot </Car> after using <Car>Lexus
Not quoting attributes, e.g., having <Car type=sedan> instead of <Car type="sedan">
Using one of the 5 predefined entity references in your data. These 5 are:
< (less than) need to use <
> (greater than) need to use >
& (ampersand) need to use &
" (quotation mark, or double quote) need to use '
' (apostrophe, or single quote) need to use "
Improperly nested elements, e.g., <Car><model></Car></model> instead of <Car><model></model></Car>
OSUsushichic;1104980; said:Thanks, Mili. I'm confused about what to do with the $ sign. I have this:
<books>
<book>
<title>The Eyre Affair</title>
<author>Jasper Fforde</author>
<price>$9.98</price>
</book>
...
(and two more <book> sets like this one)
</books>
I think the price should either look like this:
<price>$9.98</price>
(Unicode symbol for $)
and then declare the entity $ in the DTD. But I'm not sure how to do this. The book I'm using doesn't explain this very well. I know I also can set up the $ as the default currency for these, which would be better since I'm using the $ multiple times, but I'm also not sure how to do that. It's frustrating me!
MililaniBuckeye;1108988; said:Just now got back to this thread. What I'd do is not use a dollar sign in the price field, but just the amount itself...you could always print the dollar sign in front of the amount when printing reports, displaying web pages, etc. It would look like this (ignore the leading periods, I just wanted to also show you the indentations I like to do to make it easier to read and troubleshoot...those periods would actually be spaces):
<books>
..<book>
....<title>The Eyre Affair</title>
....<author>Jasper Fforde</author>
....<price>9.98</price>
..</book>
</books>
OSUsushichic;1109164; said:I could do it that way, but that would be a cop-out! :p I'm required to use the dollar sign, or somehow indicate that the currency is USD. I'm going to ask some folks at the MIT library. They deal with XML all the time.
MililaniBuckeye;1109544; said:How about using an attribute for the price element?
<price currency="USD">9.98</price>
That way you can define any currency you want (British pounds, Japanese yen, Canadian dollars, etc.).