Element type must be followed by either attribute specifications

Element type “ns1:MyComponent” must be followed by either attribute specifications, “>” or “/>”.

<ns1:MyComponent id="myframe"
	fontSize="10
	editable="false"/>

This error comes from not closing an attribute tag. Look at the font size attribute in the code above. Leaving out the closing quotation mark caused this error.

Please reply in the comments below if this helped you or not

This entry was posted in Flex. Bookmark the permalink.

10 Responses to Element type must be followed by either attribute specifications

  1. dev says:

    It really helped dude! Thanks.

  2. Tom says:

    This can happen in XSLT, too, where you want to put in some HTML code but it complains about not finding a “{/body}” tag. Seems like it only likes {xsl:text disable-output-escaping=”yes”}{/xsl:text} and you have to put your HTML in one of those, and it has to have tags around it, and then you have to convert all the stupid “<” to “&lt;” and “>” to “&gt;”, which I think is dumb that they make you do that, but that’s just my opinion on it…

  3. You can also get this error if you don’t leave a space between one attribute and the next:

    Note: the code was stripped. from the description above this may be the desired example – ed.
    [xml][/xml]

    Thanks :)

  4. maitree_mohapatra says:

    Actually I am getting the same message again again even if I close the tags .Below is my code:-

    Login CVS

    Main target

    When I am calling the build.xml using this command :-
    ant -Dtag_line=uat_rel_Apr_19_2011_01 -Dtarget=.
    then I am getting this below error
    Element type “cvs” must be followed by either attribute specifications, “>” or “/>”.
    pls help

  5. srvikram13 says:

    This really helped. Thanks!

    Just to summarize, this error comes
    1. from not closing an attribute tag;
    2. if you don’t leave a space between one attribute and the next; and
    3. if you use double quotes within double quotes or single quotes within single quotes :)

    Hope this helps somebody.

  6. Joe says:

    Thanks!

  7. Ethan Solly says:

    I do it, but it still doesn’t work!

    This is my code:
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&quot;
    xmlns:tools="http://schemas.android.com/tools&quot;
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity"

    />

Leave a Reply

Your email address will not be published. Required fields are marked *

Wrap your code before posting! Click the links below:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">