widget element

Syntax

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="string" 
        id="string"
        xml:lang="string">
</widget>

Description

The <widget> element provides a container for all other elements and it's the root element in the config.xml file for a BlackBerry WebWorks app.

Parent elements

None

Child elements

Many. For a list of elements, see the Elements in config.xml table.

Occurrences

One, at the root of the config.xml file.

Attributes

You can use the following attributes in the <widget> element:

Attribute Description

xmlns

Defines the namespace for the BlackBerry WebWorks app. The value must be "http://www.w3.org/ns/widgets". If this namespace is missing, the app archive is not valid.

This attribute is required.

xmlns:rim

Defines the namespace for the BlackBerry WebWorks extensions. The value must be "http://www.blackberry.com/ns/widgets".

This attribute is required.

version

Specifies a valid version for the app, in one of the following formats:

  • x.x.x
  • x.x.x.x

If you specify a version number that is not valid, the app archive is not valid.

This attribute is required.

id

Specifies a unique identifier for the app.

Unless you are repackaging an app from another platform, you should use a reverse DNS format for all platforms, for example, id="com.somedomain.HelloWorld".

This attribute is sometimes required. If you are resubmitting your app to BlackBerry World with a different archive file name, the value you specify for the id attribute must match the name of the archive file (without the file extension) that you previously submitted. The id attribute is optional if the archive file name matches the name of the previously submitted archive file.

xml:lang

Specifies the language that is used in the element. For more information about this attribute, visit www.w3.org/TR/html401/struct/dirlang.html.

This attribute is optional.

Example

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="2.0.0.0"
        xml:lang="en">
</widget>

Last modified: 2013-08-29