This project has moved and is read-only. For the latest updates, please go here.
1
Vote

HtmlNode.XPath Property CASE

description

Even when OptionOutputOriginalCase = True, the XPath property is still returned as ALL LOWER CASE.

Since XPath expressions are Case Sensitive, this is incorrect.

The XPath property should ONLY be converted to lower case IF OptionOutputOriginalCase = False!

comments

WardMD wrote Jan 15, 2016 at 6:42 PM

I believe the solution to this, is the (_ownerdocument.OptionOutputOriginalCase ? _name : _name.ToLower();) below:
    public string Name
    {
        get
        {
            if (_optimizedName == null)
            {
                if (_name == null)
                    Name = _ownerdocument.Text.Substring(_namestartindex, _namelength);

                if (_name == null)
                    _optimizedName = string.Empty;
                else
                    _optimizedName = _ownerdocument.OptionOutputOriginalCase ? _name : _name.ToLower();
            }
            return _optimizedName;
        }
        set { _name = value; _optimizedName = null; }
    }
Regards,
Mark Ward
Carson, CA