Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can xml attributes contain an underscore?

0 views
Skip to first unread message

DC

unread,
Jul 23, 2008, 3:32:36 AM7/23/08
to
I'm having some non-success trying to parse an xml file containing
underscores in the attributes, like so:

<variables first_year="2000" lastyear="2006">
<variable var_name="cost" axis_name="year" type="entity"/>
<variable var_name="enrollment" axis_name="enroll" type="data"/>
<variable var_name="time" axis_name="time" type="data"/>
</variables>


The jquery call that I've used previously without success...something
like: alert ( $(this).attr("var_name"))...gives me a value of
undefined.

Richard Tobin

unread,
Jul 23, 2008, 3:58:27 AM7/23/08
to
In article <25ef7b33-7cf0-4269...@c2g2000pra.googlegroups.com>,
DC <dan.cao...@gmail.com> wrote:

>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.

0 new messages