Community
    • Login

    Help wanted with XML editing

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 330 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • John RussellJ
      John Russell
      last edited by

      Below is an example of some game config files that I 'am writing/changing/editing/modding.

      <WinchVariants>
      	<Winch
      		Name="w_medium_trucks_default"
      		Length="28.0"
      		StrengthMult="0.5"
      		IsEngineIgnitionRequired="true"
      	>
      		<GameData
      			Price="1000"
      			UnlockByExploration="false"
      			UnlockByRank="1"
      		>
      			<WinchParams
      			/>
      			<UiDesc
      				UiDesc="UI_WINCH_UPGRADE_MED_TRUCKS_DEFAULT_DESC"		
      				UiIcon30x30=""
      				UiIcon40x40=""
      				UiName="UI_WINCH_UPGRADE_MED_TRUCKS_DEFAULT_NAME"
      			/>
      		</GameData>
      	</Winch>
      	<Winch
      		Name="w_medium_trucks_ext"
      		Length="36.0"
      		StrengthMult="0.5"
      		IsEngineIgnitionRequired="true"
      	>
      		<GameData
      			Price="11300"
      			UnlockByExploration="false"
      			UnlockByRank="8"
      		>
      			<WinchParams
      			/>
      			<UiDesc
      				UiDesc="UI_WINCH_UPGRADE_MED_TRUCKS_EXT_DESC"
      				UiIcon30x30=""
      				UiIcon40x40=""
      				UiName="UI_WINCH_UPGRADE_MED_TRUCKS_EXT_NAME"
      			/>
      		</GameData>
      	</Winch>
      	<Winch
      		Name="w_medium_trucks_pow"
      		Length="28.0"
      		StrengthMult="0.65"
      		IsEngineIgnitionRequired="true"
      	>
      		<GameData
      			Price="15000"
      			UnlockByExploration="false"
      			UnlockByRank="12"
      		>
      			<WinchParams
      			/>
      			<UiDesc
      				UiDesc="UI_WINCH_UPGRADE_MED_TRUCKS_POW_DESC"
      				UiIcon30x30=""
      				UiIcon40x40=""
      				UiName="UI_WINCH_UPGRADE_MED_TRUCKS_POW_NAME"
      			/>
      		</GameData>
      	</Winch>
      		<Winch
      		Name="w_medium_trucks_ext_pow"
      		Length="36.0"
      		StrengthMult="0.65"
      		IsEngineIgnitionRequired="true"
      	>
      		<GameData
      			Price="18800"
      			UnlockByExploration="false"
      			UnlockByRank="16"
      		>
      			<WinchParams
      			/>
      			<UiDesc
      				UiDesc="UI_WINCH_UPGRADE_MED_TRUCKS_EXT_POW_DESC"
      				UiIcon30x30=""
      				UiIcon40x40=""
      				UiName="UI_WINCH_UPGRADE_MED_TRUCKS_EXT_POW_NAME"
      			/>
      		</GameData>
      	</Winch>
      </WinchVariants>
      
      

      I want to be able to take notes and document what I’m writing/changing/editing I can do this by using this <!-- /--> well it kind of lets me do it.

      Here is an example below of it in the document/file I’m editing

      <WinchVariants>
      	<Winch
      		Name="w_medium_trucks_default"
      		Length="28.0" <!-- *2 /-->
      		StrengthMult="0.5" <!-- /0.5/-->
      		IsEngineIgnitionRequired="true"
      	>
      		<GameData
      			Price="1000" <!-- *2 /-->
      			UnlockByExploration="false" <!-- Make them all false/-->
      			UnlockByRank="1" <!-- Etc Etc Etc/-->
      		>
      			<WinchParams ...........
      

      In the document/file when you have inserted <!-- /--> somewhere (see example above) everything below that piece of code turns black until you get to />.
      After that everything is fine until I insert another<!-- /--> and the steps just explained repeat themselves till the end of the document/file.

      Any help on how to get this to work line by line would be great.

      Info on the file:
      XML (eXtensible Markup Language file), Windows (CR LF), UTF-8, INS
      Not sure if this above is helpful or changes anything but that I’d put it in there anyway😁

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn
        last edited by

        @john-russell said in Help wanted with XML editing:

        I want to be able to take notes and document what I’m writing/changing/editing

        It is called “commenting”.

        In XML, this is how it goes: <!--Your comment-->

        Not sure where you picked up the idea that a / is also necessary. But, as / is just a character, it should not cause a problem in that location.

        1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @John Russell
          last edited by

          @John-Russell ,

          Notepad++ is doing its best in syntax highlighting the invalid XML you are feeding it.

          I confirmed with the Hive Mind that XML comments (<!-- ... -->) are not allowed inside the open tag (<GameData ... >)
          b3b619ac-c834-464f-b02d-920bd0e11487-image.png
          – specifically, that first match is quoting from this SO answer, which links to another one

          For example:
          c6d40b77-02ff-4325-98ca-97ff6b273d82-image.png

          6c647d96-da16-4a1a-8149-c5577c5c7191-image.png

          So the strange highlighting successfully told you that you were doing something wrong. It’s probably time for you to go study XML some more, to better understand the rules for the language. (And this Forum is not the right place for generic XML learning/questions)

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors