PDA

View Full Version : Why Aren't XML Simple Links Working?


babochka
03-30-2005, 06:38 PM
To Life Immortal

Ok, after I fixed the earlier problems and ran the code through IE, I had no errors, but the links do not work.

How do I get the simple, off-line links to work like <a href> in XHTML? I read my book I have and I dont understand the difference between simple links and extended links. Maybe I need a new book; I just ordered some from Amazon, lol

This is now the current code:

<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
<!--<?xml-stylesheet type="text/css" href="xsgames.css"?>-->
<!--
open the DOCTYPE declaration
the open square bracket indicates an internal DTD
-->
<!DOCTYPE games [
<!--
define the internal DTD
games must contain 1 child element
-->
<!ELEMENT games (text)>
<!--
text must contain 8 child elements in the order listed
-->
<!ELEMENT text (opening+, title, subtitle, gamename+, navilinks+, credits+, footer+, signat+)>
<!--
the elements listed below may only contain text that is not markup
-->
<!ELEMENT opening (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT subtitle (#PCDATA)>
<!ELEMENT gamename (#PCDATA)>
<!ATTLIST gamename
actuate (AUTO|USER) "USER"
behavior CDATA #IMPLIED
content-role CDATA #IMPLIED
content-title CDATA #IMPLIED
href CDATA #REQUIRED
inline (TRUE|FALSE) "FALSE"
role CDATA #IMPLIED
show (REPLACE|EMBED|NEW) "REPLACE"
title CDATA #IMPLIED
xml-link CDATA #FIXED "SIMPLE">
<!ELEMENT navilinks (#PCDATA)>
<!ATTLIST navilinks
actuate (AUTO|USER) "USER"
behavior CDATA #IMPLIED
content-role CDATA #IMPLIED
content-title CDATA #IMPLIED
href CDATA #REQUIRED
inline (TRUE|FALSE) "FALSE"
role CDATA #IMPLIED
show (REPLACE|EMBED|NEW) "REPLACE"
title CDATA #IMPLIED
xml-link CDATA #FIXED "SIMPLE">
<!ELEMENT credits (#PCDATA)>
<!ELEMENT footer (#PCDATA)>
<!ELEMENT signat (#PCDATA)>
<!--close the DOCTYPE declaration-->
]>
<games>
<text>
<opening>
to life immortal!
</opening>
<opening>
the pascha family presents:
</opening>
<title>
the games we play.
</title>
<subtitle>
yahoo! games list.
</subtitle>
<gamename href="bridge.xml" show="REPLACE" title="contract bridge notes">bridge</gamename>
<gamename href="canasta.xml" show="REPLACE" title="canasta notes">canasta</gamename>
<gamename href="chess.xml" show="REPLACE" title="chess notes">chess</gamename>
<gamename href="dominoes.xml" show="REPLACE" title="dominoes notes">dominoes</gamename>
<gamename href="euchre.xml" show="REPLACE" title="euchre notes">euchre</gamename>
<gamename href="gofish.xml" show="REPLACE" title="go fish notes">go fish</gamename>
<gamename href="literati.xml" show="REPLACE" title="literati notes">literati</gamename>
<gamename href="mahjongg.xml" show="REPLACE" title="mah jongg notes">mah jongg</gamename>
<gamename href="pinochle.xml" show="REPLACE" title="pinochle notes">pinochle</gamename>
<gamename href="sheepshead.xml" show="REPLACE" title="sheepshead notes">sheepshead</gamename>
<gamename href="spades.xml" show="REPLACE" title="spades notes">spades</gamename>
<navilinks href="/~babochka2a/theosis/" title="return to silver websuite index">return to silver websuite index.</navilinks>
<navilinks href="/~babochka2a/" title="return to home page">return to home page.</navilinks>
<credits>
credits.
</credits>
<credits>
The Eternal is One; the Eternal is Within and Beyond All.
</credits>
<credits>
staff &amp; players of ark of the covenant.
</credits>
<credits>
big thanks to alex v. on codingforums.com.
</credits>
<credits>
w3schools xml tutorials.
</credits>
<footer>
footer
</footer>
<footer>
site created tuesday 29 march 2005.
</footer>
<footer>
last updated wednesday 30 march 2005.
</footer>
<footer>
copyright © 2005 xara eleni rose pascha. all rights reserved.
</footer>
<footer>
http://home.earthlink.net/~babochka2a/theosis/games.xml
</footer>
<signat>
blessed be the kingdom of the Father,
&amp; the Son &amp; the Holy Spirit,
now &amp; always, &amp; unto ages of ages.
</signat>
</text>
</games>



Thanks in advance for all your help. I just started learning XML and I really like coding pages. Once I have the code correct, I can work on the CSS.
:)


Peace and Long Life
Babochka

rpgfan3233
03-30-2005, 11:57 PM
You mean these?
<gamename href="bridge.xml" show="REPLACE" title="contract bridge notes">bridge</gamename>
<gamename href="canasta.xml" show="REPLACE" title="canasta notes">canasta</gamename>
<gamename href="chess.xml" show="REPLACE" title="chess notes">chess</gamename>
<gamename href="dominoes.xml" show="REPLACE" title="dominoes notes">dominoes</gamename>
<gamename href="euchre.xml" show="REPLACE" title="euchre notes">euchre</gamename>
<gamename href="gofish.xml" show="REPLACE" title="go fish notes">go fish</gamename>
<gamename href="literati.xml" show="REPLACE" title="literati notes">literati</gamename>
<gamename href="mahjongg.xml" show="REPLACE" title="mah jongg notes">mah jongg</gamename>
<gamename href="pinochle.xml" show="REPLACE" title="pinochle notes">pinochle</gamename>
<gamename href="sheepshead.xml" show="REPLACE" title="sheepshead notes">sheepshead</gamename>
<gamename href="spades.xml" show="REPLACE" title="spades notes">spades</gamename>
<navilinks href="/~babochka2a/theosis/" title="return to silver websuite index">return to silver websuite index.</navilinks>
<navilinks href="/~babochka2a/" title="return to home page">return to home page.</navilinks>

You need to reference the XLink namespace in your root element (in this case: games) and then for your links, make them 'xlink:href' rather than just 'href' and add a 'xlink:type="simple" ' to each element link. That should work.

<games xmlns:xlink="http://www.w3.org/1999/xlink">
--------
<gamename xlink:href="dominoes.xml" xlink:type="simple" show="REPLACE" title="dominoes notes">dominoes</gamename>
<gamename xlink:href="euchre.xml" xlink:type="simple" show="REPLACE" title="euchre notes">euchre</gamename>


I think the 'show' attribute needs to be 'xlink:show', but I'm not sure.

Hope that helps!

babochka
03-31-2005, 02:46 PM
To Life Immortal

While I was debugging my code, I got the XML book I ordered from Amazon. I quickly read through the book to find an answer to my problem. Seems I dont need to use Xlink. The final code now is:


<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
<?xml-stylesheet type="text/css" href="xsgames.css"?>
<!--
open the DOCTYPE declaration
the open square bracket indicates an internal DTD
-->
<!DOCTYPE games [
<!--
define the internal DTD
games must contain 1 child element
-->
<!ELEMENT games (text)>
<!--
text must contain 8 child elements in the order listed
-->
<!ELEMENT text (opening+, title, subtitle, gamename+, navilinks+, credits+, footer+, signat+)>
<!--
the elements listed below may only contain text that is not markup
-->
<!ELEMENT opening (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT subtitle (#PCDATA)>
<!-- xhtml type links from xml in 60 mins a day -->
<!ELEMENT gamename (#PCDATA)>
<!ATTLIST gamename xml:type CDATA #REQUIRED
class CDATA #IMPLIED
href CDATA #REQUIRED
title CDATA #REQUIRED
OnClick CDATA #REQUIRED>
<!ELEMENT navilinks (#PCDATA)>
<!ATTLIST navilinks xml:type CDATA #REQUIRED
href CDATA #REQUIRED
title CDATA #REQUIRED
OnClick CDATA #REQUIRED>
<!ELEMENT credits (#PCDATA)>
<!ELEMENT footer (#PCDATA)>
<!ELEMENT signat (#PCDATA)>
<!--close the DOCTYPE declaration-->
]>
<games>
<text>
<opening>
to life immortal!
</opening>
<opening>
the pascha family presents:
</opening>
<title>
the games we play.
</title>
<subtitle>
yahoo! games list.
</subtitle>
<gamename class="visit" xml:type = "simple" href = "bridge.xml" title="bridge notes" OnClick="location.href='bridge.xml' ">bridge</gamename>
<gamename xml:type = "simple" href = "canasta.xml" title="canasta notes" OnClick="location.href='canasta.xml' ">canasta</gamename>
<gamename xml:type = "simple" href = "chess.xml" title="chess notes" OnClick="location.href='chess.xml' ">chess</gamename>
<gamename xml:type = "simple" href = "dominoes.xml" title="dominoes notes" OnClick="location.href='dominoes.xml' ">dominoes</gamename>
<gamename xml:type = "simple" href = "euchre.xml" title="euchre notes" OnClick="location.href='euchre.xml' ">euchre</gamename>
<gamename xml:type = "simple" href = "gofish.xml" title="gofish notes" OnClick="location.href='gofish.xml' ">go fish</gamename>
<gamename xml:type = "simple" href = "literati.xml" title="literati notes" OnClick="location.href='literati.xml' ">literati</gamename>
<gamename xml:type = "simple" href = "mahjongg.xml" title="mahjongg notes" OnClick="location.href='mahjongg.xml' ">mah jongg</gamename>
<gamename xml:type = "simple" href = "pinochle.xml" title="pinochle notes" OnClick="location.href='pinochle.xml' ">pinochle</gamename>
<gamename xml:type = "simple" href = "sheepshead.xml" title="sheepshead notes" OnClick="location.href='sheepshead.xml' ">sheepshead</gamename>
<gamename xml:type = "simple" href = "spades.xml" title="spades notes" OnClick="location.href='spades.xml' ">spades</gamename>
<navilinks xml:type = "simple" href = "/~babochka2a/theosis" title="silver websuite index" OnClick="location.href='/~babochka2a/theosis' ">silver websuite index</navilinks>
<navilinks xml:type = "simple" href = "/~babochka2a" title="home page" OnClick="location.href='/~babochka2a' ">home page</navilinks>
<credits>
credits.
</credits>
<credits>
The Eternal is One; the Eternal is Within and Beyond All.
</credits>
<credits>
staff &amp; players of ark of the covenant.
</credits>
<credits>
big thanks to alex v. on codingforums.com.
</credits>
<credits>
w3schools xml tutorials.
</credits>
<footer>
footer
</footer>
<footer>
site created tuesday 29 march 2005.
</footer>
<footer>
last updated wednesday 30 march 2005.
</footer>
<footer>
copyright © 2005 xara eleni rose pascha. all rights reserved.
</footer>
<footer>
http://home.earthlink.net/~babochka2a/theosis/games.xml
</footer>
<signat>
blessed be the kingdom of the Father
</signat>
<signat>
&amp; the Son &amp; the Holy Spirit,
</signat>
<signat>
now &amp; ever &amp; unto ages of ages.
</signat>
</text>
</games>


The code is now working like a charm! Now the only thing I need to figure out is how do I write the .css file to allow the links to change colour when at hover and after visiting. I will work on that tonight. The current .css file is:


/* Xara E. R. Pascha Wednesday 30 March 2005
irc:babochka2a yim:babochka2a
babochka2a@earthlink.net
xsgames.css */

/* left edge background silver/black motif */
games {display: block; background: url("/~babochka2a/pix/silver/february00.jpg") #999999}
text {display: block; background: #999999; margin-left: 3.75em; padding: 0.75em; color:#000000; font-weight: 500; font-family: "Arial Rounded MT Bold", "Verdana", sans-serif}

/* heading levels */
title {display: block; padding: 0.5em; font-size: 2em; text-align: center}
subtitle {display: block; padding: 0.5em; font-size: 1.5em; text-align: center}
gamename, navilinks {display: block; padding: 0.5em; text-decoration: underline; cursor: hand; font-size: 1em; color: #660099; text-align: left}
credits, footer {display: block; padding: 0.5em; font-size: 1em; text-align: center}
opening, signat {display: block; padding: 0.5em; font-size: 0.75em; text-align: center}

/* classes */

/* links */
gamename.visit:visited {color: #ffffff; text-decoration: none}


Once again thank you for all your help. :D

Happy XML Newbie
Babochka

rpgfan3233
04-02-2005, 06:42 AM
What application are you using to view your XML document?
Both Firefox and IE don't render clickable links.