Can xml attributes contain an underscore?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DC

    Can xml attributes contain an underscore?

    I'm having some non-success trying to parse an xml file containing
    underscores in the attributes, like so:

    <variables first_year="200 0" lastyear="2006" >
    <variable var_name="cost" axis_name="year " type="entity"/>
    <variable var_name="enrol lment" axis_name="enro ll" type="data"/>
    <variable var_name="time" axis_name="time " type="data"/>
    </variables>


    The jquery call that I've used previously without success...somet hing
    like: alert ( $(this).attr("v ar_name"))...gi ves me a value of
    undefined.
  • Richard Tobin

    #2
    Re: Can xml attributes contain an underscore?

    In article <25ef7b33-7cf0-4269-a60f-bebb3fe5bfac@c2 g2000pra.google groups.com>,
    DC <dan.cao.nguyen @gmail.comwrote :
    >I'm having some non-success trying to parse an xml file containing
    >underscores in the attributes, like so:
    Underscores are legal. If they weren't, you'd get an error from the
    parser, rather than an undefined value from a query.

    -- Richard
    --
    Please remember to mention me / in tapes you leave behind.

    Comment

    Working...