PABA is composed by a database with our links. The problem is that on each site I have to include this links in a order that is specifically for that site (for example when is about a an auto site 1st links should be the links from the category auto and after that other categories links). Ok. In my database I have specified and the order of the links foreach category - something like categoryid - outputcategoryid (this is specifically to the site where the links will apear) - rank. This work is for SEO
and I hope that it will work.
So...how do I proceed: foreach category I generate an XML file (in this moment there are 10 categories); I have only one XSLT file. I know that in XSLT I can order (I didn't do this never because it wasn't necesary but is okay this option); anyway, each XML file contains the categories in a order specified in the database after the site category where the links will apear (in this way the xslt transformation will work faster). Using server technologies (ASP or PHP) I generate from this 2 files the html code. Here is the input:
XML:
<?xml version="1.0" encoding="utf-8"?>
<Feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sections>
<Section>
<rank>1</rank>
<id>2</id>
<name>Internet</name>
<name_cover>hnc</name_cover>
<picture />
<description>hd</description>
<Links>
<Link>
<url>http://www.pan-internet.com/</url>
<description>Internet Software services: ip to geolocation, proxy, internet speed test</description>
<title>Internet Services</title>
<title_cover>Internet Services Everything about the internet</title_cover>
<image>http://www.pan-internet.com/ui/www.pan-internet.com.png</image>
<modify>8/25/2009 10:41:03 PM</modify>
<idsection>2</idsection>
<id>2</id>
</Link>
<Link>
<url>http://paba.pan-internet.com/</url>
<description>Paba Network - Th best what you can get from the Internet</description>
<title>Paba Network </title>
<title_cover>Paba Network - Internet Networks</title_cover>
<image>http://paba.pan-internet.com/pictures/internet.png</image>
<modify>8/26/2009 6:19:01 AM</modify>
<idsection>2</idsection>
<id>7</id>
</Link>
<Link>
<url>http://www.testnetspeed.net</url>
<description>Test your Internet connection bandwidth to locations around the world with this interactive broadband speed test</description>
<title>Global Broadband Speed Test</title>
<title_cover>Global Broadband Speed Test</title_cover>
<image />
<modify>8/28/2009 3:43:19 PM</modify>
<idsection>2</idsection>
<id>16</id>
</Link>
</Links>
</Section>
<Section>
<rank>1</rank>
<id>4</id>
<name>History/Culture/Religion</name>
<name_cover>hnc</name_cover>
<picture />
<description>hd</description>
<Links>
<Link>
<url>http://www.iuliumaniu.ro/</url>
<description>Site dedicat memoriei lui Iuliu Maniu, sustinut de Biserica Greco-Catolica din Badacin, satul natal al lui Iuliu Maniu </description>
<title>Iuliu Maniu, Badacinul </title>
<title_cover>Iuliu Maniu si Badacinul </title_cover>
<image>http://www.iuliumaniu.ro/pictures/banner.png</image>
<modify>8/25/2009 11:35:38 PM</modify>
<idsection>4</idsection>
<id>3</id>
</Link>
<Link>
<url>http://www.proverbs.iuliumaniu.ro/</url>
<description>Proverbs, the ideea that was on this site startup is coming to help each of us with our (gran...gran-...)parents wisdom. All of us hear about chinese proverbs, indian proverbs, latin proverbs english proverbs; somehow proverbs meas a part of our live, our evolution; that is because we learn from proverbs, we evoluate thanks to th proverbs.! This is a new option on our site, to see quotes. How many time you see people that are invoking somebody else for a better understanding of his message? They use quotes. From Bible to Marilyn Manson, from Abraham Lincoln to Osama bin Laden, people invoke celebrities. The ideea behind a wuote is that you can use it, is free; the quote is somehow a representitive of the quoted men; Good or bad, They are the people that represents us; we just invoke him using the quotes!</description>
<title>Proverbs & Quotes</title>
<title_cover>Proverbs, languages, regions, countries, free, reviews, rating</title_cover>
<image />
<modify>8/25/2009 11:37:12 PM</modify>
<idsection>4</idsection>
<id>4</id>
</Link>
<Link>
<url>http://www.floridecrin.iuliumaniu.ro/</url>
<description>Flori de Crin - revista de spiritualitate creştină editată de Vicariatul Silvaniei. Apare trimestrial ca supliment a revistei eparhiale Vestitorul</description>
<title>Flori de Crin</title>
<title_cover>Revista Flori De Crin</title_cover>
<image>http://www.floridecrin.iuliumaniu.ro/pictures/crin_imperial.jpg</image>
<modify>8/26/2009 6:15:19 AM</modify>
<idsection>4</idsection>
<id>5</id>
</Link>
<Link>
<url>http://www.blog.iuliumaniu.ro/</url>
<description>Iuliu Maniu, Bădăcin "… Pe mine nu reuşesc să mă intimideze, eu de la calea mea nu mă abat, eu hotărârile mele nu mi le schimb, eu ce cred că este bine pentru ţară şi pentru neam, asta fac."</description>
<title>Iuliu Maniu, Bădăcin</title>
<title_cover>Iuliu Maniu si Bădăcin</title_cover>
<image>http://www.iuliumaniu.ro/pictures/banner.png</image>
<modify>8/26/2009 6:17:02 AM</modify>
<idsection>4</idsection>
<id>6</id>
</Link>
</Links>
</Section>
<Section>
<rank>2</rank>
<id>3</id>
<name>Yahoo, detectoare status,avatare,mesaje status</name>
<name_cover>hnc</name_cover>
<picture />
<description>hd</description>
<Links>
<Link>
<url>http://www.status-yahoo.ro</url>
<description>Yahoo status invisible detector.Descopera yahoo status-ul prietenilor tai sau celor care se ascund de tine.Descarca status-uri text GRATUITE, avatare de toate tipurile si utilitare de care nici nu stiai ca exista .</description>
<title>Yahoo status</title>
<title_cover>Yahoo status,Hi5 Detector</title_cover>
<image />
<modify>8/28/2009 3:19:12 PM</modify>
<idsection>3</idsection>
<id>9</id>
</Link>
<Link>
<url>http://www.yahoo-invisible.eu</url>
<description>Yahoo status invisible detector.Descopera yahoo status-ul prietenilor tai sau celor care se ascund de tine.Descarca status-uri text GRATUITE, avatare de toate tipurile si utilitare de care nici nu stiai ca exista .</description>
<title>Yahoo invisible</title>
<title_cover>Yahoo invisible, Hi5 Detector</title_cover>
<image />
<modify>8/28/2009 3:19:00 PM</modify>
<idsection>3</idsection>
<id>10</id>
</Link>
<Link>
<url>http://www.invisible-scanner.eu</url>
<description>Invisible scanner.Descopera cine sta pe invisible si/sau are cont Hi5.Invisible scanner iti ofera potibilitatea de a detecta pe cei care se ascund de prieteni lor.Deasemenea it mai ofera si posibilitatea de a detecta contul Hi5 al acestui id in cazul in care acesta exista.Incearca invisible scanner</description>
<title>Invisible scanner</title>
<title_cover>Invisible scanner, Hi5 Detector</title_cover>
<image />
<modify>8/28/2009 3:21:11 PM</modify>
<idsection>3</idsection>
<id>11</id>
</Link>
</Links>
</Section>
<Section>
<rank>2</rank>
<id>7</id>
<name>Blogs</name>
<name_cover>hnc</name_cover>
<picture />
<description>hd</description>
<Links>
<Link>
<url>http://popnadrian.pan-internet.com/</url>
<description>Pop Adrian Nicolae Internet Blog</description>
<title>Pop Adrian Nicolae</title>
<title_cover>Pop Adrian Nicolae, IT Blog</title_cover>
<image>http://paba.pan-internet.com/pictures/internet.png</image>
<modify>8/26/2009 6:20:55 AM</modify>
<idsection>7</idsection>
<id>8</id>
</Link>
</Links>
</Section>
<Section>
<rank>4</rank>
<id>8</id>
<name>Comunitati/Retele Sociale</name>
<name_cover>Retele sociale</name_cover>
<picture />
<description>Prietenii</description>
<Links>
<Link>
<url>http://www.status-yahoo.ro/buzzme</url>
<description>BuzzMe - Comunitatea in care te regasesti cu prieteni tai</description>
<title>Comunitatea buzzMe</title>
<title_cover>Comunitatea buzzMe</title_cover>
<image />
<modify>8/28/2009 3:45:44 PM</modify>
<idsection>8</idsection>
<id>17</id>
</Link>
</Links>
</Section>
<Section>
<rank>4</rank>
<id>5</id>
<name>Hotels/Resorts/Travel</name>
<name_cover>Hotels/Resorts/Travel</name_cover>
<picture />
<description>Your travel guide</description>
<Links>
<Link>
<url>http://www.worldlistofhotels.com</url>
<description>World hotels - Find a hotel that suits your tastes - Reviews of vacations, hotels, resorts, and anything you want</description>
<title>Hotels</title>
<title_cover>Hotels all around the world</title_cover>
<image />
<modify>8/28/2009 3:34:12 PM</modify>
<idsection>5</idsection>
<id>15</id>
</Link>
</Links>
</Section>
<Section>
<rank>4</rank>
<id>6</id>
<name>Auto/Moto/Velo</name>
<name_cover>hnc</name_cover>
<picture />
<description>hd</description>
<Links>
<Link>
<url>http://www.masini-second.net</url>
<description>Masini second,masini de vanzare, postari anunturi masini second GRATUITE fara limita,cautari masini second de vanzare</description>
<title>Masini second</title>
<title_cover>Masini second, anunturi auto</title_cover>
<image />
<modify>8/28/2009 3:24:19 PM</modify>
<idsection>6</idsection>
<id>12</id>
</Link>
<Link>
<url>http://www.anunturi-automobile.ro</url>
<description>Anunturi auto,anunturi masini second insotite de poze, statistica preturi si oferte pentru anunturi auto-masini second hand</description>
<title>Anunturi auto</title>
<title_cover>Anunturi auto, Masini second</title_cover>
<image />
<modify>8/28/2009 3:27:02 PM</modify>
<idsection>6</idsection>
<id>13</id>
</Link>
</Links>
</Section>
</Sections>
</Feed>
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div class="sections" xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:for-each select="Feed/Sections/Section">
<div class="section">
<h2 class="title">
<xsl:value-of select="name"/>
</h2>
<h3>
<xsl:value-of select="description"/>
</h3>
<xsl:if test="picture!=''">
<img>
<xsl:attribute name="src">
<xsl:value-of select="picture"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="name_cover"/>
</xsl:attribute>
</img>
</xsl:if>
<div class="links">
<xsl:for-each select="Links/Link">
<div class="link">
<a>
<xsl:attribute name="href">
<xsl:value-of select="url"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title_cover"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
<xsl:if test="image!=''">
<img>
<xsl:attribute name="src">
<xsl:value-of select="image"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title_cover"/>
</xsl:attribute>
</img>
</xsl:if>
<p>
<xsl:value-of select="description"/>
</p>
<p>
<xsl:value-of select="modify"/>
</p>
</div>
</xsl:for-each>
</div>
</div>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>
The transformation are made server side; here are the code that helps me to execute the transformation:
ASP:
protected void Page_Load(object sender, EventArgs e)
{
try
{
string xmlPath = Server.MapPath("~\\output\\s-2.xml");
string xslPath = Server.MapPath("~\\output\\paba.xslt");
lbl_curentlinks.Text = XsltTransform(xmlPath, xslPath);
}
catch { }
}
public static string XsltTransform(string xmlPath, string xslPath)
{
//Instantiate the XPathDocument Class
string s = "";
//if (System.IO.File.Exists(xmlPath))
//{
XPathDocument doc = new XPathDocument(xmlPath);
//Instantiate the XslTransform Class
XslTransform transform = new XslTransform();
transform.Load(xslPath);
//Custom format the indenting of the output document
//by using an XmlTextWriter
StringWriter wr = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(wr);
writer.Formatting = Formatting.Indented;
writer.Indentation = 4;
transform.Transform(doc, null, writer);
s = wr.ToString();
wr.Close();
writer.Close();
//}
return s;
}
PHP:
<?php
$xml = new DomDocument();
$xml->load('s-2.xml');
$xsl = new DomDocument();
$xsl->load('paba.xslt');
$proc = new xsltprocessor();
$proc->importStyleSheet($xsl);
echo($proc->transformToXML($xml));
?>
And this is how PABA goes live; we hope that it will increase our site trafic incoming, our incomiing.
4a02ca77-e242-4514-bdd5-38bdc1c0f0a7|0|.0