Method checks the content length of an element.

Description of the method

Description: xmlElementBlockSize method checks the content length of an element. This lenght includes tags as well as values without pretty printing the XML.
Available for: any
Parameters: -
Return type: integer


Context: PartyIdentification
OCL: self.xmlElementBlockSize() = 17
Description: The example rule checks the lenght of PartyIdentification content including tags and values.


The XML snippet below would pass this check.


The following data is taken into account when calculating the length in the above example "<Name>name</Name>". The indentation before the name element as well as the line feed before and after the element are omitted.

Some more examples below:

xmlElementBlockSize = 31
Comments are included to length.

xmlElementBlockSize = 21
If element is not in the default namespace and namespace prefixes are used, the prefixes will also be included to length.


Attached you can find example schema and files which you can use for testing: