Re-format addPtr.xsl to make it readable.

Also add a ptr attribute to fo:table-and-caption and fo:table-caption, even if they are not supported, in order to avoid a crash.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@824845 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Hennebert 2009-10-13 17:13:39 +00:00
parent 26cd587bf6
commit 928e650d8c

View File

@ -16,15 +16,46 @@
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:foi="http://xmlgraphics.apache.org/fop/internal">
<xsl:template match="fo:block|fo:block-container"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:list-block|fo:list-item|fo:list-item-label|fo:list-item-body"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:table|fo:table-body|fo:table-header|fo:table-footer|fo:table-row|fo:table-cell"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:inline|fo:wrapper|fo:basic-link|fo:character"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:instream-foreign-object|fo:external-graphic"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:page-number|fo:page-number-citation|fo:page-number-citation-last"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:footnote|fo:footnote-body"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template match="fo:marker"><xsl:call-template name="addPtr"/></xsl:template>
<xsl:template name="addPtr"><xsl:element name="{name()}" namespace="{namespace-uri()}"><xsl:apply-templates select="@*"/><xsl:attribute name="foi:ptr"><xsl:value-of select="generate-id()"/></xsl:attribute><xsl:apply-templates/></xsl:element></xsl:template>
<xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:foi="http://xmlgraphics.apache.org/fop/internal">
<xsl:template match="fo:block|fo:block-container">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:list-block|fo:list-item|fo:list-item-label|fo:list-item-body">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:table-and-caption|fo:table-caption|fo:table|fo:table-body|fo:table-header|fo:table-footer|fo:table-row|fo:table-cell">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:inline|fo:wrapper|fo:basic-link|fo:character">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:instream-foreign-object|fo:external-graphic">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:page-number|fo:page-number-citation|fo:page-number-citation-last">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:footnote|fo:footnote-body">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template match="fo:marker">
<xsl:call-template name="addPtr"/>
</xsl:template>
<xsl:template name="addPtr">
<xsl:element name="{name()}" namespace="{namespace-uri()}">
<xsl:apply-templates select="@*"/>
<xsl:attribute name="foi:ptr">
<xsl:value-of select="generate-id()"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>