V
Vemund Olstad
Hi
I have encountered a problem with attribute values in some of my XML
files, and I was wondering if anyone here could help out. In some
elements in my encoding of some poems I have the TEI attribute realAn
in the l element, and I am using the values 'Y', 'N', 'single' and
'double' as standard values.
The problem here, I suspect, is not really in the XML encoding, but in
the stylesheet that is supposed to display the file. I would like to
create a standard display text in the output file, based on the realAn
attribute, but the following XSLT/XPath does not work the way I would
like it to:
<xsl:if test="attribute::realAn='N'">
What I expected this to do was to target all elements where the value
of realAn is 'N', and then display a standard text. What it seems to
do however, is to treat the test as a boolean and print out the
standard text for all elements that does not contain the realAn
attribute at all (which is quite a few, since realAn denotes deviating
anacrucis).
So, my questions are simply:
1) how can I get around this with the current encoding
and
2) are 'N' and 'Y' attribute values that should be avoided in XML, as
they can cause problems for stylesheets?
Any hints or pointers would be greatly appreciated.
Thanks
Vemund
I have encountered a problem with attribute values in some of my XML
files, and I was wondering if anyone here could help out. In some
elements in my encoding of some poems I have the TEI attribute realAn
in the l element, and I am using the values 'Y', 'N', 'single' and
'double' as standard values.
The problem here, I suspect, is not really in the XML encoding, but in
the stylesheet that is supposed to display the file. I would like to
create a standard display text in the output file, based on the realAn
attribute, but the following XSLT/XPath does not work the way I would
like it to:
<xsl:if test="attribute::realAn='N'">
What I expected this to do was to target all elements where the value
of realAn is 'N', and then display a standard text. What it seems to
do however, is to treat the test as a boolean and print out the
standard text for all elements that does not contain the realAn
attribute at all (which is quite a few, since realAn denotes deviating
anacrucis).
So, my questions are simply:
1) how can I get around this with the current encoding
and
2) are 'N' and 'Y' attribute values that should be avoided in XML, as
they can cause problems for stylesheets?
Any hints or pointers would be greatly appreciated.
Thanks
Vemund