1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

'nxml-mode': add schema for .NET SLNX files.

SLNX is a new XML-based file-format for .NET based solutions, replacing
the older proprietary SLN file-format.

Unlike SLN-files, it is merge-friendly and expected to become the new
de-facto standard for working with .NET projects.  This commit adds
support for SLNX-schema to 'nxml-mode'.

The schme provided has been synthesized using the official XSD-schema
definition:
https://github.com/microsoft/vs-solutionpersistence/blob/main/src/Microsoft.VisualStudio.SolutionPersistence/Serializer/Xml/Slnx.xsd

This schema was then converted to RNG using XSDtoRNG.xsl:
https://github.com/epiasini/XSDtoRNG

The RNG schema was then converted to RNC using the trang CLI-tool:
https://relaxng.org/jclark/trang.html

* etc/schema/dotnet-slnx.rnc: New file.
* etc/schema/schemas.xml: Add Slnx schema.

* lisp/files.el (auto-mode-alist): Add association for SLNX files.
(Bug#79379)
This commit is contained in:
Jostein Kjønigsen 2025-09-03 11:59:04 +02:00 committed by Eli Zaretskii
parent ab5e0f5359
commit 6b42b974ce
3 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,74 @@
default namespace = ""
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace ns_1 = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace rng = "http://relaxng.org/ns/structure/1.0"
start |= starting_Solution
starting_Solution =
element Solution {
(element Configurations { Configurations }?
| element Project { Project }*
| element Folder { Folder }*
| PropertiesGroup*)*,
attribute Description { xsd:string }?,
attribute Version { xsd:string }?
}
Configurations =
(element BuildType {
attribute Name { xsd:string }
}*
| element Platform {
attribute Name { xsd:string }
}*
| element ProjectType { ProjectType }*)*
ProjectType =
(ConfigurationRulesGroup*)*,
attribute TypeId { xsd:string }?,
attribute Name { xsd:string }?,
attribute Extension { xsd:string }?,
attribute BasedOn { xsd:string }?,
[ ns_1:defaultValue = "true" ] attribute IsBuildable { xsd:boolean }?,
[ ns_1:defaultValue = "true" ]
attribute SupportsPlatform { xsd:boolean }?
Folder =
(element File {
attribute Path { xsd:string }
}*
| element Project { Project }*
| PropertiesGroup*)*,
attribute Name { xsd:string }
Project =
(element BuildDependency {
attribute Project { text }
}*
| ConfigurationRulesGroup*
| PropertiesGroup*)*,
attribute Path { xsd:string },
attribute Type { xsd:string }?,
attribute DisplayName { xsd:string }?
PropertiesGroup =
element Properties {
element Property {
attribute Name { xsd:string },
attribute Value { xsd:string }?
}*,
attribute Name { text },
attribute Scope { text }?
}
ConfigurationRulesGroup =
element BuildType {
attribute Solution { xsd:string }?,
attribute Project { xsd:string }?
}+
| element Platform {
attribute Solution { xsd:string }?,
attribute Project { xsd:string }
}+
| element Build {
attribute Solution { xsd:string }?,
attribute Project { xsd:string }?
}+
| element Deploy {
attribute Solution { xsd:string }?,
attribute Project { xsd:string }?
}+

View file

@ -93,4 +93,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
<documentElement localName="Project" typeId="MSBuild"/> <documentElement localName="Project" typeId="MSBuild"/>
<typeId id="MSBuild" uri="msbuild.rnc" /> <typeId id="MSBuild" uri="msbuild.rnc" />
<uri pattern="*.slnx" typeId="Dotnet Slnx" />
<typeId id="Dotnet Slnx" uri="dotnet-slnx.rnc" />
</locatingRules> </locatingRules>

View file

@ -3158,6 +3158,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\|SQUASHFS\\)\\'" .
("\\.oak\\'" . scheme-mode) ("\\.oak\\'" . scheme-mode)
("\\.sgml?\\'" . sgml-mode) ("\\.sgml?\\'" . sgml-mode)
("\\.x[ms]l\\'" . xml-mode) ("\\.x[ms]l\\'" . xml-mode)
("\\.slnx\\'" . xml-mode)
("\\.dbk\\'" . xml-mode) ("\\.dbk\\'" . xml-mode)
("\\.dtd\\'" . sgml-mode) ("\\.dtd\\'" . sgml-mode)
("\\.ds\\(ss\\)?l\\'" . dsssl-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)