Adding Custom Highlighting to MD2.4?

I’m trying to add custom highlighting to Monodevelop 2.4, and I’m receiving the same error, even tho’ the sources I find seem valid.

I’m copying the provided text into TextEdit and saving as XML, eg: Word 2003 format (.xml) from the “Save As” menu choice.

The error is:

Most of the sources seem to be similar. Take this thread:
http://lists.ximian.com/pipermail/monodevelop-list/2009-May/009656.html

That leads to:
http://anonsvn.mono-project.com/viewvc/branches/monodevelop/main/2.0/src/addins/Mono.Texteditor/Styles/

That ends up with:

<!-- VisualStudioStyle.xml

 Author: Jeffrey Stedfast <fejj@novell.com>

 Copyright (c) 2008 Novell, Inc ([url]http://www.novell.com[/url])

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE. -->
 <EditorStyle name="Visual StudioTEST" _description="TESTMicrosoft Visual Studio color scheme.">
 
	
	<Color name="comment-green" value="#008000"/>
	<Color name="keyword-blue" value="#0000ff"/>
	<Color name="skyblue" value="#204a87"/>
	<Color name="aluminium1" value="#eeeeec"/>
	<Color name="aluminium2" value="#d3d7cf"/>
	<Color name="aluminium3" value="#babdb6"/>
	<Color name="aluminium4" value="#888a85"/>
	<Color name="aluminium5" value="#555753"/>
	<Color name="aluminium6" value="#2e3436"/>
	
	
	<Style name="text" color="black" bgColor="white"/>
	<Style name="text.selection" color="white" bgColor="#0a246a"/>
	<Style name="text.background.searchresult" color="yellow"/>
	
	<Style name="text.link" color="skyblue"/>
	
	<Style name="caret" color="black" bgColor="white"/>
	
	<Style name="marker.line" color="aluminium1"/>
	
	<Style name="marker.ruler" color="aluminium3"/>
	<Style name="marker.whitespace" color="#2b91af"/>
	<Style name="marker.invalidline" color="#cc0000"/>
	<Style name="marker.bracket" color="aluminium4" bgColor="aluminium1"/>
	
	<Style name="marker.bookmark.color1" color="black"/>
	<Style name="marker.bookmark.color2" color="#bfd2f9"/>
	
	<Style name="linenumber" color="#2b91af" bgColor="white"/>
	<Style name="linenumber.highlight" color="#2b91af"/>
	
	<Style name="iconbar" color="aluminium1"/>
	<Style name="iconbar.separator" color="aluminium3"/>
	
	<Style name="fold" color="aluminium3" bgColor="white"/>
	<Style name="fold.highlight" color="aluminium5"/>
	<Style name="fold.togglemarker" color="black"/>
	
	
	<Style name="comment" color="comment-green"/>

	<Style name="text.preprocessor" color="purple"/>
	<Style name="text.markup" color="skyblue"/>
	
	<Style name="constant" color="black"/>
	<Style name="constant.language" color="keyword-blue"/>

	<Style name="string" color="#a31515"/>
	<Style name="string.single" color="#a31515"/>
	<Style name="string.double" color="#a31515"/>
	<Style name="string.other" color="#a31515"/>
	
	<Style name="keyword" color="keyword-blue">
		<Style name="access" weight="bold"/>
	</Style>
	
</EditorStyle>

Hi,
You should save the file as plain text, and change the file extension to .xml.

Hum…

Did that!

Now I get this error:

Just out of interest, I saved it as plaintext from TextEdit and changed the extension to .xml. I did the same from Unitron and MonoDevelop…

Try restructuring like this to parse

<vs.netpalette>
     <coloring>
          <ColorName>"comment-green"</ColorName>
          <ColorValue>"#008000"<ColorValue>
     </coloring>
     <coloring>
          <ColorName>"keyword-blue"</ColorName>
          <ColorValue>"#0000ff"<ColorValue>
     </coloring>
     //etc...

</vs.netpalette>

Worked in the past when other XML structures threw parsing errors.

HTH
BTH

Tried this as a test:

<EditorStyleName="Visual StudioX" _description="Microsoft Visual Studio color scheme TEST.">
	<vs.netpalette> 
		<coloring>
			<ColorName>"comment-green"</ColorName>
			<ColorValue>"#008000"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"keyword-blue"</ColorName>
			<ColorValue>"#0000ff"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"semantic-type"</ColorName>
			<ColorValue>"#008a8c"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"skyblue"</ColorName>
			<ColorValue>"#204a87"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium1"</ColorName>
			<ColorValue>"#eeeeec"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium2"</ColorName>
			<ColorValue>"#d3d7cf"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium3"</ColorName>
			<ColorValue>"#babdb6"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium4"</ColorName>
			<ColorValue>"#888a85"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium5"</ColorName>
			<ColorValue>"#555753"</ColorValue>
		</coloring>
		<coloring>
			<ColorName>"aluminium6"</ColorName>
			<ColorValue>"#2e3436"</ColorValue>
		</coloring>
		<style>
			<StyleName>"text"</StyleName>
			<Color>"black"</Color>
			 <BgColor>"white"</BgColor>
		</Style>
	</vs.netpalette>
</EditorStyle>

Didn’t work… is this the correct direction?

Generally. I worked with XML driven GUIs in JavaScript for years and when parsing I always ran into less problems by just simplifying into opening and closing brackets, nesting tags and leaving out or changing everything into that simple format. Makes writing an all purpose parser much easier. However, your situation may need the custom format…but it throws typical errors as it is. What happens if you toss the quotation marks out of the original? They should parse as strings or hex numbers without quotes.

or…

Try it just with the vs.palette tae as opening and closing tags. The errors look like it gets hung on all the info in the larger tag being crammed between brackets with all kinds of =, . and other symbols which may throw off the parser.

HTH
BTH

So, no one’s been able to do this? I’m having the problem too. Any suggestions would be great.