Click to See Complete Forum and Search --> : Attribute not showing


smootherkat
02-10-2009, 09:49 AM
Hi I have an XML code and my Attribute date is not showing I would love some help.
<html xmlns:html ="http://www.w3.org/1999/xhtml/">
<head><title>Favoriet Movies</title>
</head>
<body>
<h1>My Favorite Movies</h1>
<hr>
<html:movies>
<html:movie>
<html:movie_name><span>Title:</span> Titanic</html:movie_name>
<release date="1997">
<html:director><span>Director:</span> James Cameron</html:director>
<html:actor_name><span>Main Actor:</span>
<html:first> Leonardo</html:first>
<html:last>DiCaprio</html:last>
</html:actor_name>
<html:actors_name><span>Main Actors:</span>
<html:first> Kate</html:first>
<html:last>Winslet</html:last>
</html:actors_name>
<html:discription><span>Film Discription:</span> Two members of different social classes who fall
in love aboard the ill-fated voyage of the ship.</html:discription>
<html:category><span>Category:</span> Romatic-Drama</html:category>
</release>
</html:movie>
<html:movie>
<html:movie_name><span>Title:</span>Sixth Sense</html:movie_name>
<html:release date="1999">
<html:director><span>Director:</span> M. Night Shyamalan.</html:director>
<html:actor_name><span>Main Actor:</span>
<html:first> Bruce</html:first>
<html:last>Willis</html:last>
</html:actor_name>
<html:actor_name><span>Main Actor:</span>
<html:first> Haley Joel</html:first>
<html:last>Osment</html:last>
</html:actor_name>
<html:discription><span>Film Discription:</span> A troubled, isolated boy who claims to be able to see and talk to the dead,
and an equally troubled child psychologist who tries to help him.</html:discription>
<html:category><span>Category:</span> Psychological- Horror</html:category>
</html:release>
</html:movie>
<html:movie>
<html:movie_name><span>Title:</span>Schindler's List</html:movie_name>
<html:release date="1993">
<html:director><span>Director:</span>Steven Spielberg</html:director>
<html:actor_name><span>Main Actor:</span>
<html:first> Liam</html:first>
<html:last>Neeson</html:last>
</html:actor_name>
<html:actors_name><span>Main Actors:</span>
<html:first> Caroline</html:first>
<html:last>Goodall</html:last>
</html:actors_name>
<html:discription><span>Film Discription:</span> Oskar Schindler uses Jews to start a factory in Poland during the war.
He witnesses the horrors endured by the Jews, and starts to save them. </html:discription>
<html:category><span>Category:</span> Drama</html:category>
</html:release>
</html:movie>
<html:movie>
<html:movie_name><span>Title:</span> The Dark Knight</html:movie_name>
<html:release date="2008">
<html:director><span>Director:</span> Christopher Nolan</html:director>
<html:actor_name><span>Main Actor:</span>
<html:first>Christian</html:first>
<html:last> Bale</html:last>
</html:actor_name>
<html:actors_name><span>Main Actors:</span>
<html:first>Maggie</html:first>
<html:last> Gyllenhaal</html:last>
</html:actors_name>
<html:discription><span>Film Discription:</span> Batman, Gordon and Harvey Dent are forced to deal with the chaos unleashed by an anarchist mastermind known only as the Joker,
as it drives each of them to their limits</html:discription>
<html:category><span>Category:</span> Action</html:category>
</html:release>
</html:movie>
<html:movie>
<html:movie_name><span>Title:</span> The Silence of the Lambs</html:movie_name>
<html:release date="1991"></html:release>
<html:director><span>Director:</span> Jonathan Demme</html:director><br/>
<html:actor_name><span>Main Actor:</span>
<html:first>Anthony</html:first>
<html:last> Hopkins</html:last>
</html:actor_name>
<html:actors_name><span>Main Actors:</span>
<html:first>Jodie</html:first>
<html:last> Foster</html:last>
</html:actors_name>
<html:discription><span>Film Discription:</span> Dr. Hannibal Lecter,brilliant,cunning,psychotic. In his mind lies the clue to a ruthless killer.
Clarice Starling, FBI. Brilliant. Vulnerable. Alone. She must trust him to stop the killer.</html:discription>
<html:category><span>Category:</span> Crime</html:category>
</html:movie>>
</html:movies>
</hr>
</body>
</html>

Charles
02-10-2009, 09:59 AM
1) Attributes don't show, not by default. You want to specify an XSLT stylesheet that transforms the whole thing, attributes and all, into something that does show.
2) You've misunderstood the whole namespace idea. The XHTML namespace only applies to XHTML elements. You need to define a new namespace for your own made-up elements but specify XHTML as the default.<html xmlns="http://www.w3.org/1999/xhtml/" xmlns:foo="http://foo.bar.com/my-happy-namespace">
<head><title>Favoriet Movies</title>
</head>
<body>
<h1>My Favorite Movies</h1>
<hr>
<foo:movies>
<foo:movie>

smootherkat
02-10-2009, 11:42 AM
I hope I am getting closer to the problem so I put this in and the date is still not showing, sorry I am a newbie :) O by the way our teacher told us to use HTML for the namespace

<html xmlns="http://www.w3.org/1999/xhtml/" xmlns:html="http://html.com/favorite movies">
<head><title>Favorite Movies</title>
</head>
<body>
<h1>My Favorite Movies</h1>
<hr>
<html:movies>
<html:movie>
<html:movie_name><span>Title:</span> Titanic</html:movie_name>
<html:release date="1997">
<html:director><span>Director:</span> James Cameron</html:director>
<html:actor_name><span>Main Actor:</span>
<html:first> Leonardo</html:first>
<html:last>DiCaprio</html:last>
</html:actor_name>
<html:actors_name><span>Main Actors:</span>
<html:first> Kate</html:first>
<html:last>Winslet</html:last>
</html:actors_name>
<html:discription><span>Film Discription:</span> Two members of different social classes who fall
in love aboard the ill-fated voyage of the ship.</html:discription>
<html:category><span>Category:</span> Romatic-Drama</html:category>
</html:release>
</html:movie>

Charles
02-10-2009, 11:50 AM
1) You must be misunderstanding your teacher. Perhaps her or she wanted you to use the "html" prefix for the HTML elements and let your special elements inhabbit the default namespace. It makes no sense, even though it's syntactically correct, to apply the "html" prefix to all of the non-HTML elements.
2) Attributes don't show. If you want it to show you have to make it an element and not an attribute. You can do this in the source or you can apply a stylesheet.

smootherkat
02-10-2009, 12:10 PM
Thank you for all your help