Example #1
0
        /// <summary>
        /// Given an xml element, checking whether its lenght exceeds @LengthLimit; if it does,
        /// folding part of it to a fake node containing only its local name; Keep doing so until
        /// the element's length is in the limit.
        /// </summary>
        /// <param name="element"></param>
        private void FoldingElement(XElement element)
        {
            var it = new ExpandingCountsIterator(element);

            while (it.HasNextCounts())
            {
                var expandingCounts = it.GetNextCounts();
                // LocalFileWriter.write(it.ConvertCountsToString(expandingCounts));
                FoldingXml(element, e => IsXElementFolding(e, expandingCounts));
                if (GetLineLength(element) < LengthLimit)
                {
                    return;
                }
            }
        }
Example #2
0
 /// <summary>
 /// Given an xml element, checking whether its lenght exceeds @LengthLimit; if it does,
 /// folding part of it to a fake node containing only its local name; Keep doing so until
 /// the element's length is in the limit.
 /// </summary>
 /// <param name="element"></param>
 private void FoldingElement(XElement element)
 {
     var it = new ExpandingCountsIterator(element);
     while (it.HasNextCounts())
     {
         var expandingCounts = it.GetNextCounts();
         // LocalFileWriter.write(it.ConvertCountsToString(expandingCounts));
         FoldingXml(element, e => IsXElementFolding(e, expandingCounts));
         if (GetLineLength(element) < LengthLimit)
             return;
     }
 }