Professional Web Applications Themes

e4x and (&&) won't compile - Macromedia Flex General Discussion

Please look at my code, below. It runs fine and gives the results one would expect. But this does not compile: [Q] <mx:TextArea x="60" y="222" width="177" height="158" text="{xml.a.(aaa=='99' && bbb=='7')}"/> [/Q] The compile error is "The entity name must immediately follow the '&' in the entity reference." What's the syntax for an "and" conditional? Thanks! <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ [Bindable] private var xml:XML = <root><a><aaa>1</aaa><bbb>2</bbb></a><a><aaa>99</aaa><bbb>7</bbb></a></root>; ]]> </mx:Script> <mx:TextArea x="60" y="56" width="177" height="158" text="{xml.a.(aaa=='1')}"/> <mx:TextArea x="60" y="222" width="177" height="158" text="{xml.a.(aaa=='1' || bbb=='7')}"/> </mx:Application>...

  1. #1

    Default e4x and (&&) won't compile

    Please look at my code, below. It runs fine and gives the results one would
    expect.

    But this does not compile:
    [Q]
    <mx:TextArea x="60" y="222" width="177" height="158" text="{xml.a.(aaa=='99'
    && bbb=='7')}"/>
    [/Q]
    The compile error is "The entity name must immediately follow the '&' in the
    entity reference."

    What's the syntax for an "and" conditional?

    Thanks!

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:Script>
    <![CDATA[
    [Bindable] private var xml:XML =
    <root><a><aaa>1</aaa><bbb>2</bbb></a><a><aaa>99</aaa><bbb>7</bbb></a></root>;
    ]]>
    </mx:Script>
    <mx:TextArea x="60" y="56" width="177" height="158"
    text="{xml.a.(aaa=='1')}"/>
    <mx:TextArea x="60" y="222" width="177" height="158" text="{xml.a.(aaa=='1'
    || bbb=='7')}"/>
    </mx:Application>

    maxrahder Guest

  2. #2

    Default Re: e4x and (&&) won't compile

    You can do stuff like that in a script block because the script block is
    wrapped in CDATA tags.

    To do it in mxml, which is xml, you must use the entity expressions.
    text="{xml.a.(aaa=='99' &amp;&amp; bbb=='7')}"

    Tracy

    ntsiii Guest

  3. #3

    Default Re: e4x and (&&) won't compile

    Great! Thanks!
    maxrahder Guest

Similar Threads

  1. how to compile a VC++ 6.0 ATL project in .net
    By amit bharadwaj in forum ASP.NET Building Controls
    Replies: 0
    Last Post: August 11th, 05:27 AM
  2. compile to CGI
    By Owen Cook in forum PERL Beginners
    Replies: 1
    Last Post: December 25th, 06:06 PM
  3. Compile help...
    By Scott V Nipp in forum PERL Beginners
    Replies: 2
    Last Post: December 4th, 03:40 PM
  4. compile php 4.3.3 with gd
    By kecebong in forum PHP Development
    Replies: 7
    Last Post: October 28th, 12:22 PM
  5. lftp - how to compile it with ssl?
    By Michael Heiming in forum Linux Setup, Configuration & Administration
    Replies: 2
    Last Post: August 3rd, 01:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139