Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
XML Tutorial
XSLT StyleSheet 305 codes
Home
XML Tutorial
XSLT StyleSheet
1 A template can match from a selection of location paths, individual paths being separated with
2 A test of the system-property() function
3 A way how to recover the value of global variable which has the same name as a local one
4 Add new tags to xml
5 Add new tags to xml document
6 Add string and integer together
7 Add text to final output
8 An example of the unary minus
9 An example of the unary plus
10 An example of use of function name()
11 Apply-templates select=county mode=county
12 Assign value from generate-id( ) to attribute
13 Batch-Processing Nodes
14 Boolean Functions
15 Calculate with variable
16 Call defined template
17 Call template based function recursively
18 Call template from another file
19 Ceiling()- Takes a number as its argument and returns the smallest integer greater than this
20 Ceilng(), floor() and round() transform floating point numbers into integers
21 Change style for even and odd
22 Changing case of a text
23 Character-map
24 Check two attributes
25 Choose statement
26 Choose with otherwise statement
27 Compare id
28 Compares 0 as a string and as a number
29 Compares sorted and unsorted xsl
30 Concat function
31 Concat string together
32 Contains() returns true if the first argument string contains the second argument string
33 Conversion of boolean values true and false
34 Convert xml structure
35 Copy element copies only the current node without children and attributes, while copy-of copies everything
36 Copy-of copies everything
37 Count elements which occured in XML source
38 Count matches
39 Count node
40 Count()- Takes a node-set argument and returns a value equal to the number of nodes in the node-set
41 Count=manufacturercar level=any format=1
42 Creating and Applying Template Rules
43 Creation of nbsp; entity using an XSL stylesheet
44 Date calculation
45 Define and use variable
46 Define parameter
47 Define variable and use it
48 Demonstrate different ways of setting xsl
49 Demonstrates string conversion
50 Demonstrates the default behaviour of xsl
51 Do calculation in select
52 Every XSL stylesheet must start with xsl
53 Exclude-result-prefixes
54 Extracting the timezone from an xs
55 Fill position to a variable
56 Floor()- Takes a number as its argument and returns the largest integer that is lower than this
57 For each group
58 For-each select=address[generate-id( )=generate-id(key(zipcodes, zip)[1])]
59 For-each select=addressbookaddress and sort
60 For-each select=addressbookaddress[generate-id( )=generate-id(key(zipcodes, zip)[1])]
61 For-each select=addressbookaddress[starts-with(state, M)]
62 For-each select=preceding-sibling
63 For-each-group select=makemodel group-ending-with=[position() mod 3 = 0]
64 Format html output with CSS
65 Format number after calculation
66 Format table cell with choose statement
67 Format xml with html
68 Format-number(1 div 0, ###,### 00, f2)
69 Format-number(123456 9999, #,### ##, us_default)
70 Format-number(1528 3, ####
71 Format-number(42, #!,hash_mark)
72 Format-number(999999999 9999, # ###,##)
73 Format-number(blue div orange, # ##, f2)
74 Format-number(number(1) div 0, # #)
75 Format-number(number(1) div 0, # #, other_options)
76 Format-number(number(blue) number(orange), #)
77 Format-number(number(blue) number(orange), #, other_options)
78 Formatting of multilevel numbers
79 Function concat() can stick several strings together
80 Functions name, local-name, and namespace-uri() are used to get informations about element and attribute names and namespa
81 Functions true() and false() are useful, when some conditions are tested during programming
82 Generate-id() generates id conforming to XML spec
83 Generates a table with selected elements,with the number of elements per row given in the stylesheet
84 Get current date
85 Get current position and text
86 Get system property with system-property() function
87 Get the name of currently selected element with name function
88 Get value from an element with value-of and select
89 Getting Java system properties with system-property()
90 Here is a test of the id()
91 How to find out that some text starts with a number
92 Html
93 Id() takes a string as its argument and returns a node-set containing any node that has an attribute of type ID equal to t
94 If a variable has some defined value
95 If element value is a number
96 If test=(position() mod 2) = 1
97 If test=not(position()=last())
98 If test=not(preceding-sibling
99 If test=position() = last()
100 If you want to include descendants of the node, you have to explicitly request their templates
101 If you want to pass a variable, you have to define this variable with xsl
102 In Cp1250
103 In ISO-8859-1
104 In UTF-16
105 Include another style sheet
106 Insert html tags into template
107 Just output html tags
108 Lang() returns true or false depending on whether the language of the context node as specified by xml
109 Last() function is in for-each element The context is therefore all selected chapters
110 Last() function is in template The context is therefore a single chapter element
111 Last() returns a number equal to the context size from the expression evaluation context
112 Last()- Returns a value equal to the context size
113 Less than
114 Mark a parameter as requred
115 Match = text()
116 Match a certain element
117 Match element by attribute value
118 Match parent and select children
119 Match parent and select grand-children
120 Match sixth child
121 Match with operator
122 Match=county[starts-with( ,K)]
123 Match=county[starts-with( ,K)] priority=2
124 Matches function
125 Math calculation
126 Mode = toc
127 Multiplication with date value
128 Name() function
129 Name()- Takes zero or one node-set arguments and returns the name of the node in prefix
130 Namespace alias
131 Nested for-each loop with sorting
132 Nested if statement
133 New namespace-alias
134 Normalize the space
135 Normalize-space() returns the argument string with white space normalized by stripping leading and trailing whitespace and
136 Not operator in if statement
137 Number count=manufacturercar level=multiple format=1 1
138 Number format
139 Number format= 01 	
140 Number format= a 	
141 Number format=1
142 Number format=A
143 Number format=I	
144 Number level=any count=section element format=1
145 Number value=1000000 grouping-size=3 grouping-separator=
146 Number value=count(car) format=01
147 Number value=position() format=1
148 Operator mod returns the remainder from a truncating division
149 Or, not operator and if statement
150 Output an element only if it has a value
151 Output calculated value
152 Output element with default namespace
153 Output entity
154 Output indent=yes
155 Output method=text
156 Output method=text indent=no
157 Output method=xml indent=yes encoding=ISO-8859-1
158 Output one type of HTML tags per template
159 Output text
160 Output to a list
161 Output xml element with namespace
162 Output xml elements in for-each loop
163 Output xml tags
164 Output xml with namespace
165 Outputs in UTF-8
166 Parts of XML document to which template should be applied are determined by location paths
167 Position() returns a number equal to the context position
168 Position() returns a value equal to the context position
169 Prints names of all elements used in the document
170 Processing always starts with the template match=
171 Reference text after selecting tags and attributes
172 Replace one string with another
173 Restructure xml
174 Return value from template
175 Round the result of sum()
176 Round()- Takes a number as its argument and returns the integer that is closest to the number argument The method of round
177 Select all document
178 Select attribute
179 Select by id()
180 Select element and attribute
181 Select element by attribute value
182 Select element by index
183 Select element out
184 Select element starting with K
185 Select value from an element
186 Select value from attribute
187 Select with if them else statement
188 Select=@node()
189 Select=@title text()
190 Select=concat(The second album is , listlistitem[2])
191 Select=count(document(other xml)euotherstate)
192 Select=document(@location)
193 Select=document(capitals xml)capitals
194 Select=emailListperson[not(position()=1)]
195 Select=format-date(current-date(), [Dwo] day of [MNn], [Y0001])
196 Select=format-date(current-date(), [M01][D01][Y0001])
197 Select=format-dateTime(current-dateTime(),[h1]
198 Select=format-number($totalSales, ##,###)
199 Select=format-number(catalogitemprice 0 60, ### 00)
200 Select=format-time(current-time(), [H01]
201 Select=normalize-space(translate(substring( ,5),,))
202 Select=operand[( 50) and ( 30)]
203 Select=state[not(@founding)]
204 Selecting elements based on values of other ones
205 Set cdata-section-elements
206 Set output encoding, indent, standalone, doctype
207 Set table cell style with choose statement
208 Setting the attribute level into multiple
209 Setting xsl
210 Several attributes can be grouped together and then used at once with xsl
211 Sort by attribute
212 Sort by different data types and order
213 Sort by last name than first name
214 Sort by name()
215 Sort data-type=number order=descending
216 Sort elements
217 Sort in a for-each loop
218 Sort order=descending
219 Sort order=descending select=
220 Sort select=
221 Sort select= data-type=number
222 Sort select=xs
223 Specify element to copy
224 Starts-with function
225 Starts-with() returns true if the first argument string starts with the second argument string
226 String() transforms its argument into string
227 String-length() returns the number of characters in the string
228 Strip space from elements
229 Strip-space elements=
230 Strip-space elements=colors
231 Substring-before() returns the substring of the first argument that precedes
232 Subtraction and multiplication uses common syntax
233 Sum only odd ones
234 Sum value
235 Sum() sums all numbers in selected nodes
236 Sum()- Takes a node-set as its argument and returns the sum of the value of each individual node after converting the valu
237 Table cell format
238 Table with different attribute sets
239 Template as function
240 Template match=state priority=2
241 Template rules are modules that describe how a particular part of your source XML should be output
242 Template with parameter
243 Template with parameters
244 Tests of the mod operator in XPath 1 0
245 Tests of the mod operator in XPath 2 0
246 Tests of XPath multiplication in XPath 1 0
247 Tests of XPath multiplication in XPath 2 0
248 Tests of XPath subtraction in XPath 1 0
249 Tests of XPath subtraction in XPath 2 0
250 Text
251 Text disable-output-escaping=yes
252 Text output method outputs the string-value of every text node
253 The attribute starts with format identificator followed by separator characters
254 The concat function returns the concatenation of its arguments
255 The count function returns the number of nodes in the argument node-set
256 The default action in the absence of priority attributes
257 The format is given with format attribute
258 The id function selects elements by their unique ID
259 The namespace axis is used to select namespace nodes
260 The not function returns true if its argument is false, and false otherwise
261 The output without empty elements removal
262 The xsl
263 The XSLT stylesheet used to generate a CSV file
264 There is an important difference in variable value specification
265 This priority order can be specified with the priority attributte
266 True() and false() function
267 Union matching
268 Use count function in math calculation
269 Use different font style to format element
270 Use document to load an XML file
271 Use esapced entity to do the compare
272 Use for-each loop to output list items
273 Use for-each loop to output table row
274 Use html to format xml document
275 Use if statement to check whether it is the last
276 Use if statement to test if an element as an attribute
277 Use parameter with template
278 Use span tag to format xml element
279 Use string-length function in math calculation
280 Use strings as arguments of boolean() function
281 Use translate to code a string
282 Use value-of to get element value from different level
283 Use variable to hold a result tree
284 Uses generate-id() to add id to all elements in source XML
285 Uses node-sets as arguments for boolean() function
286 Using comparison operator
287 Using xsl
288 Value-of select=
289 Value-of select=carsmanufacturer@name separator=
290 Value-of select=current-group() separator=
291 Value-of select=format-date($date, [M01][D01][Y0001])
292 Value-of select=replace($sub2, ', '')
293 Variable and parameter
294 Variable assignment with choose statement
295 Variable scope
296 Variable without initialization
297 When a template for the node exists, there is no default processing invoked
298 When test=position() mod 4 = 0
299 While XSLT does not define while and for loops, their behavior can be simulated
300 With modes an element can be processed multiple times, each time producing a different result
301 With XSL you can modify any source text and produce different output from the same source file
302 Without if
303 Xml
304 Xsl
305 You can select the last element of given type