亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? creating truly skinnable web sites.html

?? a collection of mega hacking tools
?? HTML
字號:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

	<title>Creating Truly Skinnable Web Sites (ver. 1.0.0) </title>

	

	<meta http-equiv="Content-Type" content="text/html charset=utf-8" />

	<meta content="Copyright 2002 SpiderMan" name="Copyright" />

	<meta content="SpiderMan" name="Author" />

	<meta content="English" name="Language" />

	

	<style type="text/css">

	<!--

		body {font: 12px Verdana, Arial, Helvetica, sans-serif}



		p {text-align: left;}

		p.para {text-indent: 12px}



		div.lastupdate {text-align: right}

		/* hack so IE will center my stuff since it doesn't recognize margin: auto */

		div.center {text-align: center}

	

		a:link {text-decoration: underline; color: #003F7F}

		a:visited {text-decoration: underline; color: #003F7F}

		a:hover {text-decoration: underline; color: #CC0000}



		h2 {font-size: 12px}

		h1.title {font-weight: normal; text-align: center; font-size: 12px}



		pre.example {background-color: #EBEBEB; border: 1px solid #000000; padding: 3px; text-align: left; width: 570px; margin-left: auto; margin-right: auto}

	-->

	</style>

</head>



<body>

	<h1 class="title">

		<strong>Creating Truly Skinnable Web Sites (ver. 1.0.0)</strong>

		<br />

		by: <a href="mailto:spiderman@witty.com">SpiderMan</A> of <a href="http://blacksun.box.sk">Black Sun Research Facility </a>

	</h1>

	<p class="para">

		A few months back, while working on bread5 (my new, at that time, 

		ultra-secret web site), I had a thought: wouldn't it be cool if I could serve up

		bread5 with any look I wanted, without having to create entire sites with

		different layouts by hand. I didn't want to just change the color scheme like

		most &#8220;skinnable&#8221; sites; I wanted to create completely different looks without

		going through too much trouble. The skin engine that I created for bread5 uses a

		host of new technologies to accomplish its tasks; these technologies include 

		php, XML, XSLT, and XHTML. I've never seen anyone create dynamic sites that are 

		truly skinnable, so this is all new and uncharted territory for me. As a result, 

		the method I describe in this article may not be the best way to do this, but I 

		think it works very well. This is an advanced tutorial. The reader should be

		familar with PHP and XML.

	</p>

	<p class="para">

		The idea is simple: when one wants to create different versions of one's 

		site, all the data is the same, the only thing that has changed is the layouts. 

		So joe-webmaster makes up some layouts then goes at the task of 

		copying-and-pasting his site's data into these layouts. He does this over and 

		over for every page on his site. There must be a better way&#8212;there is. Since the 

		site's data (such as product information) is the same for every layout, put all 

		the data in an XML file and transform the data into the completely different 

		layouts using XSLT. So, if I wanted to create a new skin for bread5, all I would 

		have to do is create a few XSL files for the skin, upload it to the server, and 

		it's done; the user can choose whichever skin he or she wants to view the site 

		in. Using this method, you can increase the accessibility of your site just by 

		creating screen reader and WAP compatible skins. In a few minutes your site can 

		now be easily accessed by a women using her cell phone, or a blind man sitting 

		at home.

	</p>

	<p class="para">

		To get started, take your data and put it in an XML file. For example, a 

		site's index page might look like this:

	</p>

	<div class="center">

		<pre class="example">

&lt;?xml version="1.0" encoding="UTF-8"?&gt;



&lt;mySite page="index" title="Welcome to my site!"&gt;

  &lt;linkbar&gt;

    &lt;item type="link"&gt;

      &lt;uri&gt;./faq.php&lt;/uri&gt;

      &lt;title&gt;FAQ&lt;/title&gt;

      &lt;desc&gt;Frequently Asked Questions about this site&lt;/desc&gt;

    &lt;/item&gt;

    &lt;item type="form"&gt;

      &lt;action&gt;./search.php&lt;/action&gt;

      &lt;method&gt;post&lt;/method&gt;

      &lt;input type="text" name="search" maxlength="100"/&gt;

    &lt;/item&gt;

    &lt;!-- other links --&gt;

  &lt;/linkbar&gt;	

  &lt;greeting&gt;

    &lt;para&gt;

      Welcome to my site!

    &lt;/para&gt;

    &lt;para&gt;

      Please check out all the sections.

    &lt;/para&gt;

  &lt;/greeting&gt;

  &lt;news&gt;

    &lt;news-story&gt;

      &lt;date&gt;November 29, 2001&lt;/date&gt;

      &lt;story&gt;Some stuff happened.&lt;/story&gt;

    &lt;/news-story&gt;

    &lt;news-story&gt;

      &lt;date&gt;November 30, 2001&lt;/date&gt;

      &lt;story&gt;Some more stuff happened.&lt;/story&gt;

    &lt;/news-story&gt;

  &lt;/news&gt;

&lt;/mySite&gt;

</pre>

	</div>

	<p>

		Looks pretty simple, but it can be improved upon to make it even easier for

		us to maintain. Instead of adding a news story by manually editing the file, I'd

		like to pull the stories out of my database. That way, I can create a simple 

		script to put my news in the database and then I can easily add news stories

		without having to FTP in to the server and edit the file.

	</p>

	<p class="para">

		We'll be using php's XSLT extension, Sablotron, to transform the XML file 

		(discussed later on), so why not use its power to add dynamic content to the XML 

		file also? It's easy to do. Just have php hold the XML data, pass it to 

		Sablotron and have it pass the data to the XSL file. For example, to pull news

		stories out of a MySQL database and have it added to the XML file, we would do

		the following:

	</p>

	<div class="center">

		<pre class="example">

// code to connect to the database and pull the stories omitted for brevity.

// $db_query holds an SQL query to pull news stories out of the database. 

$xsltArgs["stories"]="&lt;news-story&gt;";



while($row= mysql_fetch_array($db_query)

{

  $date= $row["date"];

  $story= $row["story"];



  $xsltArgs["stories"].="

      &lt;date&gt;$date&lt;/date&gt;

      &lt;story&gt;$story&lt;/story&gt;";

}



$xsltArgs["stories"].="&lt;/news-story&gt;";

</pre>

	</div>

	<p>

		$xsltArgs is an array. $xsltArgs["stories"] holds the XML for the news stories. 

		This variable will be used later when the transformation takes place. If you 

		want to add more dynamic data to your site, store it as XML in another slot of 

		the array.

	</p>

	<p class="para">

		Now that we've created the XML file for the index page, we can create an XSL 

		file that will be used by Sablotron to transform the XML file. Here is an XSL 

		file that will transform the XML file into a simple XHTML web page.

	</p>

	<div class="center">

		<pre class="example">

&lt;?xml version="1.0" encoding="UTF-8"?&gt;



&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

  &lt;xsl:output indent="yes" encoding="utf-8" method="xhtml"/&gt;

	

  &lt;xsl:template match="/"&gt;

    &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;

    &lt;head&gt;

      &lt;title&gt;My Web Site - &lt;xsl:value-of select="mySite/@title" /&gt;&lt;/title&gt;

      &lt;meta content="My homepage!" name="Description" /&gt;

      &lt;meta content="My, stuff, cool page" name="Keywords" /&gt;

      &lt;meta content="ALL" name="Robots" /&gt;

      &lt;meta content="Copyright 2001 Joe-Webmaster" name="Copyright" /&gt;

      &lt;meta content="Joe-Webmaster" name="Author" /&gt;

      &lt;link href="main.css" rel="stylesheet" type="text/css" /&gt;

    &lt;/head&gt;

		

    &lt;body&gt;

      &lt;br /&gt;

      &lt;xsl:call-template name="linkbar" /&gt;

      &lt;br /&gt;

      &lt;xsl:call-template name="content" /&gt;

    &lt;/body&gt;

    &lt;/html&gt;

  &lt;/xsl:template&gt;

	

  &lt;xsl:template name="linkbar"&gt;

    &lt;xsl:for-each select="mySite/sidebar/item"&gt;

      &lt;xsl:if test='@type="link"'&gt;

        &lt;a href="{uri}" title="{desc}"&gt;&lt;xsl:value-of select="title" /&gt;&lt;/a&gt;&lt;br /&gt;

      &lt;/xsl:if&gt;

      &lt;xsl:if test='@type="form"'&gt;

        &lt;form method="{method}" action="{action}"&gt;

          &lt;xsl:for-each select="input"&gt;

            &lt;input class="search" type="{@type}" name="{@name}" size="10" 

            value="Search" maxlength="{@maxlength}" /&gt;

          &lt;/xsl:for-each&gt;

        &lt;/form&gt;

      &lt;/xsl:if&gt;

    &lt;/xsl:for-each&gt;	

  &lt;/xsl:template&gt;

	

  &lt;xsl:template name="content"&gt;

    &lt;strong&gt;&lt;xsl:value-of select="mySite/@page" /&gt;&lt;/strong&gt;

    &lt;br /&gt;

    &lt;xsl:for-each select="mySite/greeting/para"&gt;

      &lt;p&gt;

        &lt;xsl:value-of select="."/&gt;

      &lt;/p&gt;

    &lt;/xsl:for-each&gt;

      &lt;hr width="454" align="center" /&gt;

      &lt;span class="news"&gt;News::&lt;/span&gt;

      &lt;br /&gt;

      &lt;div class="news"&gt;

        &lt;xsl:for-each select="document('arg:/stories')/news-story"&gt;

          &lt;span class="newstime"&gt;&lt;xsl:value-of select="date" /&gt;&lt;/span&gt;

          &lt;div class="newsitem"&gt;

            &lt;xsl:value-of select="story" /&gt;

          &lt;/div&gt;

          &lt;br /&gt;

        &lt;/xsl:for-each&gt;

      &lt;/div&gt;

  &lt;/xsl:template&gt;

	

&lt;/xsl:stylesheet&gt;

</pre>

	</div>

	<p>

		You could repeat this and create many different XSL files to output many

		different pages (such as a WML page for viewing on a WAP enabled device). If you

		stored more dynamic content in another slot of the $xsltArg array, you can

		retrieve it in your XSL file by using:

	</p>

	<div class="center">

		<pre class="example">

document('arg:/&lt;name of slot&gt;')

</pre>

	</div>

	<p>

		where &lt;name of slot&gt; would be the name of the slot in the array.

	</p>

	<p class="para">

		Now all that is left to do is apply the XSL transformation to the XML file. 

		To do this, I use php's XSLT extension, Sablotron. I should mention that 

		Sablotron is not enabled in default php installations. To activate it on a *nix

		machine, run the following:

	</p>

	<div class="center">

		<pre class="example">

./configure --enable-xslt --with-xslt-sablot

</pre>

	</div>

	<p>

		If you're being hosted by someone else, ask them to do it for you. I chose a

		server side transformation because many browsers lack the ability to do 

		transformations on the client end. By doing the transformation on the server,

		you're guaranteed that the transformation will occur.

	</p>

	<p class="para">

		The simplest way to use XSLT in php is to pass the path to both the XML file 

		and the XSL file to the xslt_run() function like this:

	</p>

	<div class="center">

		<pre class="example">

// First create an XSLT processor.

$xh= xslt_create();



// $xsl holds the path to the XSL file. $xml holds the path to the XML file.

xslt_run($xh, $xsl, $xml, "arg:/_result", NULL, $xsltArgs); 



$result= xslt_fetch_result($xh);



// Finally, free the XSLT processor since we're done using it.

xslt_free($xh);

</pre>

	</div>

	<p>

		The $result variable will hold the transformed page which you can then output

		using echo or do whatever else you may want to do.

	</p>

	<p class="para">

		The transformation process is a bit different on servers running PHP 4.1 and 

		above. I believe, for completeness, I should explain how it is done. If you're

		running a lower of version of php, feel free to skip this part. With the advent

		of PHP 4.1, a new interface to the XSLT engine has been added. Now, to transform 

		an XML file, one does the following:

	</p>

	<div class="center">

		<pre class="example">

// First create an XSLT processor.

$xh = xslt_create();



// Next, pass either two variables, one holding the path to an XSL file and one 

// holding the path to an XML file. $result holds the transformed data. 

$result= xslt_process($xh, $xsl, $xml, NULL, $xsltArgs);



// Finally, free the XSLT processor since we're done using it.

xslt_free($xh);

</pre>

	</div>

	<p class="para">

		There you have it, a simple way to create truly skinnable web sites. What I've 

		just described is pretty basic, you can improve on it. For example, you can have 

		php automatically determine if the user is on a WAP device and have it serve up 

		a WAP page. Also, you can create many skins and have a page that displays a 

		screen shot of each skin, letting the user choose which one he or she wants to 

		view the site with. Then, you can store the user's choice in a cookie, so the 

		next time the user visits the site, the skin he or she chose is already applied. 

		I hope you learned a lot from this tutorial and start using this technique. As 

		always, if you find any errors or have any comments please send them to me 

		(<a href="mailto:spiderman@witty.com" title="Click to e-mail me.">spiderman@witty.com</a>). Kindly direct questions to the message board. Until next time...

	</p>

	<h2>Refrences:</h2>

	<ul>

		<li><a href="http://www.php.net/manual/en/ref.xslt.php" target="_blank" title="Link opens in a new browser window.">http://www.php.net/manual/en/ref.xslt.php</a></li>

		<li><a href="http://www.gingerall.com/charlie/ga/act/gadoc.act?pg=sablot" target="_blank" title="Link opens in a new browser window.">http://www.gingerall.com/charlie/ga/act/gadoc.act?pg=sablot</a></li>

	</ul>

	<div class="lastupdate">Last updated: <strong>12/22/01</strong></div>

</div>

</body>

</html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区四区| 精品久久久网站| 高清不卡一区二区在线| 精品一区二区av| 久久国产精品99精品国产| 久久99精品久久久久久动态图| 91高清视频在线| 日本高清视频一区二区| 欧美日韩一区二区电影| 欧美精品乱码久久久久久按摩| 激情综合一区二区三区| 韩国一区二区三区| 一区二区成人在线观看| 三级欧美在线一区| 亚洲国产精品精华液2区45| 最新国产の精品合集bt伙计| 亚洲天堂精品在线观看| 亚洲.国产.中文慕字在线| 国产拍欧美日韩视频二区| 91精彩视频在线观看| 欧美日韩1234| 久久综合九色综合久久久精品综合| 在线观看免费成人| 欧美一区二区三区免费在线看| 成人亚洲一区二区一| 91看片淫黄大片一级在线观看| 蜜桃av噜噜一区| 视频一区二区三区在线| 国产成人午夜精品影院观看视频| 日韩精品免费专区| 国产成人啪午夜精品网站男同| 亚州成人在线电影| 成人污污视频在线观看| 欧美日韩卡一卡二| 欧美在线你懂的| 国产亚洲精品bt天堂精选| 91精品国产高清一区二区三区蜜臀 | 日韩成人午夜电影| 国产一区二区调教| 国产一区二区三区久久久 | 99精品视频在线观看| 国产激情视频一区二区三区欧美 | 亚洲制服丝袜一区| 国产精品一区二区三区四区| 色综合久久精品| 国产精品区一区二区三| 亚洲v精品v日韩v欧美v专区| 国产福利一区二区三区在线视频| 国模一区二区三区白浆| 欧美日韩精品福利| 日韩区在线观看| 久久伊人蜜桃av一区二区| 精品久久久久久久久久久久久久久久久| 日本韩国一区二区三区视频| 精品国产不卡一区二区三区| 天堂午夜影视日韩欧美一区二区| 日韩在线a电影| 日本韩国欧美在线| 日韩一区中文字幕| 高清日韩电视剧大全免费| 精品国产一区二区精华| 国产亚洲午夜高清国产拍精品 | 国产成人亚洲综合a∨婷婷图片| 国产成人午夜精品影院观看视频| 国产.欧美.日韩| 久久综合视频网| 久草这里只有精品视频| 成人app在线观看| 2023国产精华国产精品| 国产一区二区三区国产| 久久一区二区三区国产精品| 美国精品在线观看| 日韩欧美国产小视频| 久久国产日韩欧美精品| 精品对白一区国产伦| 激情国产一区二区| 中文字幕不卡的av| 亚洲地区一二三色| 在线不卡a资源高清| 丝袜亚洲另类丝袜在线| 高清成人在线观看| 亚洲视频在线观看三级| 日本黄色一区二区| 日韩不卡一区二区| 99re视频这里只有精品| 一区二区三区中文在线| 国内精品久久久久影院一蜜桃| 91丝袜高跟美女视频| 亚洲一二三四在线观看| 欧美精品三级日韩久久| 久久精品国产秦先生| 国产欧美一区在线| 日本乱码高清不卡字幕| 日本中文字幕不卡| 国产天堂亚洲国产碰碰| 五月综合激情婷婷六月色窝| 日韩精品一区二区三区中文不卡| 亚洲男同1069视频| 日韩一级片在线播放| 福利91精品一区二区三区| 亚洲一区二区三区在线看| 日韩欧美国产一区二区三区 | 欧美一区二区三区在线观看视频| 中文在线一区二区| 在线观看日韩高清av| 免费成人在线影院| 亚洲图片欧美激情| 日韩一卡二卡三卡| 99久久精品99国产精品| 麻豆91在线播放| 中文字幕一区二区三区四区 | 欧美在线免费观看亚洲| 亚洲午夜一区二区| 日韩久久精品一区| 在线视频你懂得一区| 综合亚洲深深色噜噜狠狠网站| 成人动漫中文字幕| 久久99精品久久久| 亚洲国产日韩一区二区| 国产精品蜜臀在线观看| 日韩视频一区二区三区在线播放| 五月婷婷激情综合| 中文字幕亚洲电影| 日韩精品一区二区在线| 欧美自拍偷拍一区| 99re热这里只有精品免费视频| 1024精品合集| 国产日韩亚洲欧美综合| 波多野洁衣一区| 国产精品一区二区三区乱码| 久久精品一区二区三区不卡| 黄色小说综合网站| 男女激情视频一区| 五月天激情综合网| 亚洲va韩国va欧美va精品| 国产精品灌醉下药二区| 欧美激情中文字幕| 国产亚洲精品aa| 国产婷婷精品av在线| 欧美精品一区二区在线播放| 777色狠狠一区二区三区| 久久精品国产免费| 久久精品国产久精国产爱| 婷婷开心久久网| 日韩国产欧美在线视频| 丝袜美腿高跟呻吟高潮一区| 亚洲一区二区三区三| 亚洲免费视频中文字幕| 综合中文字幕亚洲| 亚洲黄色性网站| 亚洲一区二区三区美女| 日韩欧美国产麻豆| 99精品欧美一区| 成人午夜视频免费看| 成人免费高清在线| 99视频在线精品| 91极品美女在线| 欧美日韩国产电影| 日韩一区二区高清| 91一区一区三区| 欧美私模裸体表演在线观看| 精品一区二区三区在线观看 | 一区二区三区在线免费| 亚洲综合自拍偷拍| 日韩成人一级大片| 国产成人av一区| 色综合天天综合狠狠| 麻豆国产一区二区| 国产福利不卡视频| 91久久线看在观草草青青| 欧美日韩一区高清| av激情亚洲男人天堂| 99国产精品久| 国产麻豆一精品一av一免费 | 国产呦精品一区二区三区网站| 亚洲精品菠萝久久久久久久| 日韩一卡二卡三卡四卡| 一本色道亚洲精品aⅴ| 欧美系列一区二区| 成人黄色网址在线观看| 欧美午夜一区二区| 亚洲精品一区二区精华| 亚洲色图.com| 欧美国产乱子伦| 亚洲高清免费观看高清完整版在线观看| 久久久午夜精品| 亚洲欧美日韩国产成人精品影院| 久久奇米777| 欧美v日韩v国产v| 日韩一区二区高清| 中文字幕一区二区视频| 蜜桃av噜噜一区二区三区小说| 亚洲国产日韩a在线播放性色| 日韩一区在线看| 亚洲欧美中日韩| 九九热在线视频观看这里只有精品| 亚洲国产精品一区二区久久恐怖片| 亚洲免费在线看| 国产精品1区2区| 日韩无一区二区|