Page last modified 10:20, 23 Oct 2015 by juhako

.xmlElementBlockSize() Redirected from User Guides/myXML/5: OCL Rules/Available methods for OCL base types/.xmlElementBlockSize()

    Table of contents

    Description of the method

     

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

    Example

     

    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.

    <Debtor>
      <Name>name</Name>
    </Debtor>


    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:
     

     <Debtor>
         <!--comment-->
          <Name>name</Name>
    </Debtor>
    xmlElementBlockSize = 31
    Comments are included to length.
    <h:Debtor>
          <h:Name>name</h:Name>
    </h:Debtor>

    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.

    Menu