THE CODE WORD…..PHPXml ||a documentery by koyel banerjee

April 16, 2009

personal profile

Filed under: Uncategorized — kopecks89 @ 4:39 pm

full name: koyel banerjee

email: kopecks89@gmail.com

Availability: I can devote complete 3 months to this project. I can
work 6 to 10 hours/day (42 to 70 hours/week) depending on the work
load. I do not have any other obligations this summer till now.just in case i may have a mini project of about a week.

brief bio: i am a second year undergraduate student from dr.b.c.roy engineering college,west bengal.i have experience of using wordpress for about an year and i have also sound knowledge of php,my sql and html.i have done or rather participated  in a web designing project along with a friend which gave me a very good exposure on php and html.i also have satisfactory understanding about the wordpress themes.

April 15, 2009

whats the phpxml?

Filed under: Uncategorized — kopecks89 @ 7:55 am

PHPxml is a php class for accessing xml documents through the powerful xpath language without requiring the dom xml extensions to be set up on your server.the script makes xp path avalaible everywhere,even on sites that do not have this extension avalaible.

WHY WORDPRESS?

Filed under: Uncategorized — kopecks89 @ 7:52 am

WordPress started in 2003 with a single bit of code to mobilize creative thoughts and it had very limited users.Since then wordpress emerged as one of the largest self-hosted blogging tool,used on hundreds and thousands of sites and seen by tens and millions of people everyday!Wordpress is an open source project.It means that one is free to use it for anything from the cat’s home page to a fortune5 website without having to pay any license fee!

personally speaking i have used several bloggging concerns like the MSDN,fedoraproject.org,blogger,Ibibo ,bigadda,wordpress but among all of them wordpress definitly stands out.Noticable are its attractive features which and infrastructures.Recntly developing the buddypress coupled with wordpress MU is a remarkable one.the several handy features to create several blogs with just one installation is a very useful feature. i also tried out .NET blogging applications like the .TEXT and the dasblog.WELL the former also has single click blog installation feature which i liked.But the very simple and humble reason to apply in your concern is i love blogging and want to get a better hold over its infrastructure and i love using wordpress.

moreover i took some time to go through the works of the wordpress developers likeMicheal Adams,Nikolay Bachiyski,Donncha o Caoimh,Austin Matzko etc.I am inspired.

A FEW IMPORTANT NOTES

Filed under: Uncategorized — kopecks89 @ 7:33 am

DEAR SIR,

i think i have successfully able to present before my idea about the way i would like to proceed with the coding using phpxml.a few things i forgot to mention which i feel i must is that i have satisfactory knowledge about php,javascript,my sql,network solutions (HTML,DHTML).AM also recently planning to learn the asp.net.

once again i promise that if u give me a chance i’ll not let u down.

NOW COMES THE IMPORT

Filed under: Uncategorized — kopecks89 @ 7:28 am

The first thing we do is to create a new XsltProcessor object, this will allow us to process the xsl and perform our ‘transformation’:

PHP Code:
$xsltProcessor = new XsltProcessor();

Next we have to load the xsl document we just created then import it so that we can process it:

PHP Code:
// create a DOM document and load the XSL stylesheet
$xsl = new DomDocument;
$xsl->load('car.xsl');

// import the XSL styelsheet into the XSLT process
$xsltProcessor->importStylesheet($xsl);

Here we create a new DOMdocument object, load the xsl and then we pass it into the importStylesheet() method of XsltProcessor().

Next we need to load our XML file:

PHP Code:
// create a DOM document and load the XML
$xmlDoc = new DomDocument;
$xmlDoc->load('cars.xml');

Then we invoke the transformation, I’ve wrapped it in a try – catch to catch errors:

PHP Code:

try
{
$html = $xsltProcessor->transformToXML($xmlDoc);
echo
$html;
}
catch(
Exception $pEx)
{
echo
$pEx->getMessage();
}

That (hopefully) will display the complete page

sample coding

Filed under: Uncategorized — kopecks89 @ 7:25 am

Because XSL is still XML we must start it as we would an XML file:
xml Code:

<?xml version=’1.0′
The next line is an XMLns (XML Name Space) declaration, this is so that we can get access to the XSLT elements, attributes and features through the namespace ‘xsl’, the url just represents an URL that contains the list of elements, attributes and features that we can now use.
Next to define what output form our XSL will take:
xml Code:

<xsl:output method=’html/>

template:
xml Code:

<xsl:template match=”/”>

This is where a bit of xPath knowledge comes in, the match attribute is used to associate a template with an XML element. The value of the match attribute is an XPath expression (i.e. match=”/” defines the whole document, because “/” in xPath is used to select the root node) so starting a template for the whole document.

now some html to start buiding up the template:
xml Code:

<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″ />
<title><xsl:value-of select=”$title”/></title>

normal html tags <head>/<meta>/<title> then im back into an xsl tag:
that one little tag grabs the data from it.
Parameters allow us to have values that we can access from anywhere within the XSL file, the way we access them is by using the value-of method, normally this is used to get values of XML element by using an xPath statement like ‘car/name’ but because we prefixed the name with ‘$’ it knows that it is a parameter and not an XML element we want.
So basically that produces the HTML code:
html Code:

<title>Car List Generated by PHP/XML/XSTL</title>
getting back into HTML again (tags aren’t prefixed with xsl, so the xsl parser will just ignore them and present them to the browser ‘as is’, a bit like the way php ignores any html outside of the <?php ?> tags.

THE NEXT HALF OF CODING TO START AN STYLE TAG WITH SOME CSS FEED IS TO COME NEXT.

wordpress tool wonders

Filed under: Uncategorized — kopecks89 @ 7:10 am

Well to start with this is a overview about the project i intend to do for gsoc 2009.I have tried to sum up my understanding of the mentioned problem statement regarding the import/export operation of blogs and a few ideas on how i plan to resolve it throughout my working period if im given a chance.
Generally the import of blogs makes use of various links which allows you to transfer any comment or post submitted by you on another blog into your own blog.Precisely,for example blogs categorized under blogroll import links in OPML format, while from live journals posts are imported ussing their API.
Next comes the export tool.As soon as one clicks on the button of ‘ download to computer’ wordpress creats an xml  format file to save in the computer.Thereafter we perform the import function in the other blog to transfer these saved files from the desktop.This saved xml file has all the posts,comments,tags etc from the respective blog that are to be exported.
Thus we see in the import/export operation an intermediate file sytem is created in the desktop.This project on the otherhand  aims to find out a way to directly link the two blogs without having to upload the xml format files from the desktop.Thereby making blogging more easier and userfriendly.
one such possiblity is making use of the rss feed.RSS is a protocol, an application of XML, that provides an open method of syndicating and aggregating Web content. Using RSS files, you can create a data feed that supplies headlines, links, and article summaries from your Web site. Users can have constantly updated content from web sites delivered to them via a news aggregator, a piece of software specifically tailored to receive these types of feeds. RSS is the hottest thing in Web communication. It powers many popular applications such as weblogs, knowledge management networks, and news syndication. in word of Chad Dickerson, the Chief Technology Officer at at InfoWorld describes the change:
I felt like RSS had completely turned the corner at InfoWorld when the various constituenices at InfoWorld (sales, editorial, and technology) agreed to include links to our feeds prominently on our home page. Getting something on the home page is recognition that something has been politically mainstreamed within an organization. So, what’s my point? RSS is now burned into InfoWorld’s organizational brain like the words Kleenex and Xerox.
The second approach to tackle this problem is withe help of phpxml file documents.its like   Generating XML from a Mysql DB with PHP’s DOM functions .XML is a standard for creating markup languages which describe the structure of data, and it comes in very handy, for example Ajax uses xml to transfer data between server and client, through xmlhttprequest.
Another very interesting thing about phpxml is that  we can apply a style sheet to XML and produce HTML from it, the style sheets are called XSL or eXtensible Stylesheet Language.
There are 3 main ways of doing this:
the first way is to add a XSL style sheet to an XML file then let the browser do the ‘transformation’ in other words render the xml data according to the XSL style, much like css. Although this method works, it wont however work on non XSLT aware browsers.

The second way of doing it is by using javascript to do the transformation, but, once again, browser incompatibilities limit the success of this method.

The third way is to use PHP(or any other server side script like php or asp will do the trick) to do the transformation, then generate the HTML so that any browser can see it properly

April 14, 2009

Hello world!

Filed under: Uncategorized — kopecks89 @ 9:42 am

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Create a free website or blog at WordPress.com.