All Implemented Interfaces:
IElementRenderer, IXmlElementRenderer

public class XmlTextItem extends XmlDocumentRendererBase

This class converts an ITextItem implementation to an XML node for document xml generation.

For example rendering a text item with a single text node will result in:

 <TEXT>
   <T>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</T>
 </TEXT>
 

For example rendering a text item with a style node (with text) will result in:

 <STYLE name="bold">
   <TEXT>
     <T>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</T>
   </TEXT>
 </STYLE>
 

For example rendering a text item with a single value node will result in:

 <TEXT>
   <T>van Leuven, J</T>
 </TEXT>
 

For example rendering a text item with a multivalue value node will result in:

 <TEXT>
   <T>
     <VALUES>
       <VALUE first="true">van Leuven, J</VALUE>
       <VALUE>Kerpershoek, O</VALUE>
       <VALUE last="true">van der Meer, F</VALUE>
     </VALUES>
   </T>
 </TEXT>
 
This xml renderer merges text(value)nodes (with the same style), so this structure:
  • 1234
  • /
  • 2
will result in:
 <TEXT>
   <T>1234/2</T>
 </TEXT>
 
and NOT:
 <TEXT>
   <T>1234</T>
   <T>/</T>
   <T>2</T>
 </TEXT>
 
Since:
7.0
Author:
Jon van Leuven
  • Constructor Details

    • XmlTextItem

      protected XmlTextItem(boolean tagsToUpperCase)
  • Method Details

    • toXml

      public IXmlElement toXml(IXmlRendererContext ctx, IElement element)
      Description copied from interface: IXmlElementRenderer
      This function allows one to convert an IElement instance to an XML element. The implementor of this function should only convert the element itself and not it's children as the caller will process these. (Unless ctx.setContinueChildProcessing( false ) has been called)
      Parameters:
      ctx - The context which contains some information and control options.
      element - The element which should be converted.
      Returns:
      an XMLElement class or null indicating this element should not be included in the resulting xml.
    • formatValue

      protected String formatValue(ISingleValue value, ILanguage language)