Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Damiano Piva 5 posts 85 karma points
    Feb 13, 2023 @ 16:42
    Damiano Piva
    0

    ContentAtXPath with case-insensitive and special chars

    I've tryed to get all contents with same name but when i insert a name with an and or an apostrophe my Xpath fails and get zero results. I've created this query:

    var otherNodesWithSameName = _umbracoHelper.ContentAtXPath($"//*[translate(@nodeName,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{SecurityElement.Escape(savedItem.Name.ToLower())}']");
    

    Can anyone help me?

Please Sign in or register to post replies

Write your reply to:

Draft