Download presentation
Presentation is loading. Please wait.
Published byNeil Randell Wilkerson Modified over 9 years ago
1
Use of XSLT Formats in Creation, Maintenance and Optimization of Web Site Templates Jay Mercer IU Communications Indiana University mercerjd@iu.edu
2
Template Formats? What are template formats? What are template formats? Where do I find them? Where do I find them? When should I use them? When should I use them? How do I use them? How do I use them? Caveats Caveats Show me some examples! Show me some examples!
3
Similarity to standard block templates Similarity to standard block templates They transform XML compliant source into HTML.They transform XML compliant source into HTML. What are template formats?
4
Similarity to standard block templates Similarity to standard block templates Use a picker to attach to Format field.Use a picker to attach to Format field. What are template formats?
5
Difference from standard block templates Difference from standard block templates They transform XHTML compliant source into HTML.They transform XHTML compliant source into HTML. They must be XSLT Formats. (I think)They must be XSLT Formats. (I think) What are template formats?
6
Difference from standard block templates Difference from standard block templates Use a picker to attach to XSLT Format field of a template.Use a picker to attach to XSLT Format field of a template. What are template formats?
7
Template formats are XSLT Formats that are applied to a template. Template formats are XSLT Formats that are applied to a template. They transform the entire assembled template content.They transform the entire assembled template content. Region blocks are rendered first.Region blocks are rendered first. Are used to manipulate XHTML.Are used to manipulate XHTML. They transform XHTML into XHTMLThey transform XHTML into XHTML “Post-processing.”“Post-processing.” What are template formats?
8
Formats can be applied in 3 places. Formats can be applied in 3 places. BlocksBlocks TemplatesTemplates Page ConfigurationsPage Configurations Where do I find them?
9
Block formats Block formats Where do I find them?
10
Template formats Template formats Where do I find them?
11
Page Configuration formats Page Configuration formats Where do I find them?
12
Always. Always. Modify page elements that exist outside the main content area from within the DEFAULT system region format. Modify page elements that exist outside the main content area from within the DEFAULT system region format. Move page elements from one position to another. Move page elements from one position to another. Modularize code for reusability. Modularize code for reusability. Implement “on-demand” javascript. Implement “on-demand” javascript. Give end-user greater control. Give end-user greater control. Generate multiple page elements from single block. Generate multiple page elements from single block. Quickly create a new website from existing website. Quickly create a new website from existing website. When should I use them?
13
It all starts with the identity transform. It all starts with the identity transform. How do I use them?
14
Attach identity transform to template XSLT format field. Attach identity transform to template XSLT format field. How do I use them?
15
Now, just transform the XHTML. Now, just transform the XHTML. For fun, let’s turn all h3 tags into h4 tags.For fun, let’s turn all h3 tags into h4 tags. How do I use them?
16
Note: You can use a template format and a page configuration format together. Note: You can use a template format and a page configuration format together. How do I use them?
17
Note: You can use a template format and a page configuration format together. Note: You can use a template format and a page configuration format together. How do I use them?
18
Another bogus example. Another bogus example. Let’s axe the body.Let’s axe the body. How do I use them?
19
DOCTYPE DOCTYPE A template format WILL remove the DOCTYPE from the output.A template format WILL remove the DOCTYPE from the output. Namespacing Namespacing If namespace on the html element is used, special xpath syntax is needed.If namespace on the html element is used, special xpath syntax is needed. Caveats
20
DOCTYPE “DON’T” DOCTYPE “DON’T” A template format will strip out the DOCTYPE.A template format will strip out the DOCTYPE. Caveats
21
DOCTYPE “DO” DOCTYPE “DO” Use the “START-ROOT-CODE” passthrough code section tag.Use the “START-ROOT-CODE” passthrough code section tag. Caveats
22
Namespacing on html element Namespacing on html element If a namespace in used on the html element, special xsl syntax is required.If a namespace in used on the html element, special xsl syntax is required. Caveats
23
Namespacing on html element Namespacing on html element If a namespace in used on the html element, special xsl syntax is required.If a namespace in used on the html element, special xsl syntax is required. Method 1: Use node()[name()=‘body’] syntax Caveats
24
Namespacing on html element Namespacing on html element If a namespace in used on the html element, special xsl syntax is required.If a namespace in used on the html element, special xsl syntax is required. Method 2: Add namespacing attributes to stylesheet. Caveats
25
Changing body id based on data definition. Changing body id based on data definition. Example
26
Example
27
Here’s the xml from the DEFAULT system region. Example
28
Here’s the format from the DEFAULT system region. Example
29
Here’s the rendered HTML. Example
30
Here’s the template format. Here’s the template format. Examples
31
Final HTML. Final HTML. Examples
32
Resources http://www.iu.edu/~pagriet/csuc12/http://www.iu.edu/~pagriet/csuc12/http://www.iu.edu/~pagriet/csuc12/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.