rbeckman-nextgen / test-mc3

0 stars 0 forks source link

Incorrect E4X filter scope for functions #4243

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

From Rhino bug detailed at https://bugzilla.mozilla.org/show_bug.cgi?id=551854

{quote} From ECMA-375, 2nd edition, section 11.2.4, it seems that given

xml = ;

the following code

xml.*.(@id == "1")

(which returns the element) could also be written as

xml.*.(attribute("id") == "1") {quote}

This could be extremely helpful with filtering hl7 where the child elements all contain dots. For example, it would allow something like:

var mrn = msg['PID']['PID.3'].(child('PID.3.5') == 'MRN')['PID.3.1'].toString();

Imported Issue. Original Details: Jira Issue Key: MIRTH-4387 Reporter: agermano Created: 2019-03-18T16:27:53.000-0700

rbeckman-nextgen commented 4 years ago

Attaching patch file from Rhino bug with proposed fix.

Imported Comment. Original Details: Author: agermano Created: 2019-03-18T16:34:27.000-0700