XML Attribute values

Vemund Olstad

Usenet Archive
Joined
Mar 1, 2001
Messages
5
Reaction score
0
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
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
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
 

Vemund Olstad

Usenet Archive
Joined
Mar 1, 2001
Messages
5
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top