G
Gerald Aichholzer
Hello NG,
I have an XML document which looks like the following
example:
<document>
<section1>
<symbol>...</symbol>
<symbol>...</symbol>
<symbol>...</symbol>
</section1>
<section2>
<symbol>...</symbol>
<symbol>...</symbol>
<symbol>...</symbol>
</section2>
</document>
Each document has two sections. Each section consists
of a series of symbols. Each symbol contains several
nodes.
I have a stylesheet (written by a colleague) which
renders a document to XHTML using <xsl:apply-templates>.
Rendering a symbol depends on a global variable $size.
I would like to have a different size for symbols in
section1 than for symbols in section2.
What is the best practice to do this?
Until know I have found the following possibilities:
1. passing the size as parameter to all xsl:apply-templates
as there are many templates this would require some work
2. using different modes
about the same work as above; plus I would have duplica-
ted the templates (and will have to maintain everything
twice)
3. checking the symbol's parent
modifying the existing templates and creating a local
size-variable which content is determined by the sym-
bols parent
this looks not very flexible and elegant to me
Are there some other possibilities? What would you recommend?
thanx in advance,
Gerald
I have an XML document which looks like the following
example:
<document>
<section1>
<symbol>...</symbol>
<symbol>...</symbol>
<symbol>...</symbol>
</section1>
<section2>
<symbol>...</symbol>
<symbol>...</symbol>
<symbol>...</symbol>
</section2>
</document>
Each document has two sections. Each section consists
of a series of symbols. Each symbol contains several
nodes.
I have a stylesheet (written by a colleague) which
renders a document to XHTML using <xsl:apply-templates>.
Rendering a symbol depends on a global variable $size.
I would like to have a different size for symbols in
section1 than for symbols in section2.
What is the best practice to do this?
Until know I have found the following possibilities:
1. passing the size as parameter to all xsl:apply-templates
as there are many templates this would require some work
2. using different modes
about the same work as above; plus I would have duplica-
ted the templates (and will have to maintain everything
twice)
3. checking the symbol's parent
modifying the existing templates and creating a local
size-variable which content is determined by the sym-
bols parent
this looks not very flexible and elegant to me
Are there some other possibilities? What would you recommend?
thanx in advance,
Gerald