How to browsers detect your RSS feed
Just add the following code in the <head> section of your page.
<link rel="alternate" type="application/rss+xml" title="My RSS" href="http://www.domain.org/rss/rss.xml">
Example of external stylesheets with the addition of an XLink
Notice below I have provided a an XLink to google. To do an XLink like an html link, you need to add the name space. See the <daily_log> tag at the beginning of the document. When you actually make a link, you don't have to use tags like in HTML -- you can use any tag you want. It would be useful however to choose a tag as a link and stick with it. I would almost suggest to just use tags since you already know them. The reason being, if you add a style sheet, do you really want to style many different links. Just add the link information inside it. The only benefit I can see would be inline commenting and would give you the same effect that classes provide. If you use XPointer, you can achieve anchor links, but much more powerful ones. You can point to say, the 3rd paragraph, 4th sentence, 5th character if you want. (I've never done that, but I've read it. Let me know if if I'm wrong or right.)
daily_log.xml
<?xml version="1.0" ?> <?xml-stylesheet href="daily_log.css" type="text/css"?> <daily_log xmlns:xlink="http://www.w3.org/1999/xlink"> <day> <date>2007-11-01</date> <item> Emails on gmail from <google xlink:type="simple" xlink:href="http://www.google.com">Google</google> </item> <item> Reading the news. </item> </day> <day> <date>2007-10-31</date> <item> Happy Halloween!!! </item> <item> Emails </item> <item> Finished backing up my computer. :) </item> </day> </daily_log>
daily_log.css
daily_log {
font-family:sans-serif;
background-image:url(http://images.wsams.org/images/back.png);
background-repeat:repeat;
width:100%;
display:block;
}
day {
display:block;
margin-right:auto;
margin-left:auto;
width:50%;
padding:16px 0 0 0;
}
date {
display:block;
font-weight:bold;
background-color:#f8f3d2;
padding:8px;
margin-bottom:16px;
border-bottom:2px solid silver;
-moz-border-radius-topright:8px;
-moz-border-radius-topleft:8px;
}
item {
display:block;
background-color:#e8f1f6;
padding:8px;
margin:0 8px 16px 8px;
font-size:11px;
-moz-border-radius:8px;
}
Adding inline CSS styles to an XML file
Below is an example of styling a style sheet inline. The tag with id="style" was chosen by me. can be any name you want and the id can be anything you want. Just make sure that in the xml-stylesheet declaration you make #style be the id of the tag or whatever you use. (Sorry if that's confusing.)
If you wanted to use an external stylesheet, replace #style with an actually CSS stylesheet filename and it will be parsed.
<?xml version="1.0" ?>
<?xml-stylesheet href="#style" type="text/css"?>
<daily_log>
<style id="style">
daily_log {
font-family:sans-serif;
background-image:url(http://www.domain.org/images/back.png);
background-repeat:repeat;
width:100%;
display:block;
}
day {
display:block;
margin-right:auto;
margin-left:auto;
width:50%;
padding:16px 0 0 0;
}
date {
display:block;
font-weight:bold;
background-color:#f8f3d2;
padding:8px;
margin-bottom:16px;
border-bottom:2px solid silver;
-moz-border-radius-topright:8px;
-moz-border-radius-topleft:8px;
}
item {
display:block;
background-color:#e8f1f6;
padding:8px;
margin:0 8px 16px 8px;
font-size:11px;
-moz-border-radius:8px;
}
</style>
<day>
<date>2007-10-31</date>
<item>
Happy Halloween!!!
</item>
<item>
Went to the store.
</item>
<item>
Bought an Apple Computer ;)
</item>
</day>
</daily_log>
http://www.w3.org/Style/styling-XML » http://www.w3.org/TR/xml-stylesheet/ »
[Click to add or edit comments])
Please prepend comments below including a date