Tuesday, October 18, 2005

SSI 和 document.write()

这两天一直在考虑怎么给 Blogger 加上 Calendar 和分类的功能。原来是这么打算的:

首先,要让生成的 HTML 代码尽量符合 XHTML 规范,以便可以写程序用 XML 解析器来分析并从中提取数据。只要是合法的 XML,应该问题就不大,不一定要完全遵循 XHTML 的 DTD,反正 Dom4J 没有 DTD 照样能分析 XML,不过,这个还有待试验证实。

Blogger 的帖子数据里面,link 这个字段似乎没有什么用,可以利用它来存储分类。通过程序分析提取以后,套用 Blogger 的模板生成 HTML,并把出现过的分类列表写到一个单独的 HTML 中,由需要的页面通过 SSI include 进来。

同样利用分析出来的数据,生成日历的 HTML,每个月一个文件,供需要的页面调用。

不过,要让 Resin 支持 SSI 功能,可能性不太大,必须另外想办法。

昨天给 BlogBus 做模板,发现这个 Blog 的默认模板里头,所有侧边栏(日历,最近贴,存档,Tags 等)全部都是由 JavaScript 来 document.write() 的,而 JavaScript 代码本身,也貌似是发布的时候根据数据动态产生的,估计这个是为了达到这些数据块可以在需要的地方重复调用的目的。

于是,我想,是不是我也可以将 Blogger 里头需要的 Calendar 和分类数据也在发布时用 Servlet 写成 JavaScript,然后再在需要的地方用这些 JavaScript 来 document.write()

嗯,有空试验一下就知道了…… 理论上应该是可行的……

Updated on 11/13/2005:

经过试验,用 document.write() 方式输出是可行的,现在此 blog sidebar 上的日历就是用 document.write() 打印出来的,而数据是由 Servlet 分析生成的 HTML 文件后自动写的 JavaScript 代码。问题有两个,一是用 Dom4j 解析的时候,对实体 (entities) 的解析有点问题,要把除 & 以外的所有实体全部清楚掉才能解析正确,应该有正确的识别方法,尚在研究中。另一个问题是,documents.write() 写出来的内容,无法被搜索引擎识别,但对网站本身功能影响不大。

22 comments:

郁也风 said...

晕,原来你是自己写程序解析这些东东的啊^_^

我还以为blogger有啥隐藏开关呢

Gregory said...

呵呵,Blogger 除了缺少一些 Blog 流行的功能以外,其它都挺好的……

Angelo said...

請問要如何在blogger beta 加上 canender ?

Anonymous said...

Right here is the right webpage for everyone who really wants to understand
this topic. You realize so much its almost tough to argue with you (not that
I really will need to…HaHa). You certainly put a fresh
spin on a topic which has been written about for ages.
Great stuff, just wonderful!

Review my web site: minecraft net

Anonymous said...

Excellent blog! Do you have any recommendations for aspiring writers?
I'm hoping to start my own blog soon but I'm a
little lost on everything. Would you recommend starting with a free platform like Wordpress or go for a
paid option? There are so many choices out there that I'm completely overwhelmed ..
Any tips? Thank you!

Here is my page - download RP generator (goo.gl)

Coach Factory said...

ferragamo shoes, supra shoes, abercrombie and fitch, ray ban pas cher, wedding dresses, nfl jerseys, reebok outlet, hermes, juicy couture outlet, air max, lululemon, p90x, ghd, timberland, mulberry, lancel, hogan, new balance shoes, birkin bag, mont blanc, asics, nike air max, ugg boots, soccer jerseys, hollister, rolex watches, north face outlet, beats by dre, montre pas cher, nike free, louis vuitton, ugg boots, herve leger, chi flat iron, vans, ralph lauren, oakley pas cher, jimmy choo, insanity, converse shoes, louis vuitton, karen millen, celine handbags, bottega veneta, marc jacobs, soccer shoes, mcm handbags, yoga pants, burberry, valentino shoes

Coach Factory said...

oakley outlet, moncler outlet, oakley vault, rayban, ray-ban, canada goose outlet, oakley vault, oakley sunglasses cheap, cheap sunglasses, cheap oakley, ugg boots, ugg, ray ban, ralph lauren, oakley vault, ray ban outlet, raybans, ray ban, cheap sunglasses, ray ban sunglasses outlet, louboutin, oakley, cheap sunglasses, canada goose, canada goose, canada goose, cheap oakley sunglasses, cheap oakley sunglasses, ray bans, oakley sunglasses outlet, oakley sunglasses cheap, oakley sunglasses outlet, discount oakley sunglasses, ray ban, ray bans, rayban, cheap oakley sunglasses, tn pas cher, ray ban outlet, oakley outlet, oakley outlet, moncler, oakley sunglasses outlet, canada goose, gucci, moncler, moncler, canada goose outlet, oakley sunglasses cheap

Coach Factory said...

coach factory, oakley sunglasses, polo ralph lauren outlet, kate spade outlet, michael kors, ray ban sunglasses, michael kors outlet, louboutin, ray ban, longchamp, louis vuitton handbags, air jordan, louboutin, prada handbags, gucci outlet, oakley sunglasses, prada outlet, coach outlet store, nike shoes, louis vuitton, polo ralph lauren, air max, michael kors outlet, louboutin, michael kors outlet, toms shoes, tory burch outlet, burberry outlet online, tiffany and co, air max, jordan shoes, nike air max, coach outlet, true religion jeans, oakley sunglasses, ray ban sunglasses, burberry outlet online, nike free, michael kors, true religion outlet, louis vuitton outlet online, true religion, chanel handbags, polo ralph lauren outlet, coach purses, nike air max, nike free, ralph lauren, longchamp outlet

Guo Guo said...

air max 90
bottega veneta outlet
nike air max uk
nike huarache
custom mlb jerseys
surpa sneakers
coach outlet
seattle seahawks jerseys
the north face uk
kansas city chiefs jerseys
nike outlet store
atlanta falcons jersey
chanel handbags
green bay packers jerseys
michael kors uk
los angeles clippers jerseys
burberry outlet
dallas cowboys jersey
nike running shoes
arizona cardinals jerseys
oakley sunglasses canada
the north face outlet
oakley sunglasses
real madrid jersey
cleveland cavaliers jersey
pittsburgh steelers jersey
north face jackets
soccer shoes
mizuno running
san francisco 49ers jerseys
dansko outlet
new orleans saints jerseys
new york jets jerseys
air jordan shoes
los angeles lakers jerseys
north face outlet
mulberry uk
hermes belt
stuart weitzman boots
washington redskins jerseys
wei20150610

oakleyses said...

oakley sunglasses, longchamp outlet, ugg boots, chanel handbags, nike air max, longchamp, christian louboutin outlet, michael kors outlet, oakley sunglasses, tiffany and co, replica watches, tory burch outlet, nike air max, ray ban sunglasses, michael kors outlet, louboutin shoes, jordan shoes, louis vuitton outlet, louis vuitton, ray ban sunglasses, longchamp outlet, polo ralph lauren outlet, replica watches, kate spade outlet, oakley sunglasses, polo ralph lauren outlet, cheap oakley sunglasses, ugg boots, nike free, tiffany jewelry, michael kors outlet, uggs on sale, louis vuitton outlet, michael kors, oakley sunglasses, louboutin, louis vuitton, michael kors outlet, ray ban sunglasses, prada handbags, louis vuitton, burberry, burberry outlet online, gucci outlet

oakleyses said...

nike blazer, michael kors, nike free run uk, nike air max, true religion jeans, true religion jeans, air jordan pas cher, nike air max, ralph lauren uk, timberland, air max, nike roshe, tn pas cher, louboutin pas cher, true religion outlet, vans pas cher, coach outlet, hermes, ralph lauren pas cher, nike free, coach purses, michael kors, oakley pas cher, mulberry, hollister pas cher, lacoste pas cher, new balance pas cher, ray ban pas cher, vanessa bruno, burberry, hollister, michael kors, kate spade handbags, coach outlet, abercrombie and fitch, lululemon, coach factory outlet, nike roshe run, north face, nike air max, ray ban uk, michael kors, true religion jeans, converse pas cher, north face, air force, hogan, sac longchamp, longchamp pas cher, sac guess

oakleyses said...

ferragamo shoes, iphone 6s plus cases, babyliss, longchamp, reebok shoes, nike trainers, asics running shoes, oakley, iphone 5s cases, celine handbags, hollister, nfl jerseys, jimmy choo shoes, birkin bag, iphone 6s cases, iphone cases, mcm handbags, bottega veneta, giuseppe zanotti, iphone 6 plus cases, abercrombie and fitch, p90x workout, beats by dre, herve leger, north face outlet, instyler, louboutin, soccer jerseys, lululemon, nike roshe, s5 cases, timberland boots, mac cosmetics, soccer shoes, valentino shoes, insanity workout, vans shoes, hollister, ralph lauren, wedding dresses, ipad cases, chi flat iron, north face outlet, iphone 6 cases, nike air max, ghd, mont blanc, baseball bats, new balance, nike huarache

oakleyses said...

ugg pas cher, vans, moncler, moncler, canada goose, louis vuitton, ugg boots uk, canada goose, toms shoes, doudoune canada goose, moncler, louis vuitton, louis vuitton, ugg australia, juicy couture outlet, moncler, supra shoes, doke gabbana outlet, gucci, karen millen, moncler outlet, hollister, moncler, hollister, canada goose, louis vuitton, ray ban, marc jacobs, pandora jewelry, michael kors outlet online, moncler, swarovski crystal, pandora jewelry, wedding dresses, thomas sabo, moncler, bottes ugg, sac louis vuitton pas cher, nike air max, barbour, barbour jackets, pandora charms, canada goose outlet, canada goose uk, michael kors outlet, converse outlet, links of london, canada goose outlet, pandora charms, canada goose

chenlili said...

chenlili20160629
air force 1
louboutin shoes
oakley vault
michael kors handbags
retro 11
ray ban sunglasses outlet
michael kors outlet
polo ralph lauren
coach outlet store online
adidas originals
tory burch handbags
coach outlet
louis vuitton purses
michael kors handbags
ray ban sunglasses outlet
coach outlet store online
rolex watches
designer handbags
louis vuitton bags
nike sb dunks
louis vuitton outlet stores
rolex watches
louis vuitton outlet
giuseppe zanotti outlet
ray ban sunglasses
nike blazers uk
ray ban sunglasses
coach outlet
nike store
ray ban sunglasses outlet
coach outlet
ghd hair straighteners
jordan retro 4
louis vuitton purses
coach outlet store online clearances
asics outlet
polo ralph lauren
nike sb janoski
jordan 3 white cenment

Gege Dai said...

jianbin0701
michael kors outlet
mcm outlet
michael kors outlet online
hermes outlet
nike air max
reebok shoes
michael kors outlet
replica watches
rolex watches
fitflops sale clearance
coach outlet online
coach outlet online
ferragamo outlet
camisetas futbol baratas
nike uk store
mulberry bags
louis vuitton neverfull sale
oakley sunglasses
mulberry handbags sale
michael kors uk outlet
tory burch outlet
louis vuitton outlet online
michael kors outlet
cheap mlb jerseys
soccer jerseys wholesale
michael kors uk
coach handbags outlet
louboutin pas cher
adidas uk store
toms outlet
lacoste shirts
oakley sunglasses uk
tory burch outlet
chrome hearts outlet

dong dong23 said...

adidas yeezy
nhl jerseys
tods shoes
oakley sunglasses
gucci outlet
cheap ray ban sunglasses
canada goose sale
louis vuitton outlet
kate spade
coach outlet
201610.19wengdongdong

Karen said...

This NFL Flag for Washington Redskins is constructed of polyester, measures 3x5 feet, and has two metal grommets for attaching to our 6' aluminum flagpoles or any of our tailgate pole systems. The perimeter of our NFL Flag for Washington Redskins is double stitched and the team logos are screen printed into the flag so they won't peel. Because of its large size, these flags are great to hang on any wall in your game room, sports room, garage.

stars and stripes flags,
football flags salecheap St.Louis Rams house divided flags
Falcons house divided flags

Karen said...

Proprio come la scorsa stagione, il Galatasaray 16-17 kit di casa pantaloncini sono rossi. La novità di quest’anno sono le calze che sono di colore giallo per completare una combinazione insolita che è in linea con la maggior parte degli altri kit di Nike per la stagione 2016-17maglie calcio 2017,
maglie calcio poco prezzo, Maglia real madrid a poco prezzo 2017
nuove Maglia Atletico Madrid prezzo

琐事 said...

michael kors handbags wholesale
cheap nfl jerseys wholesale
instyler max 2
nike huarache trainers
ed hardy outlet
pandora charms
michael kors handbags sale
tiffany and co outlet
lebron shoes
longchamp le pliage

chenmeinv0 said...

cheap nhl jerseys
canada goose sale
coach outlet store online clearances
canada goose jackets
coach factory outlet
abercrombie kids
ugg clearance
polo ralph lauren
canada goose jackets
michael kors outlet online
2016.11.14xukaimin

xumeiqing said...

20161117meiqing
nike store
christian louboutin
canada goose outlet
uggs outlet
polo outlet
levis outlet online
moncler
canada goose jackets
michael kors handbags
nike huarache

ajudan pk said...

This blog is so nice to me. I will continue to come here again and again. Visit my link as well. Good luck
cara menggugurkan kandungan
cara menggugurkan kandungan