Re: Is there a way to use filtering in E4X with hyphenated XML elements?



ten8ciousb wrote:

With E4X, I can filter the results, saying I want a list of employees
where the value of company_name is "DUNDER MIFFLIN" like
var employees = phoneList..row.(company_name == "DUNDER
MIFFLIN").EMPLOYEE-NAME;

However, if the element contains a hyphen instead of an underscore,
i.e. company-name, that syntax won't work.
this: var employees = phoneList..row.(company-name == "DUNDER
MIFFLIN").EMPLOYEE-NAME;
results in a reference error name is undefined.

What I wanted to know is if there was a syntax in E4X for this type of
filtering with elements containing hyphens.
If I understand your response correctly, the answer is "No. But,
there are other ways to do it."

phoneList..row.descendants("COMPANY-NAME")

See ECMA-357. HTH and let us know your solution, please.


PointedEars
.



Relevant Pages

  • Re: [9fans] mishandling empty lists - lets fix it
    ... for System V syntax (5 hyphens, System 5, easy to remember). ... Of course, they could also move with the times, and adopt an XML ... format for command arguments which would be much more extensible and ...
    (comp.os.plan9)
  • Re: Is there a way to use filtering in E4X with hyphenated XML elements?
    ... First I apologize most sincerely for the incomplete sentences. ... With E4X, I can filter the results, saying I want a list of employees ... i.e. company-name, that syntax won't work. ... filtering with elements containing hyphens. ...
    (comp.lang.javascript)
  • Re: Update...set
    ... The syntax of the code is correct and I put it in a line. ... John W. Vinson wrote: ... continuation of the line with the underscore. ...
    (microsoft.public.access.queries)
  • Re: Sorting Datagrid With Hyphen / Dash
    ... Regardless of the ASCII value of the hyphen, this sort order is WRONG, all ... the '30-' codes should be together, and all the '303' codes should be ... > underscore(_) character and do comparison. ... > If you change the hyphens to underscore, then you will need to revert ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: [9fans] mishandling empty lists - lets fix it
    ... Hey, yeah, great idea. ... And why not use '---' to force switching to ... for System V syntax (5 hyphens, System 5, easy to remember). ...
    (comp.os.plan9)

Loading