Creating XML and XSL Files 
Define the Web form in an XML file. The XML definition contains information about the document schema. For an introduction to this topic, see Example: XML File for a Web Form. In the tables, you can find a list of the attributes that you can specify.
Define the presentation of the Web form in an XSL file. For an introduction to this topic, see Example: XSL File for a Web Form.
Note
Make sure that there are no open HTML tags in the XSL transformations. Otherwise, the Web forms are not assembled correctly by the page builder.
Store the files in the respective KM folders, as follows:
Store the XML file in the etc/wpceditor/types directory.
Store the XSL files in the etc/wpceditor/styles directory.
The <documenttype> element is the root element. The attributes of this element define the general settings for the editor when editing documents of this type.
The <documenttype> document type must contain exactly one <properties> element and exactly one <element> element.
Attribute |
Required and Default Values |
Description |
|---|---|---|
ID |
Required |
Document type ID. This ID must be unique among all configured document types. |
description |
Required |
Key for the country-specific description of the document type. For localization purposes, the system uses the bundle file for the KM configuration object that the XML references. |
showpreview |
Optional Default: false |
Defines whether or not the framework contains the preview function. This function allows users to display a preview with all available stylesheets. |
showelementlist |
Optional Default: false |
Defines whether or not the framework allows users to insert additional elements into the document. If you set this attribute to true, users can insert all elements for which the singleinstance attribute is set to false. |
The properties section must contain one or more <property> elements. These elements define the document properties.
Attribute |
Required and Default Values |
Description |
|---|---|---|
ID |
Required |
Unique property ID. This ID must be unique within the document type. |
description |
Required |
Key for the country-specific description of the property. For localization purposes, the system uses the bundle file for the KM configuration object that the XML references. |
type |
Required |
Specifies the editor component that the system uses to render the property and generate the XML output for the property element The value must match the name of the component in the KM configuration. You can find the components in the standard system in the KM configuration at . |
size |
Optional Default: 40 |
Size of the property. This must be an integer value. If the editor component supports this, the system uses this value to define the size of the components during rendering. If a property is rendered as an input field, for example, the system uses this value for the size of the input field. This attribute is only evaluated if the component supports it. |
isrequired |
Optional Default: false |
Defines whether or not an entry is mandatory. This attribute is only evaluated if the component supports it. |
isfilename |
Optional Default: false |
Defines whether or not the system uses the value as the name of the resource created. This attribute may be set to true in only one property within the document type. |
defaultvalue |
Optional |
Default value for the property |
maxlength |
Optional Default: –1(unlimited) |
Maximum length of the property value. For example, this attribute defines the maximum length of input fields. This attribute is only evaluated if the component supports it. |
hastitle |
Optional Default: true |
Defines whether or not the property has a title field. Some components use this attribute to determine whether or not an input field is displayed for a title (for example, for an ALT text). This attribute is only evaluated if the component supports it. |
property |
Optional |
ID of a KM property in which the property value is stored. The property must be defined in the service for properties and metadata () and it must be assigned to the wpc_wcm namespace (namespace alias: wpc). Example: wpc_wcm_rss |
The <elements> section of the document type must contain one or more <element> elements. These elements define the content of the editor.
Attribute |
Required and Default Values |
Description |
|---|---|---|
ID |
Required |
Element ID. This ID can be freely chosen but must be unique within the document type. |
description |
Required |
Key for the country-specific description of the element. For localization purposes, the system uses the bundle file for the KM configuration object that the XML references. |
type |
Required |
Specifies a component that describes a field (for example, a text input field) in the Web form. The value must match the name of the component in the KM configuration. You can find the components in the standard system in the KM configuration at . |
size |
Optional Default: 40 |
For more information, see size in the <properties> section above. |
isrequired |
Optional Default: false |
For more information, see isrequired in the <properties> section above. |
defaultvalue |
Optional |
For more information, see defaultvalue in the <properties> section above. |
maxlength |
Optional Default: –1(unlimited) |
For more information, see maxlength in the <properties> section above. |
hastitle |
Optional Default: true |
For more information, see hastitle in the <properties> section above. |
property |
Optional |
For more information, see property in the <properties> section above. |
singleinstance |
Optional Default: false |
Defines whether or not the element is part of the Add Element list. If this attribute has the value false, users can add new instances of the element (provided this is activated for the document type). |
default |
Optional Default: false |
Defines whether or not the element is included in the document by default when users create a new document. If this value is false, users have to add the element to the document manually. If the singleinstance attribute is set to true and the default attribute is set to false, users cannot add the element to the document in any way. |
nodelete |
Optional Default:false |
Defines whether or not the element can be deleted from the document. |
In the XML file of your new Web form, you specify a number of different elements. For each of these elements, you have to specify an editor component that actually provides the new element with the required functionality. You should specify the required editor component by entering its name in the type attribute of the element.
Example
<element id="heading1" description="xml.xlbl.heading1" type="inputfield" size="50" default="true"/>
To find the editor components delivered by SAP, navigate to .
The following table describes all the editor components delivered by SAP.
Component ID |
Description |
|---|---|
checkbox |
Checkbox component This editor component provides a standard checkbox that is used to enable or disable standard Web Page Composer functionality (for example, Include in RSS, Show Table of Contents, Display New Icon). |
htmledit |
HTML edit component This editor component provides a field with text editing functionality and basic formatting features. It also allows Web page content to be copied and pasted. When using the Copy/Paste functionality, HTML characters and tags are escaped. |
htmleditadvanced |
Advanced HTML edit component This editor component provides a field with text editing functionality, functionality for creating tables, and advanced formatting features. The Advanced HTML edit component offers the same capabilities as the HTML Editor used in Knowledge Management (KM). |
imageselect |
Image Select component This editor component provides a field for image selection. Users can browse for images stored in Knowledge Management. The component also allows users to resize the selected image. |
inputfield |
Input field component This editor component provides a single-line input field where users can enter text. |
peoplepicker |
People Picker Component This editor component provides a user selection dialog box that allows user selection from User Management. The user selection dialog box is the same as the one used in Knowledge Management and Collaboration. |
textedit |
Text edit component This editor component provides a multi-line input field where users can enter text. |
wpclink |
Link component This editor component provides a field that allows users to create links. Users can enter the title of the link and the link URL. Using the Browse functionality, users can also create links to documents stored in Knowledge Management. |