XML some... Highlight



  • sorry, I do not know its name and function clearly

    I am (trying to) handling XML file
    I remember that when I put my cursor at the start of one Element
    then Notepad++ automatically shows me (highlighted) the end of that Element.

    something like this;

    <myElemeStartssHere…> <-- my cursor here
    Bulah…
    Bulah…
    **</myElemenEndsHere…> ** <- Highlights, Automatically

    How can I achieve it ?

    Thanks



    • Your start and end tags need to match (your example did not match).

        <someTag>
            blah
            blah
        **</someTag>
      
    • Your cursor needs to be inside the tag, not after the >

    • Settings > Preferences > Highlighting > Highlight Matching Tags > ☑ Enable must be enabled.

    If my cursor is anywhere between either of the <> pairs, it will highlight both the <someTag> and the </someTag>.



  • thank for Reply

    yes, I have checked what you said (actually, they are there and done)
    no, I do not have what I wanted.

    the first post have changed under not my control - it just sucks.
    here is the correct XML contents of mine (of course, some of them)

    <SettingsGroup Id="“QAVerificationSettings”">
    <Setting Id="“RegExRules”">True</Setting>
    <Setting Id="“RegExRules0"”>
    <RegExRule xmlns:i="“http://www.w3.org/2001/XMLSchema-instance”" xmlns="“http://schemas.datacontract.org/2004/07/Sdl.Verification.QAChecker.RegEx”"><Description>000000000</Description><IgnoreCase>false</IgnoreCase><RegExSource></RegExSource><RegExTarget>[0-9]{1,}\s%</RegExTarget><RuleCondition>TargetOnly</RuleCondition></RegExRule></Setting>
    <Setting Id="“RegExRules1"”>
    <RegExRule xmlns:i="“http://www.w3.org/2001/XMLSchema-instance”" xmlns="“http://schemas.datacontract.org/2004/07/Sdl.Verification.QAChecker.RegEx”"><Description>111111111</Description><IgnoreCase>false</IgnoreCase><RegExSource></RegExSource><RegExTarget>[0-9]{1,}\s%</RegExTarget><RuleCondition>TargetOnly</RuleCondition></RegExRule></Setting>
    <Setting Id="“CheckTradeMarksSeverity”">1</Setting>
    </SettingsGroup>

    thank



  • @PeterJones

    nice
    yes
    that’s what I wanted

    unfortunately, I still have in trouble



  • @오바마

    make sure that you have enabled highlight matching tags under
    settings->preferences->highlighting

    Eko



  • @Eko-palypse

    thanks comment !

    yes, like I wrote earlier

    under “Highlight Matching Tags”

    checked “Enable”
    checked “Highlight tag attributes”
    checked “Highlight comment/php/asp zone”



  • Sorry for confusion but I haven’t seen that this was already mentioned.
    In fact, when I answered I didn’t see any answer at all. Strange.

    @오바마
    Could it be that the xml file is somehow corrupted?
    What if you just copy and paste your example into a new document
    and set the xml language? Does it work?

    Eko



  • @Eko-palypse

    thank reply

    yes

    now I am in the middle of studying
    so
    I copied just some couple of lines (paired nicely for sure)
    from there into New Notepad++ instances (so no files, just made sure it is xml format using “Language>XML” checked)

    Does it make problem here ?



  • @오바마

    that’s where the xml tools plugin might be useful.
    It has a function validate xml which would point you to the place
    where it discovered the issue. Might be not 100% accurate but
    should give enough info to identify the problematic area.

    Eko



  • @Eko-palypse

    plugIn ? what is that ?
    do I have to use it ?
    I will use it, If I have to.

    BUT
    I remember that I (Notepad++) made nicely highlighted paired element when I put my caret there.

    Thanks.



  • You might want to try to simplify. Take my example document

    <someTag>
        blah
        blah
    </someTag>
    

    Paste it into a new Notepad++ file. With language at default / plain text (Language > Normal Text), it does not show matches for me. If I change the language to XML or HTML, then it does show matches.

    The same thing happened when I used your snippet:

    <SettingsGroup Id="“QAVerificationSettings”">
    <Setting Id="“RegExRules”">True</Setting>
    <Setting Id="“RegExRules0"”>
    <RegExRule xmlns:i=""http://www.w3.org/2001/XMLSchema-instance“” xmlns=""http://schemas.datacontract.org/2004/07/Sdl.Verification.QAChecker.RegEx“”><Description>000000000</Description><IgnoreCase>false</IgnoreCase><RegExSource></RegExSource><RegExTarget>[0-9]{1,}\s%</RegExTarget><RuleCondition>TargetOnly</RuleCondition></RegExRule></Setting>
    <Setting Id="“RegExRules1"”>
    <RegExRule xmlns:i=""http://www.w3.org/2001/XMLSchema-instance“” xmlns=""http://schemas.datacontract.org/2004/07/Sdl.Verification.QAChecker.RegEx“”><Description>111111111</Description><IgnoreCase>false</IgnoreCase><RegExSource></RegExSource><RegExTarget>[0-9]{1,}\s%</RegExTarget><RuleCondition>TargetOnly</RuleCondition></RegExRule></Setting>
    <Setting Id="“CheckTradeMarksSeverity”">1</Setting>
    </SettingsGroup>
    

    It might also have to do with your theme settings (Settings > Style Configurator, look at the Select Theme at the top of the dialog box): are you using the default, or have you edited your colors for the default theme, or do you have another theme selected? Maybe due to your style settings, you just cannot see the highlighting that’s there.

    You might consider doing a screenshot with your cursor inside the <someTag> from my example (like between some and Tag, posting to imgur, and linking by copying the “direct link” and put it here using the syntax ![](https://i.imgur.com/0Mon4gO.png), but replacing my image id with yours. (Make sure you copy the link that uses the i.imgur.com, so it’s directly to the image, rather than imgur’s wrapper page)



  • @PeterJones

    Wow
    I just saw your post
    I thought your post looks Very nice
    And there are your secrets - post pictures somewhere else and just use its address
    How do you do nice Highlight here ?

    Any ways, Main topic…
    I’ll check what you said.

    Thanks





  • I cannot access the links you posted (404 not found)

    The forum uses Markdown (see the ? link next to the COMPOSE label when making a post). For a great guide to using Markdown on this forum, see @Scott-Sumner’s excellent rundown – this includes how to do a code block (which does the syntax highlighting in the forum)



  • @PeterJones

    thanks… all your efforts.

    I just gave up all of them.
    -to make highlight XML
    -to study how to post nicely in the community (this editor is soooo strange)



  • I’m sorry to say like this
    But, it is true
    All of sudden it works
    I Really do not know why
    So
    Some time later
    It will go crazy again maybe
    Until that time I will be happy

    Thanks Guys.


Log in to reply