就是下面这几段:有兴趣的可看看,是讲利用xsl转变xml为html、svg、vrml的。
##############################
D.2 Data Example
This is an example of transforming some data represented in XML using three different XSLT stylesheets to produce three different representations of the data, HTML, SVG and VRML.
The input data is:
10
9
7
4
3
4
6
-1.5
2
The following stylesheet, which uses the simplified syntax described in [2.3 Literal Result Element as Stylesheet], transforms the data into HTML:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
lang="en">
Sales Results By Division
Division |
Revenue |
Growth |
Bonus |
---|
data-type="number"
order="descending"/>
|
|
color:red |
|
The HTML output is:
Sales Results By Division
Division | Revenue | Growth | Bonus |
---|
North | 10 | 9 | 7 |
West | 6 | -1.5 | 2 |
South | 4 | 3 | 4 |
The following stylesheet transforms the data into SVG:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd">
The SVG output is:
The following stylesheet transforms the data into VRML:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
#VRML V2.0 utf8
# externproto definition of a single bar element
EXTERNPROTO bar [
field SFInt32 x
field SFInt32 y
field SFInt32 z
field SFString name
]
"http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl"
# inline containing the graph axes
Inline {
url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl"
}
bar {
x
y
z
name ""
}
The VRML output is:
#VRML V2.0 utf8
# externproto definition of a single bar element
EXTERNPROTO bar [
field SFInt32 x
field SFInt32 y
field SFInt32 z
field SFString name
]
"http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl"
# inline containing the graph axes
Inline {
url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl"
}
bar {
x 10
y 9
z 7
name "North"
}
bar {
x 4
y 3
z 4
name "South"
}
bar {
x 6
y -1.5
z 2
name "West"
}