User-Defined Elements

www.altova.com Expand/Collapse All Print this Topic Previous Page Up One Level Next page

Home >  SPS File: Content > User-Defined Elements, XML Text Blocks >

User-Defined Elements

User-Defined Elements are elements that you can generate in the output without these elements needing to be in any of the schema sources of the SPS. This means that an element from any namespace (HTML or XSL-FO for example) can be inserted at any location in the design. SPS design elements can then be inserted within the inserted element.

 

Note:User-Defined Elements are supported in Authentic View only in the Enterprise Editions of Altova products.

 

Inserting User-Defined Elements

The mechanism for using User-Defined Elements is as follows:

 

1.Right-click at the location in the design where you wish to insert the User-Defined Element.
2.From the context menu that appears, select Insert User-Defined Item | User-Defined Element.
3.In the dialog that appears (screenshot below), enter the element name, the desired attribute-value pairs, and, a namespace declaration for the element if the document does not contain one.

 

DlgEditUserDefElement

 

In the screenshot above an XSL-FO element called leader is created. It has been given a prefix of fo:, which is bound to the namespace declaration xmlns:fo="http://www.w3.org/1999/XSL/Format". The element has a number of attributes, including leader-length and rule-style, each with its respective value. The element, its attributes, and its namespace declaration must be entered without the angular tag brackets.

4.Click OK to insert the element in the design. The element is displayed in the design as an empty template with start and end tags (screenshot below).

 

UserDefElement1

 

5.You can now add content to the template as for any other template. The User-Defined Element may contain static content, dynamic content from the XML document, as well as more additional User-Defined Elements.

 

Note:A User-Defined Element that is intended for a particular output should be enclosed in a suitable output-based condition so as to avoid unexpected results in alternative outputs.

 

 

 


© 2019 Altova GmbH