XML Attribute values

Discussion in 'XML' started by Vemund Olstad, Nov 19, 2003.

  1. 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
     
    Vemund Olstad, Nov 19, 2003
    #1
    1. Advertising

  2. In article <>,
    Vemund Olstad <> 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!
     
    Richard Tobin, Nov 19, 2003
    #2
    1. Advertising

  3. On 19 Nov 2003 17:57:57 GMT, (Richard Tobin)
    wrote:

    >In article <>,
    >Vemund Olstad <> 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!
     
    Vemund Olstad, Nov 20, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Siegl
    Replies:
    1
    Views:
    506
    Kermit T Tensmeyer
    Jul 28, 2003
  2. O.B.
    Replies:
    2
    Views:
    571
    George
    Jan 31, 2006
  3. Bob Foster
    Replies:
    0
    Views:
    427
    Bob Foster
    Jul 30, 2003
  4. 5tein
    Replies:
    1
    Views:
    473
    Patrick TJ McPhee
    Apr 30, 2004
  5. Replies:
    3
    Views:
    1,549
    Brandon McCombs
    May 2, 2007
Loading...

Share This Page