Tapatalk

Indent Rules for XML files

Indent Rules for XML files

4

    Oct 25, 2006#1

    Hi everyone, i'd like to set the AutoIndent for XML files (as made automatically by Internet Explorer, for instance),
    i know i have to set "Indent String ="
    and "Unindent String=" in wordfile.txt,
    ----------------------
    Here my trials:
    /Indent Strings = "<"name=*">"
    /Unindent Strings = "</"name=*">"
    ----------------------

    but i didn't manage to find the correct syntax in order to autoindent everytimes a tag occurs in file (opening or closing)
    Could you give me some suggestion?
    Thank you very much!
    :D

    6,685587
    Grand MasterGrand Master
    6,685587

      Oct 25, 2006#2

      Regular expressions cannot be used for indent and unindent strings. Maybe following is enough - have not tested it:

      /Indent Strings = "">"
      /Unindent Strings = "</"
      Best regards from an UC/UE/UES for Windows user from Austria

      4

        Oct 25, 2006#3

        Thank for reply, i have already made that trial, but it doesn't work!
        :roll:

        6,685587
        Grand MasterGrand Master
        6,685587

          Oct 26, 2006#4

          A small question: Are the tag names in double quotes in your XML files highlighted as strings?

          Yes, then that's one of the reasons why the indent string does not work because the " is part of a string and indent strings are ignored in strings. Make following changes:
          1. In the language definition line insert or modify the string character definition to String Chars = '. With this modification the simple indent string should work (not tested in lack of an example).
          2. To highlight double quoted strings with the color of strings or a different color add following line above /C1"..":

            /Marker Characters = """"

            And create a color group for the marker characters like:

            /C8"Double quoted strings"
            ""


            Now you can specify the color for double quoted strings too.
          But all these changes will not help for the indent string "">".

          Reason: The double quote character is used in the wordfile as indent string delimiter. So UE reads "" and >" and ignores that because invalid syntax for indent strings.

          I don't know if there is an escape character which can be used to tell UE that the following " character should be part of the indent string and is not a indent string delimiter. Ask IDM support by email.

          But I think, there is none. If you always edit the same sort of XML files and there are not too many different name= and </name> tag pairs you can specify all that strings as indent and unindent strings.
          Best regards from an UC/UE/UES for Windows user from Austria