Count of Nodes in XML file for Clarity
search cancel

Count of Nodes in XML file for Clarity

book

Article ID: 407735

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

In Clarity, there are governor limits on XML max node limit, to prevent any issues with application stability. Those limitations are documented in Increasing Governor Limits in Clarity.

  • Due to these limitations it is important to know how many nodes your import file has so you are able to manage the Max Node Limits and also leverage batching and other strategies for XML import.

Starting 16.3.2, a new command option is introduced within Clarity, which will count the amount of XML nodes in any XML files or TXT files with XML structure.

Environment

Clarity 16.3.2 and higher releases

Cause

This new command was introduced as part of request DE168207

Resolution

Count the number of XML Nodes in a XOG import file with a command: 

  1. Connect to Clarity server
  2. Prepare a few large XML files on that server in a known location
  3. Navigate to $clarity\xog-unzipped\bin
  4. Run the command:

xog -analyze <your file path>

  1. The output will show the exact amount of nodes in your file:

C:\clarity\xog-unzipped\bin>xog -analyze C:\TestFiles\Test_status.xml

=======File Analysis=========

File : C:\TestFiles\Test_status.xml

Node Count : 1491934

Additional Information

  • You can use this command for any XML files, including ones generated by earlier Clarity versions
  • This will output the exact amount of nodes Clarity detects therefore it will exactly match the governor limits
  • TXT files can be used as well as long as they have XML structure saved as .txt
  • If the file does not exist or permissions are not granted, an error will be thrown:
  • Example:  File location [C:\TestFiles\Test_status1.xml] is not valid