Metadata XML Reference

From Aptana Development

This page describes the valid elements, attributes, and attribute values for the html.xml file.

Contents

Introduction

The metadata in the XML file helps to provide the Code Assist information for the HTML and CSS editors. This reference describes which elements, attributes, and attribute values are valid for the metadata files.

The section for each element includes the following information:

  • Short description of the element
  • Syntax
  • Element parents and children
  • Element attributes and their valid values
  • Longer explanation of the element
  • Example(s)
  • Which browsers support this element

Once you have created this file, see Adding support for a new Ajax library for the general case how to use it, and Adding Code Assist for the specifics.

Short Example

This example is not meant to be exhaustive, but will give you an example of what a simple file looks like.

<content-assist>
    <elements>
        <element name="tagName" related-class="relatedTag" full-name="fullTagName">
			<description>Element description.</description>
			<example>Example containing element.</example>
			<remarks>Comments about the element.</remarks>		
            <fields>
			<field name="nameOfReusableElementAttribute" />
			<field name="nameOfUniqueElementAttribute" type="String">
				<description>Element Attribute description.</description>
				<values>
					<value name="attributeValue" description="Attribute value description" />
				</values>
				<hint>Hint or example.</hint>
				<browsers>
           				 <browser platform="browserName" version="versionNumber" />
				</browsers>
				<availability>
					<specification name="W3C" version="HTML 4.01" />
				</availability>
			</field>
            </fields>
            <events>		
		<event name="eventName" />
            </events>
            <browsers>
           	<browser platform="browserName" version="versionNumber" />
            </browsers>
            <availability>
		<specification name="W3C" version="HTML 4.01" />
            </availability>
            <references>
                <reference name="relatedElementName"/>
            </references>
        </element>
    </elements>
</content-assist>
			

Reference

availability

Container node for the specifications (e.g. W3C specification) that apply to an element, field, or event.

Syntax


<availability>
	<specification name="name1" />
</availability>

Child of: element, event, field

Parent of: specification

Attributes and values

No attributes and values.

Description

The availability element element lists the specifications (e.g. W3C specification) that apply to an element, field, or event.

In the DOM, CSS, HTML metadata, the availability and specification nodes hold information about the W3C specification for an element or object.

Example

<availability>
	<specification name="W3C" version="HTML 4.01" />
</availability>

browser

Holds the information about browser support for an element, field, or event.

Syntax


<browsers>
	<browser platform="browserName1" version="version" os="operatingSystem osVersion="operatingSystemVersion">
		<description>Notes</description>
	</browser>
	<browser platform="browserName2" version="version" />
</browsers>

Child of: browsers

Parent of: description

Attributes and values

  • platform - Name of the browser platform. Use "IE", "Mozilla", "Netscape", "Opera", or "Safari".
  • version - Platform version (optional but recommended)
  • os - Operating system (optional)
  • osVersion - OS version

Description

The browser element lists the browser support information that applies to a element, field, or event.

Use the child description node to list any caveats or notes about the browser support for that particular element, field, or property.

Example

<browsers>
	<browser platform="IE" version="4.0+"/>
	<browser platform="Mozilla" version="1.0+"/>
	<browser platform="Netscape" version="3.0+"/>
	<browser platform="Opera" version="7.0+" />
	<browser platform="Safari" version="1.0+" />
</browsers>

browsers

Container node that holds browser nodes, which have the information about browser support for a class, constructor, method, or property.

Syntax


<browsers>
	<browser platform="browserName1" version="version" os="operatingSystem osVersion="operatingSystemVersion">
		<description>Notes</description>
	</browser>
	<browser platform="browserName2" version="version" />
</browsers>

Child of: element, field, event

Parent of: browser

Attributes and values

No attributes or values.

Description

The browsers element holds the browser nodes for a element, field, or event.

Example

<browsers>
	<browser platform="IE" version="4.0+"/>
	<browser platform="Mozilla" version="1.0+"/>
	<browser platform="Netscape" version="3.0+"/>
	<browser platform="Opera" version="7.0+" />
	<browser platform="Safari" version="1.0+" />
</browsers>

content-assist

Container node for all HTML metadata nodes.

Syntax


<content-assist>
	<elements>
		...
	</elements>
</content-assist>

Child of: None.

Parent of: elements, fields, events

Attributes and values

No attributes or values.

Description

The content-assist node contains the elements node which holds all of the HTML element metadata. Below the elements, content-assist also contains the fields node (which contains modular, reusable field nodes) and the events node.

Example

<content-assist>
	<elements>
	...
	</elements>
	<fields>
	...
	</fields>
	<events>
	...
	</events>
</content-assist>

deprecated

If present, indicates that an element, field, or event is deprecated.

Syntax


<deprecated>Deprecated in favor of newElement | newField| newEvent.</deprecated>

Child of: element, field, event

No children.

Attributes and values

No attributes or values.

Description

If present, the deprecated element indicates that an element, field, or event has been deprecated. The node text describes the replacement element, field, or event.

Example


<deprecated>Font attributes are deprecated in favor of CSS styling.</deprecated>

description

Contains the text description of a browser support node, element, field, or event.

Syntax


<description>Text description.</description>

Child of: browser, element, field, event No children.

Attributes and values

No attributes or values.

Description

Contains the text description of a browser support node, element, field, or event. For browser support, the description contains notes and caveats about the browser support for a element, field, or event.

Example


<field name="allowtransparency" type="String">
			<description>Specifies whether the background of the element may be transparent.</description>
</field>

element

Contains information about an HTML element.

Syntax


<element name="tagName" related-class="relatedTagName" full-name="fullTagName">
	<description>Element description.</description>
	<example>Element example text.
	</example>
	<remarks>Element remarks.</remarks>
	<fields>
		<field name="fieldName1" />
		<field name="fieldName2" />
	</fields>
	<events>
		<event name="eventName1" />
		<event name="eventName2" />
	</events>
	<browsers>
		<browser platform="browser1" version="1.0+" />
		<browser platform="browser2" version="1.0+" />
	</browsers>
	<availability>
		<specification name="W3C" version="HTML 4.01" />
	</availability>
        <references>
                <reference name="relatedTagName"/>
        </references>
</element>

Child of: elements Parent of: availability, browsers, deprecated, description , example, events, fields, remarks

Attributes and values

  • name - name of the HTML element (e.g. "a")
  • related-class - (Optional) Name of related element
  • full-name - Full name of the element (e.g. "anchor")

Description

The element node contains the information about an HTML element.

Example


<element name="select" related-class="HTMLSelectElement" full-name="Selection List">
			<description>Defines a selection list control in a form.</description>
			<example>
			<p>This example shows a select list of dog breeds with three list items. The two large breeds are grouped together into an option group.</p>
<pre><code>
&lt;select name="dog" id="dog" &gt;
	&lt;optgroup label= "bigDogs" &gt;
		&lt;option id="lab" label="lab" value="lab" &gt; Labrador retriever &lt;/option&gt;
		&lt;option id="golden" label="golden" value="golden" &gt; Golden retriever &lt;/option&gt;
	&lt;/optgroup&gt;
	&lt;option id="pug" label="pug" value="pug" &gt; Pug &lt;/option&gt;
&lt;/select&gt;
</code></pre>
			</example>
			<remarks>&lt;option&gt;&lt;/option&gt; tags should always be nested within a &lt;select&gt;&lt;/select&gt; element.</remarks>
			<fields>
				<field name="accesskey" />
				<field name="align" />
				<field name="class" />
				<field name="datafld" />
				<field name="datasrc" />
				<field name="dir" />
				<field name="disabled" />
				<field name="hidefocus" />
				<field name="id" />
				<field name="lang" />
				<field name="language" />
				<field name="multiple" />
				<field name="name" />
				<field name="size" />
				<field name="style" />
				<field name="tabindex" />
				<field name="title" />
				<field name="unselectable" />
			</fields>
			<events>
				<event name="onactivate" />
				<event name="onafterupdate" />
				<event name="onbeforeactivate" />
				<event name="onbeforecut" />
				<event name="onbeforedeactivate" />
				<event name="onbeforeeditfocus" />
				<event name="onbeforepaste" />
				<event name="onbeforeupdate" />
				<event name="onblur" />
				<event name="onchange" />
				<event name="onclick" />
				<event name="oncontextmenu" />
				<event name="oncontrolselect" />
				<event name="oncut" />
				<event name="ondblclick" />
				<event name="ondeactivate" />
				<event name="ondragenter" />
				<event name="ondragleave" />
				<event name="ondragover" />
				<event name="ondrop" />
				<event name="onfocus" />
				<event name="onfocusin" />
				<event name="onfocusout" />
				<event name="onhelp" />
				<event name="onkeydown" />
				<event name="onkeypress" />
				<event name="onkeyup" />
				<event name="onlosecapture" />
				<event name="onmousedown" />
				<event name="onmouseenter" />
				<event name="onmouseleave" />
				<event name="onmousemove" />
				<event name="onmouseout" />
				<event name="onmouseover" />
				<event name="onmouseup" />
				<event name="onmousewheel" />
				<event name="onmove" />
				<event name="onmoveend" />
				<event name="onmovestart" />
				<event name="onpaste" />
				<event name="onpropertychange" />
				<event name="onreadystatechange" />
				<event name="onresize" />
				<event name="onresizeend" />
				<event name="onresizestart" />
				<event name="onselectstart" />
			</events>
			<browsers>
           		<browser platform="IE" version="2.0+" />
				<browser platform="Netscape" version="1.0+" />
				<browser platform="Mozilla" version="1.0+" />
				<browser platform="Opera" version="4.0+" />
				<browser platform="Safari" version="1.0+" />
			</browsers>
			<availability>
				<specification name="W3C" version="HTML 4.01" />
			</availability>
            <references>
                <reference name="HTMLSelectElement"/>
            </references>
		</element>

elements

Container node for element node(s).

Syntax

<elements>
        <element name="element1" related-class="relatedTag" full-name="fullTagName">
        ...
        </element>
        <element name="element2" related-class="relatedTag" full-name="fullTagName">
        ...
        </element>
</elements>

Child of: content-assist Parent of: element

Attributes and values

No attributes or values.

Description

Container node that holds all of the element nodes for the HTML metadata.

Example


<elements>
        <element name="a" related-class="Link" full-name="Anchor">
        ...
        </element>
        <element name="abbr" related-class="HTMLElement" full-name="Abbreviation">
        ...
        </element>
        ...
</elements>

example

Contains an example of how to use an element.

Syntax


<example>Code example and explanation.</example>

Child of: element No children.

Attributes and values

No attributes or values.

Description

Contains the text description of a code sample. Also contains the code sample itself. Because examples are rendered as HTML, actual code formatting should use HTML entities and escape characters so that they display properly.

Example


<example>
			<p>This example shows a form that collects a customer's name and phone number in two text input elements, a textarea element for feedback, and has both submit and reset input elements:</p>
<pre><code>
&lt;form action="thankyou.html" name="orderform" id="orderform" method="get" 
onsubmit="return validate();"
onreset="return confirm('Clear all fields and reset form?');"&gt;
	&lt;input type="text" id="customerName" name="customerName" /&gt;
	&lt;input type="text" id="phoneNumber" name="phoneNumber" /&gt;
	&lt;textarea name="feedback" id="feedback" rows="10" cols="80" &gt; &lt; /textarea&gt;
	&lt;br /&gt;
	&lt;input type="submit" name="Submit" id="submit" value="Submit" /&gt;
	&lt;input type="reset" name="Reset" id="reset" value="Reset" /&gt;
&lt;/form&gt;
</code></pre>
			</example>

event

Contains information about an event for an HTML element.

Syntax


<event name="eventName" type="Function">
	<description>Description of what causes the event to fire.</description>
	<browsers>
           <browser platform="browser1" version="4.0+" />
           <browser platform="browser2" version="4.0+" />
	</browsers>
	<availability>
		<specification name="W3C" version="HTML 4.01" />
	</availability>
</event>

Child of: events

Parent of: availability, browsers, deprecateddescription

Attributes and values

  • name - Event name
  • type - "Function"

Description

Contains information about an event that can fire on an HTML element.

Example

<events> <event name="ontimeerror" type="Function"> <description>Fires when a time-related error occurs.</description>

           <browsers>
               <browser platform="IE" version="4.0+" />
           </browsers>
       </event>	

<event name="onunload" type="Function"> <description>Fires when the content of the element finishes unloading.</description> <browsers>

          		<browser platform="IE" version="4.0+" />

<browser platform="Netscape" version="1.0+" /> <browser platform="Mozilla" version="1.0+" /> <browser platform="Opera" version="4.0+" /> <browser platform="Safari" version="1.0+" /> </browsers> <availability> <specification name="W3C" version="HTML 4.01" /> </availability>

       </event>

</events>

events

Container node for event nodes that can fire on HTML elements.

Syntax


<events>
	<event name="event1" type="Function">
	...
	</event>
	<event name="event2" type="Function">
		...
	</event>
</events>

Child of: content-assist, element

Parent of: event

Attributes and values

No attributes or values.

Description

Container node for event nodes that can fire on HTML elements.

Example

<events> <event name="ontimeerror" type="Function"> <description>Fires when a time-related error occurs.</description>

           <browsers>
               <browser platform="IE" version="4.0+" />
           </browsers>
       </event>	

<event name="onunload" type="Function"> <description>Fires when the content of the element finishes unloading.</description> <browsers>

          		<browser platform="IE" version="4.0+" />

<browser platform="Netscape" version="1.0+" /> <browser platform="Mozilla" version="1.0+" /> <browser platform="Opera" version="4.0+" /> <browser platform="Safari" version="1.0+" /> </browsers> <availability> <specification name="W3C" version="HTML 4.01" /> </availability>

       </event>

</events>

field

Container node for information about an HTML element field, which is an attribute for an HTML element.

Syntax

<field name="fieldName" type="fieldType">
	<description>Field description.</description>
	<hint>[Hint for field use.]</hint>
	<values>
		<value name="fieldValue1" description="Value description." />
		<value name="fieldValue2" description="Value description." />
	</values>
	<browsers>
		<browser platform="browserName" version="versionNumber" />
	</browsers>
	<availability>
		<specification name="W3C" version="HTML 4.01" />
	</availability>
</field>

Child of: #fields

Parent of: availability, browsers, description, hint, values Attributes and Values

  • name - Field name
  • type - Field type

Description

Container node for information about an HTML element field, which is an attribute for an HTML element.

Example

<field name="color" type="String">
	<description>Name of the color or RGB code for the color for the element.</description>
	<hint>[color | "transparent"]. Example values: Red, #FF0000 (#RRGGBB color code for "red"), etc.</hint>
	<browsers>
                <browser platform="IE" version="2.0+" />
		<browser platform="Netscape" version="1.0+" />
		<browser platform="Mozilla" version="1.0+" />
		<browser platform="Opera" version="4.0+" />
		<browser platform="Safari" version="1.0+" />
	</browsers>
	<availability>
		<specification name="W3C" version="HTML 4.01" />
	</availability>
</field>

fields

Container nodes for the individual field nodes of an HTML element.

Syntax

<fields>
	<field name="field1" type="fieldType">
	...
	</field>
	<field name="field2" type="fieldType">
	...
	</field>
</fields>

Child of: content-assist, element Parent of: field

Attributes and values

No attributes and values.

Description

Container nodes for the individual field nodes of an HTML element.

Example

<fields>
	<field name="id" />
	<field name="src" />
</fields>

hint

Provides a short hint or example about the syntax or possible values for a field.

Syntax

<hint>[Field hint.]</hint>

Child of: field Parent of: No children.

Attributes and Values

No attributes and values.

Description

Provides a short hint or example about the syntax or possible values for a field. The brackets are part of the style convention for this node. The information in the hint node appears as a short tooltip in the Editor.

Example

<hint>[color | "transparent"]. Example values: Red, #FF0000 (#RRGGBB color code for "red"), etc.</hint>



reference

Holds a reference to a related element.

Syntax

<references>
	<reference name="referenceName"/>
</references>

Child of: references

No children.

Attributes and values

  • name - Name of the reference.

Description

Reference to a related element.

Example

<references>
	<reference name="link"/>
</references>

references

Container node for reference(s) for a related element.

Syntax

<references>
	<reference name="referenceName"/>
</references>

Child of: element

Parent of: reference

Attributes and values

No attributes or values.

Description

Container node for reference(s) for a related element. In the online Help, creates an automatic link to the reference.

Example

<references>
	<reference name="link"/>
</references>

remarks

Contains text remarks about an element, field, or event.

Syntax

<remarks>
	Text remarks.
</remarks>

Child of: element, field, event

No children.

Attributes and values

No attributes or values.

Description

Contains text remarks about an element, field, or event. Remarks are generally longer and give additional information to the sibling description node. Remarks are rendered in HTML and can contain HTML entities and escape characters for formatting.

Example

<remarks>&lt;optgroup&gt;&lt;/optgroup&gt; tags should always be nested within a &lt;select&gt;&lt;/select&gt; element.</remarks>	




specification

The specifications (e.g. W3C specification) that apply to an element, field, or event.

Syntax


<availability>
	<specification name="name1" />
</availability>

Child of: specification

No children.

Attributes and values

  • name - Name of the specification
  • version - Version of the specification (optional)

Description

The specification element(s) lists the specifications (e.g. W3C specification) that apply to an element, field, or event.

In the DOM, CSS, HTML metadata, the availability and specification nodes hold information about the W3C specification for an element or object.

Example

<availability>
	<specification name="W3C" version="HTML 4.01" />
</availability>

value

Contains a possible value for a field.

Syntax


<values>
	<value name="value1" description="Value description." />
	<value name="value2" description="Value description." />
</values>

Child of: values

No children.

Attributes and values

  • name - Name of the attribute.
  • description - Attribute description.

Description

Contains a valid value for an attribute for a field.

Example

<values>
	<value name="*" description="Specify a media type not on this list." />
	<value name="all" description="Any sort of media." />
	<value name="aural" description="Audio output." />
	<value name="braille" description="Braille." />
	<value name="print" description="Print or hardcopy." />
	<value name="projection" description="Projection on a wall or screen." />
	<value name="screen" description="Computer screen." />
	<value name="other" description="Other." />
</values>

values

Container node for the individual value nodes for a field.

Syntax

<values>
	<value name="value1" description="Value description." />
	<value name="value2" description="Value description." />
</values>

Child of: field

Parent of: value

Attributes and values

No attributes or values.

Description

Container node for the individual value nodes for a parameter.

Example

<values>
	<value name="*" description="Specify a media type not on this list." />
	<value name="all" description="Any sort of media." />
	<value name="aural" description="Audio output." />
	<value name="braille" description="Braille." />
	<value name="print" description="Print or hardcopy." />
	<value name="projection" description="Projection on a wall or screen." />
	<value name="screen" description="Computer screen." />
	<value name="other" description="Other." />
</values>

Related Topics



Aptana Developer Home