P1: IML/FFX P2: IML/FFX QC: IML/FFX T1: IML
WL040A-09 WL040/Bidgoli-Vol III-Ch-69 August 14, 2003 18:12 Char Count= 0
880 XBRL (EXTENSIBLEBUSINESSREPORTINGLANGUAGE): BUSINESSREPORTING WITHXML19: <TD WIDTH="25%" STYLE="border-bottom-style: solid; border-bottom-width: 3"
BORDERCOLOR="#000000">
20: <P ALIGN="RIGHT"><FONT SIZE="3">1999</FONT></P>
21: </TD>
22: </TR>
23: <xsl:for-each select="/group/group/group">
24: <TR>
25: <xsl:choose>
26: <xsl:when test="@type='ci:balanceSheet.assets' or @type='ci:balanceSheet.
liabilitiesAndStockholdersEquity'">
27: <TD WIDTH="50%" STYLE="border-top: 2px solid #000000; border-bottom:
5px double #000000">
28: <B><FONT SIZE="3"><xsl:value-of select="label"/></FONT></B>
29: </TD>
30: <xsl:for-each select="item">
31: <TD WIDTH="25%" STYLE="border-top: 2px solid #000000; border-bottom:
5px double #000000">
32: <FONT SIZE="3"><P ALIGN="RIGHT">
33: <xsl:value-of select="format-number(current(),'###,###')"/>
34: </P></FONT></TD>
35: </xsl:for-each>
36: </xsl:when>
37: <xsl:otherwise>
38: <TD WIDTH="50%" ><FONT SIZE="3"><xsl:value-of select="label"/></FONT></TD>
39: <xsl:for-each select="item">
40: <TD WIDTH="25%"><FONT SIZE="3"><P ALIGN="RIGHT">
41: <xsl:value-of select="format-number(current(),'###,###')"/>
42: </P></FONT></TD>
43: </xsl:for-each>
44: </xsl:otherwise>
45: </xsl:choose>
46: </TR>
47: </xsl:for-each>
48: </TABLE>
49: </BODY>
50: </HTML>
51: </xsl:template>
52: </xsl:stylesheet>Because XSLT uses XML to describe templates, rules,
and patterns, an XSLT style sheet starts with the XML dec-
laration <?xml version = “1.0”?>. The XSLT document it-
self is an “xsl:stylesheet” element. Thus, line 2 of the XSLT
style sheet example describes the start of the XSLT pro-
cess with the XSLT processing instruction: <xsl:stylesheet
xmlns:xsl = “http://www.w3.org/1999/XSL/Transform”
version = “1.0”>
Line 52 indicates the end of the XSLT process:
</xsl:stylesheet>. The XSLT processing instruction indi-
cates the XSLT name space—the location of the XML el-
ements that comprise XSLT instructions. XSLT instruc-
tions are identified by the “xsl:” prefix on the element.
Line 4 specifies the overall method used for outputting
the result.
As you can see from the example, an XBRL document
has a hierarchical structure whereby the root element is
connected to its child elements, each of which may con-
nect to zero or more children of its own, and so forth.
Figure A3 displays each element of the XBRL example as
a tree structure.XSLT accepts an XBRL document as input and pro-
duces another document as output. An XSLT style sheet
consists of a list of templates and instructions. A template
has a pattern that specifies the elements it applies to an
XBRL document. Thus, when the pattern is matched, in-
structions contained in the template are applied. In other
words, when an XSLT style sheet is applied to an XBRL
document, XSLT recognizes the root element of the XBRL
document and looks through each child element in turn.
As each element in the XBRL document is read, XSLT
compares it with the pattern of each template in the style
sheet. When XSLT finds an element that matches a tem-
plate’s pattern, it creates outputs by applying the instruc-
tions contained in the template.
Each template is represented by using a “xsl:template”
processing instruction. The template instruction starts
with <xsl:template match = “ ”> and ends with </xsl:
template>. Lines 5 and 51 show an example of a template
instruction. Line 5 indicates the template of the root el-
ement: <xsl:template match = “/”>. Each “xsl:template”
instruction has a “match” attribute that specifies which