EnglishDeutschFrançais

1.4 How can I use my own custom tags and custom attributes in my documents?

Per default, edit-on Pro validates the content against the XHTML Transitional DTD. Unless the parameters "dropillegalattributes" and "dropillegaltags" are set to false (see also FAQ 1.2), edit-on Pro removes all tags and attributes which aren't included in the XHTML Transitional DTD. Otherwise it will preserve all illegal tags, which means it preserves all tags and attributes that aren't XHTML compliant, including custom tags.

 

In order to preserve only your custom tags and custom attributes you must perform the following steps:

 

  1. Create a custom DTD containing your tags and attributes
    To create a custom DTD containing custom tags and attributes, you can use the xhtml1-transitional.dtd contained in the doc/resources folder of the edit-on Pro installation package as basis for your modifications.
    For more information about how to customize a DTD, please review the edit-on Pro integration manual, chapter 7.2 Defining Custom Tags

  2. Load the custom DTD into edit-on Pro
    You must load a template referring to the modified xhtml1-transitional.dtd before loading any other content. To do so, use the method setTemplateURL() in the page loading the applet.

    Example:

    eop.setTemplateURL("template.xhtml");

    For more information about how to customize a DTD, please review the edit-on Pro integration manual, chapter 7.1 Specifying a custom DocType

  3. Load a style sheet for advanced features
    In case you want to use advanced features such as readonly tags, you must load a corresponding style sheet. This style sheet must contain the appropriate styles for your custom tags.

    For more information about how to customize a DTD, please review the edit-on Pro integration manual, chapter 2. edit-on Pro CSS extension

A sample which demonstrates the use of custom tags and attributes is included in the edit-on Pro installation package in the folder /samples/customdtd and is also available online at edit-on Pro Custom DTD Sample.
Please also read the samples readme.txt file as it provides some further information.

 

Copyright © 2000-2008 RealObjects GmbH