Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
License

Description attributes



The descriptions element specifies attributes which will be considered as descriptions. The comparison of these attributes can be a little more lax than the comparison for other attributes.

The attributes of this element are:
  • "removeNewLines": true if new lines must be removed for the comparison (false by default)
  • "trimType": specifies if the content must be right trimmed ("TrimRight"), or trimmed at the left and right ("Trim")
This element can have the following children :
  • The applyRegex children (optional) specify a regex which an be applied to the attribute value
  • The description child (mandatory) specify the attribute of the element which will be considered as a description

applyRegex children

The applyRegex children (optional) specify a regex which an be applied to the attribute value. For example, if we have:
   <rule>
      <appliesOn>
         <nodeName name="desc" />
      </appliesOn>  
      <descriptions>
         <applyRegex replaceFrom="\s+" replaceTo=" " />
         <applyRegex replaceFrom="&#10;" replaceTo="&#xA;" />            
         <description name="value" /> 
      </descriptions>
   </rule>
The comparison of the following nodes will return:
Left Right Result
<desc value="the value" /> <desc value="the value" /> Identical
<desc value="the &#xA; value" /> <desc value="the &#10; value" /> Identical
<desc value="the value1" /> <desc value="the value2" /> Different

Example

For example:
   <rule>
      <appliesOn>
         <nodeName name="description" />
      </appliesOn>  
      <descriptions trimType="Trim">
         <applyRegex replaceFrom="\s+" replaceTo=" " />
         <applyRegex replaceFrom="&#10;" replaceTo="&#xA;" />            
         <description name="value" /> 
      </descriptions>
   </rule>

See also


Categories: core

xmldiff Copyright (c) 2024 Herve Girod. All rights reserved.