English | Français | Deutsch | Magyar | >> 中文 << | Polski enternetusers > Tutorials > XSLT Tutorial
>> 页 55 << | 上一条 | 下一条 | 目录 | 元素索引

id 函数通过节点的唯一标志选择节点。 XSLT stylesheet 1 演示了一种简单的用法。请仔细研究 XSLT stylesheet 2 。标题元素的内容并未显示在方括号"[]"中。因为 DTD 中的属性id是定义为CDATA的,而不是ID。多个id也可以一起提供( XSLT stylesheet 3 )。

XSLT stylesheet 1

XML源码
<!DOCTYPE source [ 

<!ELEMENT chapter ANY>
<!ATTLIST chapter id ID #REQUIRED>
<!ELEMENT title ANY>
<!ATTLIST title id CDATA #REQUIRED>
<!ELEMENT text ANY>
<!ATTLIST text value ID #REQUIRED>

]>
<source>

<chapter id="intro">Introduction</chapter>
<chapter id="body">
<title id="t1">BODY</title>
<text value="text1">text text text</text>
</chapter>
<chapter id="end">THE END</chapter>

</source>

输出
<P>Introduction</P>
<P>text text text</P>
<P>text text text</P>

用HTML察看

Introduction

text text text

text text text

XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<P>
<xsl:value-of select="id('intro')"/>
</P>
<P>
<xsl:value-of select="id('body')/text"/>
</P>
<P>
<xsl:value-of select="id('text1')"/>
</P>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 2

XML源码
<!DOCTYPE source [ 

<!ELEMENT chapter ANY>
<!ATTLIST chapter id ID #REQUIRED>
<!ELEMENT title ANY>
<!ATTLIST title id CDATA #REQUIRED>
<!ELEMENT text ANY>
<!ATTLIST text value ID #REQUIRED>

]>
<source>

<chapter id="intro">Introduction</chapter>
<chapter id="body">
<title id="t1">BODY</title>
<text value="text1">text text text</text>
</chapter>
<chapter id="end">THE END</chapter>

</source>

输出
<DIV>chapter : id = intro [ Introduction]</DIV>
<DIV>chapter : id = body [
BODY
text text text
]</DIV>
<DIV>title : id = t1 [ ]</DIV>
<DIV>text : value = text1 [ text text text]</DIV>
<DIV>chapter : id = end [ THE END]</DIV>

用HTML察看
chapter : id = intro [ Introduction]
chapter : id = body [ BODY text text text ]
title : id = t1 [ ]
text : value = text1 [ text text text]
chapter : id = end [ THE END]
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<xsl:for-each select="//*[@*]">
<DIV>
<xsl:value-of select="name()"/>
<xsl:text> : </xsl:text>
<xsl:apply-templates select="@*"/>
</DIV>
</xsl:for-each>
</xsl:template>

<xsl:template match="@*">
<xsl:value-of select="name()"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="."/>
<xsl:text> [ </xsl:text>
<xsl:value-of select="id(.)"/>
<xsl:text>]</xsl:text>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 3

XML源码
<!DOCTYPE source [ 

<!ELEMENT chapter ANY>
<!ATTLIST chapter id ID #REQUIRED>
<!ELEMENT title ANY>
<!ATTLIST title id CDATA #REQUIRED>
<!ELEMENT text ANY>
<!ATTLIST text value ID #REQUIRED>

]>
<source>

<chapter id="intro">Introduction</chapter>
<chapter id="body">
<title id="t1">BODY</title>
<text value="text1">text text text</text>
</chapter>
<chapter id="end">THE END</chapter>

</source>

输出
<P style="color:red">Introduction</P>
<P style="color:red">
BODY
text text text
</P>
<P style="color:red">THE END</P>
<P>Introduction</P>
<P>Introduction</P>
<P>THE END</P>

用HTML察看

Introduction

BODY text text text

THE END

Introduction

Introduction

THE END

XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<xsl:apply-templates select="id('intro body end')"/>
<P>
<xsl:value-of select="id('intro body end')"/>
</P>
<P>
<xsl:value-of select="id('body end intro')"/>
</P>
<P>
<xsl:value-of select="id('in bod end')"/>
</P>
</xsl:template>

<xsl:template match="*">
<P style="color:red">
<xsl:value-of select="."/>
</P>
</xsl:template>


</xsl:stylesheet>

4-19-2013

4-19-2013

kevin carr city of stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stantonSales Tax Measure GG City of Stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stanton


free stock videos
iphone battery cases

Kevin Carr Stanton with Governor Brown Kevin Carr with CA CFO John Chaing Kevin Carr with Congresswoman Loretta Sanchez Kevin Carr with CA State Senator Joe Dunn

Billabong Board Shorts
Quicksilver Board Shorts
I got a new iPhone5 battery case that I found on the web. I have a new ipad and I just love it. My new HTC One cellphone is awesome. I ordered a new iphone5 and I can't wait to get it. The smartphone charger I purchased is exactly what I needed. The new HTC phone is the best. I need more used AOL disks for my computer. The new emerica shoe has a new larger display.
hawaiian sandal
dekline
true religion bootcut billy jeans
hawaiian sandals

Rigoberto Ramirez

I found a iphone 8 battery cases to get a battery backup chargers. That's why there are portable power packs—when the power is out.

I reviewed the clothing at iphone battery cases and found the best Active clothing available.

I ordered the plumber in orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

These are the shops to visit:

  1. Sandals from hawaii
  2. nydj tummy-tuck jean
  3. NYDJ not your daughters jeans capris
  4. skate footwear
true religion bootcut billy jeans
Quicksilver surf clothing Board Shorts



skateboard
David Cadena Stanton
iPhone 6 plus battery pack
I bought the 1cecilia172 for the 1cecilia173 and the 1cecilia288 with the 1cecilia174. The new Baby Doll sexy looking lingerie is the best one to get. The new Baby Doll sexy lingerie looks great. The new the bridal chemises from In Bloom is the best around.

Also, you will want to check out Stanton California so you can see what's up and they are part of Stanton City Hall as well.

You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals

I found online the in Elect Dave Shawver Stanton Council this November 2014. Elect march madness ncaa and internetusers this November 2014.

delivered.

These are the shops to visit:

  1. Sandals from hawaii
  2. nydj tummy-tuck jean
  3. NYDJ not your daughters jeans capris
  4. skate footwear

I ordered the plumber in orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

I found a hawaiian sandal and another Rigoberto Ramirez on this hawaiian Sandal website.



a true religion bootcut billy jeans and

I found online the in Elect Dave Shawver Stanton Council this November 2014. Elect march madness ncaa and internetusers this November 2014.

delivered.

These are the shops to visit:

  1. Sandals from hawaii
  2. nydj tummy-tuck jean
  3. NYDJ not your daughters jeans capris
  4. skate footwear

I ordered the plumber in orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

I found a hawaiian sandal and another Rigoberto Ramirez on this hawaiian Sandal website.



a true religion bootcut billy jeans and
Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's out-of-battery-while-i-am-out/QYKADA499D4Y7DC7J">iPhone 5 battery cover and

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's