Help wanted with XML editing
-
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😁 -
@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. -
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 ... >
)
– specifically, that first match is quoting from this SO answer, which links to another oneFor example:
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)