PDA

View Full Version : Hello, newbie needs help!



smudge
02 May 2008, 06:38 AM
Hi, i'm designing an xml site for my uni work and I have put some entities and an attribute list into the dtd. I'm trying to use my entities as a text replacement in the attribute "price currency" in the dtd but it won't work. It's the currency section. Can anyone explain why the price comes up but not the currency sign? the page does preview in ie. Basically I want it to show a £ or a $ or a € infront of the price.

this is the xml

<header>
<title>CD Bay Incorporated Music Bidding</title>
</header>

<genre>Pop Music</genre>

<artist>
<firstname>Amy</firstname>
<surname>Winehouse</surname>
</artist>

<album>Back to Black</album>

<label>Island</label>

<price currency="&gbp;">7.98</price>

<delivery>&del;</delivery>

<seller>
<firstname>Ted</firstname>
<surname>Kord</surname>
</seller>

<phone>0191 200 3456</phone>

<mobile>07564 33333</mobile>

<description>Amy Winehouse's second album, Back to Black,
is one of the finest soul albums, British or otherwise,
to come out for years. Frank, her first album, was a sparse
and stripped-down affair; Back to Black, meanwhile, is neither
of these things. This time around, she's taken her inspiration
from some of the classic 1960's girl groups like the
Supremes and the Shangri-Las, a sound particularly suited to her
textured vocal delivery, while adding a contemporary songwriting
sensibility.</description>

and this is the dtd

<!ELEMENT musicbidding (header, genre, artist, album, label, price, delivery, seller, phone, mobile, description)>
<!ELEMENT musicbidding (#PCDATA)>
<!ELEMENT header (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ELEMENT artist (FIRSTNAME, SURNAME)>
<!ELEMENT album (#PCDATA)>
<!ELEMENT label (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT delivery (#PCDATA)>
<!ELEMENT seller (FIRSTNAME, SURNAME)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT mobile (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ENTITY del "Free UK Delivery">
<!ENTITY gbp "£">
<!ENTITY usd "$">
<!ENTITY eur "€">
<!ATTLIST price currency (gbp|usd|eur) #REQUIRED>

ranteo
09 May 2008, 02:24 AM
hmm http://www.ascii.cl/htmlcodes.htm lists the html for $ as "&#36;" without the inverted commas so perhaps u wanna try that?

A quick search online reveals that not all browsers accept the Euro symbol though I'm not too sure about it now.