473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

XML Attribute values

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
Jul 20 '05 #1
2 2328
In article <3f**************@nntp.uib.no>,
Vemund Olstad <ve***********@hit.uib.no> wrote:
<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
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #2
On 19 Nov 2003 17:57:57 GMT, ri*****@cogsci.ed.ac.uk (Richard Tobin)
wrote:
In article <3f**************@nntp.uib.no>,
Vemund Olstad <ve***********@hit.uib.no> wrote:
<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


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
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!


Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
9
by: Iain | last post by:
I want to create an XML configuration file which might look like <REGION Name="Europe" WingDing="Blue"> <COUNTRY Name="UK" WingDing="white"> <TOWN Name="London" WingDing="Orange" /> </COUNTRY>...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
13
by: Patient Guy | last post by:
While the values of 'id' and 'name' attributes include restrictions on the use of characters such as beginning with a letter, the values of the 'class' attribute define no restriction as I can...
2
by: Bill Cohagan | last post by:
In my app I'm validating an XML file against an XSD which contains several attribute default value specifications. I'm performing the validation via an xml document load() using a...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
5
by: Soledad Vel | last post by:
Hi All, i write this code: var sliderwidth=100; var sliderheight = 100; var div1 = document.createElement('div'); div1.setAttribute('id','d5'); div1.setAttribute('style',...
8
by: patrizio.trinchini | last post by:
Hi All, I'would like to write an XSL transformation that changes the value of the atribute of a given element according to the value of another atttribute of the same element. For instance,...
4
by: Eric | last post by:
Attached is an example of my question. Note the "values" attribute is optional. Also the <valuesub-element is optional. Here, the XML can contain, 1 or both or neither. I would like to allow...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.