XML Attribute values

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
 
R

Richard Tobin

Vemund Olstad said:
<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).

This shouldn't happen.

You don't have a DTD defaulting realAn to N do you?

-- Richard
 
V

Vemund Olstad

This shouldn't happen.

You don't have a DTD defaulting realAn to N do you?

-- Richard

Ah....yes I do. The people responsible for the project dtd has changed
it from #IMPLIED to a default value.

Thank you so much.

Vemund
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top