This is my home, welcome to my blog. There is no limit to the goodness of life. The more you experience and appreciate the goodness of life.

11/26/2010

What are ID, IDREF and IDREFS simple types in XSD?How is xs:unique used to constrain values? Give examples to explain the usage of these XSD constructs.

Before talking about ID, IDREF and IDREFS, we first look at the data types of XML Schema (as below).
A structural drawing


From this picture, the datatypes in XML Schema are divided into simple types and complex types, and simple types are separated into two groups, built-in types and user-defined types. Likewise, built-in primitive types and deriving types make up the built-in types.

Built-in primitive types have 19 kinds, such as time, date, string, float, decimal and so on. Moreover, derived types are generated by restricting built-in primitive or other built-in derived types. In the most of built-in primitive types, only string type and decimal type derive other types.

But now we only pay attention to derived types from string type, hierarchical chart as follows:

Derived from token type, their definition are same as the duplicate attribute in DTD. The ID, IDREF and IDREFS are used to constrain identity.

ID type is used to uniquely identify the elements of XML document. ID attribute value of specific element must unique in whole file.

IDREF and IDREFS attribute values must have the same restrictions as the ID type, and have the same value with ID attribute values. In other words, IDREF and IDREFS attribute values are not point to ID attribute values which do not exist. The difference is IDREFS is allowed to have multiple values which are separated by spaces. So in IDREFS type, space is legitimate.

Meanwhile, XML Schema provides three categories of identity-constraint definitions: xs:unique, xs:key and xs:keyref. The <xsd:unique> element enables us to designate a particular part of an instance document as having to contain a value, whether in the content of an element or an attribute, that is unique. But the XML 1.0 ID type is limited in scope to attribute values only. A unique value in XSD Schema can start with a number and can be of any datatype, and ID type values are not permitted to start with a number or contain space characters. Then, the value of <xs:unique> can be unique within some specified part of the document and need not be unique document-wide. But the value of ID type has to be unique across a whole document.

Let us to see an example about <xs:unique>, and the first is an XML document.

<? Xml version=’1.0’?>
<BookList>
   <Book BookID=”001”>
        <Title>HTTP Developer’s Handbook</Title>
<Author>Chris Shiflett </Author>
<ISBN>0-672-32454-7</ISBN>
</Book>
<Book BookID="002">
                   <Title> Digital Image Processing</Title>
                   <Author>Rafael C. Gonzalez </Author>
                   <ISBN>978-7-121-10207-3</ISBN>
</Book>
</BookList>

In this XML document, the BookID tag is unique.
Then, the XML schema corresponding to this XML file shows as follows:

<?xml version=”1.0”>
<xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”>

<xs: element name=”BookList” type=”BookListType”>
<xs: unique name=”uniqueBookID”>
<xs: selector xpath=”Book”/ >
<xs: field xpath=”@BookID”/>
</xs:unique>
</element>

<xs: complexType name=”BookListType”>
  <xs: sequence>
   <xs: element name=”Book” type=”BookType”>
</xs: sequence>
</xs:complexType>

<xs:complexType name=”BookType”>
 <xs:sequence>
   <xs: element name=”Title” type=”xs: string”/>
<xs: element name=”Author” type=”xs: string”/>
<xs: element name=”ISBN” type=”xs: token”/>
</xs: sequence>
</xs:complexType>

</xs: schema>

As we can see from these codes, the scope of application of the <xs: unique> element is defined by the subelements <xs: selector> and <xs: field> which possess an xpath attribute. The value of the xpath attribute of the <xs: selector> element implies that <Book> element applies the <xs: unique> element. And the value of the xpath attribute of the <xs: field> element is BookID which is the focus of the <xs: unique> element.

The ID and IDREF/IDREFS datatypes are restricted in the extent to which they can represent relational database structures, but their relationship relates to an entire file. The <xs: key> or <xs: keyref> relationship applies xpath to locate paths, thus allowing a processor to focus on accessing only correlative parts of a document.
Finally, let’s take a look at the <xs: key> and <xs: keyref> elements. And the XML file as below:

<?xml version="1.0" encoding="UTF-8"?>
<Library>  
 <BookList>
   <Book BookID=”001”>
        <Title>HTTP Developer’s Handbook</Title>
<Author>Chris Shiflett </Author>
<ISBN>0-672-32454-7</ISBN>
</Book>
<Book BookID="002">
                   <Title> Digital Image Processing</Title>
                   <Author>Rafael C. Gonzalez </Author>
                   <ISBN>978-7-121-10207-3</ISBN>
</Book>
<Book BookID="003">
                   <Title> XML Schema Essential</Title>
                   <Author>R. Allen Wyke </Author>
                   <ISBN>0-471-41259-7</ISBN>
</Book>

</BookList>

<StudentList>
         <Student>
                   <StudentID>01</StudentID>
                   <Name>Jane</Name>
                   <Class>MSC(CS)</Class>
                   <BorrowNumber BookID=
001>1</BorrowNumber>
                   <BorrowNumber BookID=
003>1</BorrowNumber>
         </Student>
    <Student>
                   <StudentID>02</StudentID>
                   <Name>Tom</Name>
                   <Class>CA</Class>
                   <BorrowNumber BookID=
002>1</BorrowNumber>
         </Student>
</StudentList>
</Library>

The XML schema corresponding to this XML file shows as follows:

<?xml version=”1.0”>
<xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”>

<xs: element name=”Library” type=”LibraryType”>
<xs: complexType>
<xs: sequence>
<xs: element name=”BookList” type=”BookListType”>
<xs: element name=”Student” type=”StudentType”>
</xs: sequence>
</xs:complexType>

<xs:keyref name=”BookIDRef” refer=”BookIDKey”>
 <xs: selector xpath=”StudentList/Student/BorrowNumber”/>
<xs: field xpath=”@BookID”>
</xs:keyref>

<xs: key name=”BookIDKey”>
<xs: selector xpath=”BookList/Book”/>
<xs: field xpath=”@BookID”/>
   </xs: key>
</xs:element>

<xs: complexType name=”BookListType”>
  <xs: sequence>
   <xs: element name=”Book” type=”BookType”>
</xs: sequence>
<xs: attribute name=”BookID” type=”xs: string”/>
</xs:complexType>
<xs:complexType name=”BookType”>
 <xs:sequence>
   <xs: element name=”Title” type=”xs: string”/>
<xs: element name=”Author” type=”xs: string”/>
<xs: element name=”ISBN” type=”xs: token”/>
</xs: sequence>
</xs:complexType>

<xs:complexType name=”StudentType”>
 <xs:sequence>
   <xs: element name=”StudentID” type=”xs: string”/>
<xs: element name=”Name” type=”xs: string”/>
<xs: element name=”Class” type=”xs: string”/>
<xs: element name=”BorrowNumber” type=”BorrowNumberType”/>
</xs: sequence>
</xs:complexType>

<xs: complexType name=”BorrowNumberType”>
  <xs: simpleContent>
   <xs: extension base=”xs: integer”>
   <xs: attribute name=”BookID” typy=”xs: string”/>
   </xs: extension>
</xs: simpleContent>
</xs: complexType>

</xs: schema>

In this XML Schema, the <xs: keyref> element also contains an <xs:selector> element and an <xs: field> element. The xpath attributes of those elements help us to locate in the <StudentList> element, or rather the BookID attribute of this element. And it possesses a name and a refer, name is defined as the name of xs: keyref as well as the refer is the name of <xs: key> element. Thereby the value in the refer attribute of the <xs:keyref> element must match the value of a name attribute of an <xs: key> element.

11/23/2010

What are the Long Tail Effect and Streisand Effect? How are they related to Web 2.0? Give real-life examples how they take place in Web 2.0 age.

The term of long tail effect originally published on ”Wired Magazine (WIRED)” by Chris Anderson in 2004, which describes business and economic models of some websites, such as Amazon, Netflix and Real.com/Rhapsody. “Head” and “tail” are two statistical terms, and the middle protruding part of normal curve is head; the relatively flat part of both sides is tail, so the mathematical basis of the long tail is uncomplicated. Now from the perspective of people’s requirement, the majority of needs concentrate on head which are called popular. However, others distributed on tail are personalized, a handful of scattered needs form a long tail on demand curve.


The long tail effect’s focus on quantity. When all non-popular market form a bigger market than the prevalent. Yet Pareto’s Law which was originally an iron rule in business is broken by this effect, due to development of the network. Internet provides widely sales level, making 98% of products can have changes to sale. While these products having long effect characteristic not only have earning values for enterprises, but also the total value of these goods can completes with best-selling products. If we want to better use this effect, we should attach importance to Web2.0 network platform. Internet lets us no longer limit by space, and reduces cost of sales. Hence through Internet, buyers and sellers can conveniently carry out a transaction.

There are an amount of successful examples of using the long tail effect.Google is a typical example. Millions of small businesses and individuals never made an advertisement before, or did it on a large scale. But Google has lowered down the threshold, since then the advertisements are not unattainable, they are self-serviced, cheap, and can be done by everybody; on the other hand, for thousands of blog sites and small-scale business websites, it's extremely easy to put advertisements on their sites. Now half of Google's business doesn't come from the advertisements put in search results, but these small websites. Millions of medium and small businesses represent a huge long tail market.

Amazon is another successful “long tail” firm. Amazon’ online bookstore possessing thousands of books, a small part occupies half of total sales volume. Most part of books, although each sale is few, relying on their variety, they hold the half sale volume.

Another key term is Streisand effect. Its origin is very interesting, which about an actress named Barbra Streisand. In 2002, Barbra Streisand unsuccessfully attempted to accuse photographer Kenneth Adelman and Pictopia.com in an attempt to remove her mansion from the publicly available collection of California coastline photographs, citing privacy concerns. As a result of the case, public knowledge of the picture increased substantially and it became popular on the Internet, with more than 420,000 people visiting the site over the following month. Unnoticed by people before, this website become famous by this reason and attract a number of people to read. 

The Streisand effect is a phenomenon that on the Internet attempting to censor or delete a couple of information unconsciously but causing the information to be widely publicized.
In other words, some people want to attempt to suppress information or comments on the network but they are not successful. Spreading through the media or the network, several unknown information become prevalent, further they create the effect of free publicity. Especially, in this age of Web 2.0, users can upload information file to the Web for public viewing, as well as people can put their photos, movies or documents on the blog.

Along with that many Streisand effect take place on the Internet. For example, management staff in Digg remove several articles concerning with HD DVD key break due to receiving a letter from lawyer of ACCS association. However, the behavior that Digg delete post cause drastic reaction among users. Meantime, password taking domain names, billboards, wallpaper and poetry form appear on wherever. Another popular instance is that the court commanded the MIT hacker to sealbut led to the leaking acceleration.

11/22/2010

卧室内绝不能摆放的11种花

  很多人喜欢在自己的卧室内养一些鲜花来进行装饰,增加美感,心情是可以理解的。养花不但使卧室漂亮,还能净化空气,对身体大有好处。不少人还不知道花不是乱养的,有很多花是对身体有害的,不但无宜,严重的还会危及生命,下面是十一种卧室内不宜养的花,一定要引起大家的注意。

兰花、百合花
 
  这两种花其香气会刺激人的神经系统,令人过度兴奋,极容易导致人失眠。

月季花

  它所散发出来的浓郁香味,会使一些人产生胸闷不适、憋气与呼吸困难。


松柏类花木

  其芳香气味对人体的肠胃有刺激作用,不仅影响食欲,还可能使孕妇感到心烦意乱、恶心呕吐。
洋绣球花

  它所散发的微粒,如与人的皮肤接触,会产生皮肤过敏反应。

夜来香

  它在夜晚会散发出大量刺激嗅觉的微粒,闻之过久,会使高血压和心脏病患者感到头晕目眩、郁闷不适,甚至病情加重。
郁金香     
  它的花朵含有一种毒碱,人若是接触过久,会加快毛发脱落。


夹竹桃

  它可以分泌出一种乳白色液体,接触时间一长,会使人中毒,引起昏昏欲睡、智力下降等症状。孕妇如果靠近它,会引起胎音异常。


狼毒、万年青
 
  它的汁液含有哑唪酶,对人体是十分不利的。如小孩误服会引发声带发肿,甚至致哑。

含羞草
 
  这种花也和郁金香花一样,人若是接触过久,可致脱发。

豹皮花
 
  它所散发出来的气味微粒,对人体也十分不好,可使人致晕。
红背桂、变叶木、虎刺梅     
  这几种花木,会与人体产生严重的不良反应,是致癌花木之一,不宜栽种。
 
 

绝对不可以吃的4种果蔬皮

  大多数人觉得水果蔬菜洗干净就好了,吃不吃皮只是个口感问题,无关健康。可事实证明,这种想法大错特错,一些果蔬若是连皮吃,或者烹调的时候皮没处理干净,都会给你的身体惹来麻烦。

1.柿子皮
 
  由于柿子皮口感好,一般人们吃柿子都不吐皮。然而据医学研究证明,柿子未成熟时,可对肠胃造成伤害的鞣酸主要存在于柿肉内,而柿子成熟后,鞣酸便会集中于柿皮内。
2.红薯皮

  因红薯皮含碱量较多,食用过多会导致胃肠不适。(改善性爱质量必备的八大准则)呈褐色或有黑色斑点的红薯皮更不能食用,因这种红薯受了黑斑病的感染,食用后会引起中毒。
3.土豆皮
 
  土豆皮内含不益于人体健康的配糖生物碱,进入人体后会形成积累性中毒。由于是慢性中毒,暂时无症状或症状不明显,往往不会引起注意。尤其是长了芽和皮色发青的土豆,含毒素更高,应绝对禁止食用。
4.荸荠皮

  因荸荠生于肥沃的水泽,皮上聚集了多种有害、有毒的生物排泄物和化学物质。因此,生食或熟食都应去皮,否则会引起难以预料的疾病。

生活 当你累的时候

1。没有事少上QQ,那会浪费你很多时间
2。早点睡觉,早点起床.。
3。每天提醒自己,不要忘记理想.。
4。有时间多看书,多学习,做一个有文学素养的 人,不要把时间浪费在滑稽怪诞的事情上;
5。多锻炼身体,身体垮了什么都没有了,要对自己好一点;
1.


6。努力学习赚钱的本领,钱是一个人活着的根本,是做人的尊严;
6。常回家看看爸爸妈妈,常给好朋友打电话,亲情和友情是最珍贵的感情;
7。学会做个倾听者,要多听听别人的感受,从中获得一些宝贵的经验 ;
8。要学会玩,学会有品位的玩;
9。自己的烦恼,不要带回家,不给任何人分享;
10。要会装扮自己,邋遢不是一个酷的表现,是没教养的结果;




11. 不要以貌取人,特别是女人,漂亮的也许是个魔鬼,丑陋的却可能是天使,上天总是公平的;
12。学会拒绝,凡事量力而行,做不了,绝不逞能。
13。尽量少和没素养的人交往,免得受其影响;
15。要寻找与自己有共同价值观的人,爱自己的人,好好珍惜,好好保护,终了一生;




16。不要把感情浪费在没有希望的人身上,看重外在的人永远都是弱智,只有在伤痕累累时才明白,真正爱她(他)的人原来一直在她(他)身边关注她(他)。
18。现实一点,爱情在现实面前总是那么苍白,不要天真的认为爱情和浪漫是等号关系;  
19。做婚姻的有心人,好好准备步入婚姻,好好准备做一个好丈夫好妻子;
20。不要老是想做救世主,就算是救世主,也没必要去拯救世人。可怜之人,必有可恨之处,而且都是犹大; 
21。要明白读过很多书的人不一定有很多知识,没上过学的人却不一定是文盲;
22。做事三思而后行
23。做工作的有心人;
24。永远别去解释,理解你的人不需要;不理解你的人,不配要。
25。别过分坚持自己现在的想法,那样子以后会比较少后悔。


26。趁着在校园,多学点知识。等你走出校园了,你会发觉必要的知识你是那么的缺乏。
27。珍惜你身边的人,因为他们最容易被你忽视。外来的和尚虽然好念经,但不一定贴心。
28。永远感激那些曾经关心或者正在关心你的人。
29。现实中出淤泥很难不染,但是你要学会经常清洗自己,不是身体,乃是心灵。
30。不要轻易作出承诺,因为你还没那能力去保证实现。做不到的承诺比没许下效果呢更差。    





  
人之所以会心累,就是常常徘徊在坚持和放弃之间,举棋不定。生活中总会有一些值得我们记忆的东西,也有一些必须要放弃的东西。放弃与坚持,是每个人面对人生问题的一种态度。勇于放弃是一种大气,敢于坚持何尝不是一种勇气,孰是孰非,谁能说的清道的明呢?如果我们能懂得取舍,能做到坚持该坚持的,放弃该放弃的,那该有多好。

   别让自己心累!应该学着想开,看淡,学着不强求,学着深藏。
   别让自己心累!适时放松自己,寻找宣泄,给疲惫的心灵解解压。

  人之所以会烦恼,就是记性太好。该记的,不该记的都会留在记忆里。而我们又时常记住了应该忘掉的事情,忘掉了应该记住的事情。为什么有人说傻瓜可爱、可笑,因为他忘记了人们对他的嘲笑与冷漠,忘记了人世间的恩恩怨怨,忘记了世俗的功名利禄,忘记了这个世界的一切,所以他活在自己的世界里随心所欲地快乐着,傻傻的笑着。

    所以人们宁愿让自己不快乐,也不愿意去做傻瓜。如果可以记住应该记住的,忘记应该忘记的。或者是忘掉从前,把每天都能当成一个新的开始,那该有多好。可是,说起来容易,做起来却是那么的难。

  人之所以会痛苦,就是追求的太多。人生在世,不可能事事顺心,不要常常觉得自己很不幸,其实世界上比我们痛苦的人还要多。明知道有些理想永远无法实现,有些问题永远没有答案,有些故事永远没有结局,有些人永远只是熟悉的陌生人,可还是会在苦苦地追求着,等待着,幻想着。



   其实痛苦并不是别人带给你的,而你自己的修养不够,没有一定的承受能力。你硬要把单纯的事情看得很严重,把简单的东西想的太复杂,那样子你会很痛苦。学会放下,放下一些所谓的思想包袱,坦然面对一切,让一切顺其自然,这样你才会让自己轻松自在。

  人之所以不快乐,就是计较的太多。不是我们拥有的太少,而是我们计较的太多。不要看到别人过得幸福,自己就有种失落和压抑感。其实你只看到了别人的表面现象,或许他过的还不如你快乐。人的欲望是无止尽的,人人都在追求高品质的生活,人人都想得到自己想要的东西,人人都在为了自己的目标,整天里忙碌着,奋斗着,得到了,开心一时,得不到,痛苦一世。

   世界上没有完美无缺的东西,不完美其实才是一种美,只有在不断的争取,不断的承受失败与挫折时,才能发现快乐。

   人之所以不知足,就是有着太多的虚荣心。俗话说知足者常乐,但又有几个人能达到这样的境界。人不是因为拥有的东西太少,而是想要的东西太多。大千世界无奇不有,有着太多太多的诱惑,我们不可能不动心,不可能不奢望,不可能不幻想。

    面对着诸多的诱惑,有多少人能把握好自己,又有多少人不会因此而迷失自己?但话又说回来,有了知足心,哪会有上进心?时代在发展,生活在继续,我们需要不断地去努力,去追求,如果只满足于现状,一味地沉浸在自己的知足里,那还有什么远大的理想和追求了?

  人之所以不幸福,就是没有知足心。每个人对幸福的感觉和要求都不相同,一个容易满足、懂得知足的人才更容易得到幸福。曾经看到过这样一句话:“幸福就如一座金字塔,是有很多层次的,越往上幸福越少,得到幸福相对就越难。越是在底层越是容易感到幸福;越是从底层跨越的层次多,其幸福感就越强烈。”幸福其实就是一种期盼,是一种心灵的感受。只要我们用心去发现,用心去感受,你就会发现幸福其实就在我们身边,只是这样的幸福常常被我们忽略。
  人之所以活的累,就是想的太多。身体累不可怕,可怕的就是心累。心累就会影响心情,会扭曲心灵,会危及身心健康。其实每个人都有被他人所牵累,被自己所负累的时候,只不过有些人会及时地调整,而有些人却深陷其中不得其乐。在这个充满竞争压力的社会里,生活有太多的难题和烦恼,要活得一点不累也不现实。

    不同时代的人有着不同的精神状态,以前,我们的物质生活很贫穷,但精神状态却很好;如今,我们的物质生活提高了,可精神生活却匮乏了。不要逢事就是喜欢钻牛角尖,让自己背负着沉重的思想包袱,把事情考虑得太周全,这就造成了我们活的累。

  为了寻找幸福,我们会许下一些诺言。可当真正去做的时候,却发现有些诺言是虚伪的谎言。但细想一下,就是这些虚伪而善良的谎言让我们对幸福充满了希望和信心。其实承诺并没有什么,不见了也不算什么,所有的一切自有它的归宿。

  幸福是自己的感觉,需要自己细细去体会。幸福的距离,有时近,有时远,以为就在咫尺,转眼却还在天涯。平静的生活就像一杯白开水,喝起来淡而无味,却不知道正是它的纯净无暇才让我们的生命幸福,懂得生活的人才会在平淡中品出甘甜和幸福。

  幸福就是这样的飘渺不定却也真实的存在着。对幸福开始渐渐的有所感悟,看看身边的人,有幸福的笑容,也有落寞的情绪。再看看自己,还不是如此,有开心的时候,也有落寞的时候。人生数载,面临着许多考验,也会有很多的得到和失去,也有许多的成功和失败。

  人,永远是矛盾的主体,经常处在犹豫和憧憬的困惑中,夹在世俗的单行道上,走不远,也回不去。人,真的是一个难以琢磨的生灵,最了解自己的永远只有自己。
生活不可能一帆风顺,开心是过一天,烦恼还是过一天,那为何不让自己开开心心地过

11/19/2010

What is XSL-FO? How is it related to XSLT? Give examples to help explain your answer

XSL is the Extensible Stylesheet Language, a W3C recommended standard. And it was designed to be a language for transforming and formatting XML documents, just as CSS is a style sheet language of HTML. XSL contains three parts, XSLT, XPath and XSL-FO. The full name of the XSL-FO is Extensible Stylesheet Language Formatting Objects. Because the “T” in “XSLT” stands for the transformation part, XSL-FO means the formatting part, and yet people often referred to as XSL. So XSLT is a normative part of XSL-FO, and language features of XSL-FO are similar to XSLT and Xpath.

XSL-FO files are XML documents with output information, and XSL-FO files are stored in documents with a .fo or a .fob file extension. XSL-FO files have a structure like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
  <fo:simple-page-master master-name="test">
<!-- Page template goes here -->
 <fo: region-body/>
  </fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="test">
  <!--  A sequence of pages, page content goes here -->
<fo: flow>
  <fo: block></fo: block>
</fo: flow>
</fo:page-sequence>
</fo:root>

Since a formatting object document is an XML document, the first line of all XSL-FO documents must be the XML declaration. Each XSL-FO file has only one, root element, typically called <fo: root>.

Now we have an outline of the structure of a typical XSL-FO file, in order to clearly understand the relationship between XSL-FO and XSLT, we make use of XSLT to transform an XML file to include XSL-FO elements for display.
This is XML document:

<? Xml version=’1.0’?>
<BookList>
  <title>BOOK INFORMATION</title>
   <Book BookID=”001”>
        <Name>HTTP Developer’s Handbook</Name>
<Author>Chris Shiflett </Author>
<ISBN>0-672-32454-7</ISBN>
</Book>
<Book BookID="002">
                  <Name> Digital Image Processing</Name>
                  <Author>Rafael C. Gonzalez </Author>
                  <ISBN>978-7-121-10207-3</ISBN>
</Book>
</BookList>

The XSLT stylesheet declares two namespaces in its xsl:stylesheet start-tag: one to indentify the XSLT instructions to the XSLT processor and one to indentify the XSL elements to the rendering program. The first thing output is the <fo: root> element by XSLT template.
The XSL document corresponding to this XML file shows as follows:

<?xml version=”1.0”?>
<xsl: styleheet version= ”1.0” xmlns:xsl =”http://www.w3.org/1999/XSL/Transform” xmlns:fo =” http://www.w3.org/1999/XSL/Format” >
<xsl: template match=”/”>
  <fo: root>

   <fo: layout-master-set>
      <fo: simple-page-master master-name=”test”
page-height = “20 cm”
  page-width = “12 cm”
margin-top = “1 cm”
margin-bottom= “3 cm”
margin-left =”3 cm”
margin-right =”3 cm”>
<fo: region-body margin-top= “3 cm”/>
<fo: region-before extent= “3 cm”/>
<fo: region-after extent= “1.5 cm”/>
</fo: simple-page-master>
</fo: layout-master-set>

<fo: page-sequence master-name=”test”>
<fo: static-content flow-name=”xsl-region-before”>
     <fo: block text-align=”end”
        font-size=”10pt” font-family=”serif” line-height=”13pt” >
      <xsl: value-of select=”/BookList/title”/> -p. <fo: page-number/>
     </fo: block>
 </fo: static-content>

 <fo: flow flow-name=”xsl-region-body”>
   <fo:  block font-size=”20pt”
  font-family=”sans-serif”
line-height=”26pt”
background-color = “yellow”
color = “black”
text-align = “center”
padding-top = “3pt”>
     <xsl: apply-templates select=” BookList/title”/>
</fo: block>

<fo:  block font-size=”18pt”
font-family=”sans-serif”
line-height=”24pt”>
     <xsl: apply-templates select=” BookList /Book”/>
</fo: block>
</fo: flow>

</fo: page-sequence>
</fo: root>
</fo: template>

<xsl: template match=”BookList/title”>
   <xsl: value-of select=”.”/>
</xsl:template>

<xsl: template match=” BookList /Book”>
  <fo: block space-before=”8pt” space-after=”8pt”>
    <xsl: apply-templates select=”Name”/>
<xsl: apply-templates select =”Author”/>
<xsl: apply-templates select =”ISBN”/>
  </fo:block>
</xsl:template>

<xsl: template match=”Name”>
  <fo: block>
   <xsl: value-of select=”.”/>
  </fo: block>
</xsl:template>

<xsl: template match=”Author”>
  <fo: block>
   <xsl: value-of select=”.”/>
  </fo: block>
</xsl:template>

<xsl: template match=”ISBN”>
  <fo: block>
   <xsl: value-of select=”.”/>
  </fo: block>
</xsl:template>
</xsl: stylesheet>

The above five XSLT templates output the content of the various elements of our XML source document. They are applied in <fo: flow> element or its descendants. And the <fo: flow> element contains the main page content, other than the header and footer. In the xsl file, <fo: static-content> element utilizes xsl-region-before describing the header but we do not define the footer, these can be based on specific example.

web1.0,web2.0 还是web3.0 ?

从1989年,蒂姆•伯纳斯•李为自己发明的万维网申请了知识产权到2010年,已经是整整二十一年,我们有幸见证了web1.0到web2.0,再到 web3.0的一一出世。
那现在是web3.0的时代,还是web2.0时代?或者说web1.0已经彻底的成为历史了呢?
我们都知道,网易,新浪,搜狐三大门户是web1.0的代表,那他们已经成为历史了吗?他们不但没有退出历史舞台,而且活的还挺滋润,张朝阳已经把2家搜狐公司送上了市。到底什么是web1.0呢?其本质就是联合,用户通过浏览器获取信息。换个更形象点的说法,web1.0就像妓女赚钱,比拼接客数量,说白了就是比流量,现在很多的个人网站,为了维持网站的正常运行,赚点小广告费,靠什么?流量是唯一能说服我去往他们站上投放广告的衡量标准。
那2.0又是否已经过时了呢?在回答这个问题之前,先简要说下什么是web2.0。如果说1.0就像妓女赚钱,那2.0就是情妇赚钱,比拼包养质量,一种流行的说法“用户是否自己生产内容”,web2.0不像web1.0那样,靠流量赚钱,而更比拼用户的黏着度。1.0和2.0的差别就在于,妓女工作着眼于广度,情妇的工作着眼于深度,情妇除了肉体交易外,还有情感的互动,增加了客户对她的依赖程度,也增加了客户对她的投资。虽然情妇的客户数量远比妓女少,但单个客户带来的收益远大于妓女。web2.0的本质就是互动,那代表又是什么?博客,P2P下载,播客,社区。那一开始的那个问题“web2.0是否过时了”,也就不解自解了。但这也说明了2.0的一个致命缺点,那就是脆弱!纯粹的2.0会在商业模式上遭遇重大挑战,需要跟具体的产业结合起来才会获得巨大的商业价值和商业成功。
2008年淘宝交易接近1000亿,2009年达到2000亿,2010年预计达到4000亿!多么庞大的数字!为什么我会提到淘宝?那是因为电子商务领域是web3.0的代表。 web3.0是在web2.0的基础上发展起来的能够更好的体现网民的劳动价值并且能够实现价值均衡分配的一种互联网方式。不管是B2C还是C2C,网民利用互联网提供的平台进行交易,在这个过程中,他们通过互联网进行劳动,并获得了财富。说完了电子商务,我想再提一个名词——“webgame”,网页游戏从上个世纪90年代的没落,到06年的再次兴起,再到09年的崛起,我们看到了3.0带来的巨大商业价值。有人会疑问,为什么webgame也属于 3.0,举个简单的例子,热血三国应该很多人都玩过,我们在通过攻城掠寨,不断的升级建筑,生产资源中花费了大量的时间,而我们可以在那里获得声誉和财富,而这个财富通过一定的方式可以在现实中兑换。这不正回到了web3.0的定义:“体现网民劳动价值”,“实现价值均衡分配”。所以我相信3.0还会继续壮大,毕竟电子商务还没有全面爆发,webgame也只是有了东山再起的苗头。
说了这么多,我想回到今天的主题,web1.0到3.0,如今是谁的天下?举个例子,“驴妈妈旅游网”需要流量吗?当向人家介绍驴妈妈是如何庞大起来的时候,您的第一个数字是不是要举驴妈妈旅游网每天的流量呢?我想驴妈妈的第一步也是在做“广”,驴妈妈的路书,点评,攻略就是大量的信息,提供“read”,那就离不开1.0的定义。接下来就是做“粘”,粘住每个会员,让每个会员自行的生产内容。驴妈妈的空间,社区不正是在让会员和会员之间形成互动吗,自然回到了2.0。驴妈妈旅游网一方面是在做“出游导师”,一方面又是景区领先的B2C电子商务网站,是不是又回到了web3.0的定义。
我们很难去界定现在到底是2.0时代,还是3.0时代。我想说的是,其实他们并不排斥,是共存的,而且很多网站的模式是集三位一体的。
01 <?xml version="1.0" encoding="UTF-8"?>
02 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org /1999/XSL/Transform">
03    <xsl:template match="/">
04        <html>
05            <head>
06                <title>图书信息简介</title>
07            </head>
08            <body>
09                    <xsl:apply-templates select="BookList"/>
10            </body>
11        </html>
12    </xsl:template>
13    <xsl:template match=" BookList">
14         <table width="650" align="center" cellpadding="1" cellspacing="1">
15            <tr bgcolor="#c0c060">
16                <th>title</th>
17                <th>author</th>
18                <th>pulisher</th>
19                <th>date</th>
20                <th>ISBN</th>
21            </tr>
22            <xsl:apply-templates select="Book"/>
23        </table>
24    </xsl:template>
25    <xsl:template match="Book">
26        <tr bgcolor="#ffffc0">
27            <td><xsl:value-of select="Title"/></td>
28            <td><xsl:value-of select="Author"/></td>
29            <td><xsl:value-of select="Publisher"/></td>
30            <td><xsl:value-of select="PubDate"/></td>
31            <td><xsl:value-of select="ISBN"/></td>
32        </tr>
33    </xsl:template>
34 </xsl:stylesheet>