GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
1
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
XML
Browse code
- Reformatted code.
master
1 parent
aaf17c9
commit
6453fc22f2b4e111afc3176e2ec0821502990905
nstanger
authored
on 7 Oct 2011
Patch
Showing
1 changed file
modules/conditional-processing.xml
Ignore Space
Show notes
View
modules/conditional-processing.xml
<?xml version="1.0" encoding="utf-8"?> <!-- Conditional XML processing depending on the target format. It may appear redundant to have two templates, but this is the only way to ensure that the LaTeX template is empty in the HTML style sheet, and vice versa. Note the assumption that all LaTeX format names include the string 'latex' and all HTML format names include the string 'html'. @format: the format under which this XML is to be processed. [required] --> <stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Conditional XML processing under for LaTeX output formats. --> <template name="process-when-latex" match="process-when[ contains( @format, 'latex' ) ]"> <common formats="/latex/xelatex/"> <xsl:apply-templates /> </common> </template> <!-- Conditional XML processing under for HTML output formats. --> <template name="process-when-html" match="process-when[ contains( @format, 'html' ) ]"> <common formats="/html/xhtml/"> <xsl:apply-templates /> </common> </template> <!-- Error handling. --> <template name="process-when-error" match="process-when[ not( @format ) ]"> <common> <xsl:message terminate="yes">The "process-when" element must include an @format attribute.</xsl:message> </common> </template> </stylesheet>
<?xml version="1.0" encoding="utf-8"?> <!-- Conditional XML processing depending on the target format. It may appear redundant to have two templates, but this is the only way to ensure that the LaTeX template is empty in the HTML style sheet, and vice versa. Note the assumption that all LaTeX format names include the string 'latex' and all HTML format names include the string 'html'. @format: the format under which this XML is to be processed. [required] --> <stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Conditional XML processing under for LaTeX output formats. --> <template name="process-when-latex" match="process-when[ contains( @format, 'latex' ) ]"> <common formats="/latex/xelatex/"><xsl:apply-templates /></common> </template> <!-- Conditional XML processing under for HTML output formats. --> <template name="process-when-html" match="process-when[ contains( @format, 'html' ) ]"> <common formats="/html/xhtml/"><xsl:apply-templates /></common> </template> <!-- Error handling. --> <template name="process-when-error" match="process-when[ not( @format ) ]"> <common> <xsl:message terminate="yes">The "process-when" element must include an @format attribute.</xsl:message> </common> </template> </stylesheet>
Show line notes below