1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
<xsl:output method="xml"/>
7
<xsl:template name='noinc'>
8
<xsl:apply-templates mode='noinc'/>
11
<xsl:template match="*" mode='noinc'>
13
<xsl:apply-templates select='@*' mode='noinc'/>
14
<xsl:apply-templates mode='noinc'/>
17
<xsl:template match='@*' mode='noinc'>
18
<xsl:attribute name='{name()}'>
19
<xsl:value-of select='.'/>
23
<xsl:template match='processing-instruction("rfc")' mode='noinc'>
25
<xsl:when test='substring-before(.,"=") = "include"'>
26
<xsl:call-template name='include-pi'>
27
<xsl:with-param name='include-href'>
28
<xsl:value-of select="translate( substring-after( ., '=' ), '" ', '' )"/><xsl:text>.xml</xsl:text>
33
<xsl:copy-of select='.'/>
38
<xsl:template name='include-pi'>
39
<xsl:param name='include-href'/>
40
<xsl:apply-templates select="document( $include-href )" mode='noinc'/>
43
<xsl:template match='dwdrfc-ref' mode='noinc'>
44
<xsl:param name='include-href'>
46
<xsl:when test='starts-with( @src, "http://" )'>
47
<xsl:value-of select='@src'/>
50
<xsl:text>http://xml.resource.org/public/rfc/</xsl:text>
51
<xsl:value-of select='@src'/>
52
<xsl:text>.xml</xsl:text>
56
<reference anchor="{@anchor}">
57
<xsl:apply-templates select="document( $include-href )" mode="refrename"/>
61
<xsl:template match='*' mode='refrename'>
62
<xsl:apply-templates mode='refrename'/>
65
<xsl:template match='reference' mode='refrename'>
66
<xsl:apply-templates mode='noinc'/>
69
<xsl:template match='/'>
70
<xsl:call-template name='noinc'/>
73
<xsl:template name='output'>
74
<xsl:param name='foo'/>
75
<xsl:copy-of select='$foo'/>
76
<xsl:apply-templates select='$foo'/>
79
<xsl:template match='*' mode='output'>
81
<xsl:value-of select='name()'/>
82
<xsl:apply-templates mode='output'/>
85
<xsl:template match='text()' mode='output'/>
87
<!-- Reference checking attributes stripped here. -->
88
<xsl:template match='references' mode='noinc'>
89
<xsl:element name='references'>
90
<xsl:attribute name='title'>
91
<xsl:value-of select='@title'/>
93
<xsl:apply-templates mode='noinc'/>
97
<xsl:template match='xref' mode='noinc'>
98
<xsl:element name='xref'>
99
<xsl:attribute name='target'>
100
<xsl:value-of select='@target'/>
102
<xsl:apply-templates mode='noinc'/>