1

We are working on a gaming framework where we can do two things:

  • Define interactions and game logic with an XML file, that is validated by an XSD schema we have created
  • Include JavaScript code within this XML file for running arbitrary scripting logic

What we are looking for is an IDE that can give us code completion against our XSD and the JavaScript that can be typed inline in an XML attribute or element just like is possible inside an HTML document. Loading/referencing external JavaScript files would be a great feature, too.

The Visual Studio 2015 HTML Editor does exactly what we want. We just need it to validate against our custom XSD instead of the built-in HTML5 one that it uses by default.

One thing I've found of particular interest is a set of files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Packages\schemas\html. There appear to be built-in XSD files VS 2015 uses for the HTML editor. I can't find documentation on how to modify these, however.

Any links or documentation on how to do this? We are also completely open to use another editor besides Visual Studio.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182

1 Answers1

1

If Visual Studio recognizes your files as HTML you can use the doctype to refer to a different DTD that can contain your schemas. However, this requires developing your XSD's as DTD as well, which may not be practical. If you take this course, make sure that the following setting is selected:

enter image description here

An alternative is to consider that it is enough that you get context-sensitive help based on the schema and that syntax help for JavaScript is not a requirement. In that case, simply follow this guide to instruct Visual Studio where to find and to use a certain XML Schema.

You may try to combine these two approaches. For instance by leaving the document type as HTML, but at the same time associating and referencing a schema in the guide I linked. Perhaps Visual Studio will then give you IntelliSense inside the script elements as well.

Superior to Visual Studio are XML editors that make this their core business. I personally favor oXygen, but Stylus Studio and Liquid XML also have XML, XSD, XSLT, XPath, WSDL etc support that's superior to Visual Studio's. I do not know if any of these support script intellisense, but they all support XML development intellisense based on the XSD out of the box.

Community
  • 1
  • 1
Abel
  • 56,041
  • 24
  • 146
  • 247
  • We are slightly changing our plan now, but I think your solution is the way we would need to go. We are now looking into using another option instead, thanks for the great answer. – jonathanpeppers Sep 14 '15 at 14:03