I have a project due tomorrow, i have basically finished it and am awaiting a reply from my lecturer on how the information is actually meant to be presented... ok below is a simple example of what is required
- Create an XML template
Create a DTD
Use CSS to style
person.dtd
<!ELEMENT person (name_first,name_last,personal_details+)> <!ELEMENT name_first (#PCDATA)> <!ELEMENT name_last (#PCDATA)> <!ELEMENT personal_datails (age,weight)> <!ELEMENT age (#PCDATA)> <!ELEMENT weight (#PCDATA)>
Then an xml file person.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/css" href="person.css"?> <!DOCTYPE person SYSTEM "person.dtd"> <people> <person> <name_first>bbq</name_first> <name_last>D.I.C</name_last> <personal_details> <age>20</age> <weight>80</weight> </personal_details> </person> <person> <name_first>John</name_first> <name_last>Smith</name_last> <personal_details> <age>50</age> <weight>80</weight> </personal_details> </person> </people>
Then in my .css file called person.css I have the following
person
{
font-size: 16pt;
font-family : Arial Black;
background-color: #dddddd;
width: 70%;
text-align: center;
border : solid 2px;
}
The problem lies in that i have many other DTD all under person, not only do i have name i have things like
personal_details which in that has age, height, weight etc..
When i open the XML document it is rather horrible to look at, with information all being in. How can i use CSS to format my xml, as in like have each thing on a new line... The above is an example and it hasn't been through a validator, however yeah, i cannot find anywhere how to format my xml document using css. As far as i know i cannot use XSL either, which makes it a pain. So the main thing is, it all comes out in a single grey box, all on one line
I would like to have it in the format
Page Title
=================
bbq D.I.C
Age : 20
Weight : 80
=================
John Smith
Age : 50
Weight : 80
=================
and so on...
How can i use some kind of formatting to give a title to each xml page and then format each "Person(s)" details to appear a little nicer on the eyes with some headings of what each is ?
Also, IE displays each person and there details vertically, whilse opera, netscape and firefox display them horizontally ? Any ideas how to overcome this.
IE :
bbq
JohnSmith
others :
bbq | JohnSmith
etc...
This post has been edited by bbq: 18 September 2008 - 02:46 AM

New Topic/Question
Reply



MultiQuote










|