WebMarkupMin.Core.Parsers.XmlParser.ProcessProcessingInstruction C# (CSharp) Method

ProcessProcessingInstruction() private method

Process a XML declaration and processing instructions
private ProcessProcessingInstruction ( ) : bool
return bool
        private bool ProcessProcessingInstruction()
        {
            bool isProcessed = false;
            string content = _innerContext.SourceCode;
            int contentRemainderLength = _innerContext.RemainderLength;

            var match = _processingInstructionRegex.Match(content, _innerContext.Position, contentRemainderLength);
            if (match.Success)
            {
                GroupCollection groups = match.Groups;

                string instruction = match.Value;
                string instructionName = groups["instructionName"].Value;
                string attributesString = groups["attributes"].Value;

                IList<XmlAttribute> attributes = ParseAttributes(attributesString);
                if (String.Equals(instructionName, "xml", StringComparison.OrdinalIgnoreCase))
                {
                    if (_handlers.XmlDeclaration != null)
                    {
                        _handlers.XmlDeclaration(_context, attributes);
                    }
                }
                else
                {
                    if (_handlers.ProcessingInstruction != null)
                    {
                        _handlers.ProcessingInstruction(_context, instructionName, attributes);
                    }
                }

                _innerContext.IncreasePosition(instruction.Length);
                isProcessed = true;
            }

            return isProcessed;
        }