From 43a780504a543ccdc1cbdafb2872b26076b8a1c3 Mon Sep 17 00:00:00 2001 From: wraitii Date: Wed, 14 Apr 2021 07:39:36 +0000 Subject: [PATCH] Delete "Compact RelaxNG" / .rnc files (Follows 76acc4e146 where I deleted actor.rnc) This deletes the .rnc validation files, upgrading the .rng files to being the source of truth. - The engine uses, via LibXML2, .rng files to validate XML schemas, to the .rnc files are redundant. - The RelaxNG "Compact" format is a DSL for the RelaxNG XML format. Its syntax is unique, unlike .rng files which are XML. - Some errors are likely - I'm not sure anyone has converted the compact files in years. - The tool to generate .rng from .rnc files is trang (https://github.com/relaxng/jing-trang), which runs on the JVM and is quite annoying to install compared to "your usual text editor". - The JS components use the full .rng format in XML, so editing this format is already familiar to most people that mod the game. The .rnc files were added in 2c9939ac74 along the .rng files. Refs #413, #245 Differential Revision: https://code.wildfiregames.com/D3824 This was SVN commit r25258. --- .../data/mods/mod/art/textures/texture.rnc | 19 -- .../data/mods/mod/art/textures/texture.rng | 6 - binaries/data/mods/mod/audio/sound_group.rnc | 36 --- binaries/data/mods/mod/audio/sound_group.rng | 9 - binaries/data/mods/mod/gui/gui.rnc | 288 ------------------ binaries/data/mods/mod/gui/gui.rng | 6 - binaries/data/mods/mod/gui/gui_page.rnc | 11 - binaries/data/mods/mod/gui/gui_page.rng | 6 - .../mods/public/art/materials/material.rnc | 46 --- .../mods/public/art/materials/material.rng | 6 - .../mods/public/art/particles/particle.rnc | 44 --- .../mods/public/art/particles/particle.rng | 6 - .../data/mods/public/art/terrains/terrain.rnc | 21 -- .../data/mods/public/art/terrains/terrain.rng | 6 - .../public/art/terrains/terrain_texture.rnc | 33 -- .../public/art/terrains/terrain_texture.rng | 6 - .../data/mods/public/art/textures/texture.rnc | 19 -- .../data/mods/public/art/textures/texture.rng | 6 - .../data/mods/public/art/variants/variant.rnc | 57 ---- .../data/mods/public/art/variants/variant.rng | 6 - binaries/data/mods/public/maps/scenario.rnc | 140 --------- binaries/data/mods/public/maps/scenario.rng | 6 - .../public/simulation/data/pathfinder.rnc | 20 -- .../public/simulation/data/pathfinder.rng | 6 - .../simulation/data/territorymanager.rnc | 17 -- .../simulation/data/territorymanager.rng | 6 - source/tools/xmlvalidator/generate_rngs.sh | 8 - 27 files changed, 840 deletions(-) delete mode 100644 binaries/data/mods/mod/art/textures/texture.rnc delete mode 100644 binaries/data/mods/mod/audio/sound_group.rnc delete mode 100644 binaries/data/mods/mod/gui/gui.rnc delete mode 100644 binaries/data/mods/mod/gui/gui_page.rnc delete mode 100644 binaries/data/mods/public/art/materials/material.rnc delete mode 100644 binaries/data/mods/public/art/particles/particle.rnc delete mode 100644 binaries/data/mods/public/art/terrains/terrain.rnc delete mode 100644 binaries/data/mods/public/art/terrains/terrain_texture.rnc delete mode 100644 binaries/data/mods/public/art/textures/texture.rnc delete mode 100644 binaries/data/mods/public/art/variants/variant.rnc delete mode 100644 binaries/data/mods/public/maps/scenario.rnc delete mode 100644 binaries/data/mods/public/simulation/data/pathfinder.rnc delete mode 100644 binaries/data/mods/public/simulation/data/territorymanager.rnc delete mode 100755 source/tools/xmlvalidator/generate_rngs.sh diff --git a/binaries/data/mods/mod/art/textures/texture.rnc b/binaries/data/mods/mod/art/textures/texture.rnc deleted file mode 100644 index bdd53631fe..0000000000 --- a/binaries/data/mods/mod/art/textures/texture.rnc +++ /dev/null @@ -1,19 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element Textures { - element File { - attribute pattern { text }? & - attribute format { "dxt1" | "dxt3" | "dxt5" | "rgba" | "alpha" }? & - attribute mipmap { "true" | "false" }? & - attribute normal { "true" | "false" }? & - attribute alpha { "none" | "player" | "transparency" }? & - attribute filter { "box" | "triangle" | "kaiser" }? & - attribute kaiserwidth { xsd:float }? & - attribute kaiseralpha { xsd:float }? & - attribute kaiserstretch { xsd:float }? - }* -} diff --git a/binaries/data/mods/mod/art/textures/texture.rng b/binaries/data/mods/mod/art/textures/texture.rng index e0e5da9892..a3cd2fe06d 100644 --- a/binaries/data/mods/mod/art/textures/texture.rng +++ b/binaries/data/mods/mod/art/textures/texture.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/mod/audio/sound_group.rnc b/binaries/data/mods/mod/audio/sound_group.rnc deleted file mode 100644 index ce84c0d127..0000000000 --- a/binaries/data/mods/mod/audio/sound_group.rnc +++ /dev/null @@ -1,36 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -## -# Types # -## -flag = "0" | "1" - -start = SoundGroup - -SoundGroup = element SoundGroup { - element Gain { xsd:float }? & - element Looping { flag }? & - element Omnipresent { flag }? & - element HeardBy { "owner" }? & - element Distanceless { flag }? & - element Pitch { xsd:float }? & - element Priority { xsd:float }? & - element RandOrder { flag }? & - element RandGain { flag }? & - element GainUpper { xsd:float }? & - element GainLower { xsd:float }? & - element RandPitch { flag }? & - element PitchUpper { xsd:float }? & - element PitchLower { xsd:float }? & - element ConeGain { xsd:float }? & - element ConeInner { xsd:float }? & - element ConeOuter { xsd:float }? & - element Threshold { xsd:float }? & - element Decay { xsd:float }? & - element Sound { text }+ & - element Path { text } -} diff --git a/binaries/data/mods/mod/audio/sound_group.rng b/binaries/data/mods/mod/audio/sound_group.rng index 059c3ecf57..d6873877fd 100644 --- a/binaries/data/mods/mod/audio/sound_group.rng +++ b/binaries/data/mods/mod/audio/sound_group.rng @@ -1,15 +1,6 @@ - - - - - - 0 1 diff --git a/binaries/data/mods/mod/gui/gui.rnc b/binaries/data/mods/mod/gui/gui.rnc deleted file mode 100644 index 992c164de6..0000000000 --- a/binaries/data/mods/mod/gui/gui.rnc +++ /dev/null @@ -1,288 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -start = object | objects | setup | sprites | styles - -## -# Types # -## -# xsd:boolean could be used instead of this definition, -# though it considers "1" & "0" as valid values. -bool = "true" | "false" -align = "left" | "center" | "right" -valign = "top" | "center" | "bottom" -wrapmode = "repeat" | "mirrored_repeat" | "clamp_to_edge" -coord = xsd:string { pattern = "-?\d*\.?\d+%?([\+\-]\d*\.?\d+%?)*" } -clientarea = list { coord, coord, coord, coord } -# color can be a name or "R G B A" format string -rgba = list { xsd:integer { minInclusive = "0" maxInclusive = "255" }, - xsd:integer { minInclusive = "0" maxInclusive = "255" }, - xsd:integer { minInclusive = "0" maxInclusive = "255" }, - xsd:integer { minInclusive = "0" maxInclusive = "255" }?} -ccolor = rgba | xsd:string { pattern = "[A-Za-z]+" } -size = list { xsd:decimal, xsd:decimal } -pos = list { xsd:decimal, xsd:decimal } -rect = list { xsd:decimal, xsd:decimal, xsd:decimal, xsd:decimal } - -## -# Defines # -## -unique_settings = - attribute name { text }?, - [ a:defaultValue = "empty" ] attribute type { text }?, - attribute style { text }? -# This could probably be made more specific/strict -# with more information regarding the use/meaning -# of these attributes. -base_settings = - attribute absolute { bool }?& - attribute enable { bool }?& - attribute ghost { bool }?& - attribute hidden { bool }?& - attribute size { clientarea }?& - attribute z { xsd:decimal }? -# Defaults are not put in here, because it ruins the concept of styles. -ex_settings = - attribute anchor { valign }?& - attribute auto_scroll { bool }?& - attribute buffer_zone { xsd:decimal }?& - attribute buffer_width { xsd:decimal }?& - attribute button_width { xsd:decimal }?& - attribute checked { bool }?& - attribute clip { bool }?& - attribute dropdown_size { xsd:decimal }?& - attribute dropdown_buffer { xsd:decimal }?& - attribute minimum_visible_items { xsd:nonNegativeInteger }?& - attribute enabled { bool }?& - attribute font { text }?& - attribute format_x { text }?& - attribute format_y { text }?& - attribute fov_wedge_color { ccolor }?& - attribute hotkey { text }?& - attribute independent { bool }?& - attribute input_initvalue_destroyed_at_focus { bool }?& - attribute mask { bool }?& - attribute mask_char { xsd:string { minLength = "1" maxLength = "1" } }?& - attribute max_length { xsd:nonNegativeInteger }?& - attribute maxwidth { xsd:decimal }? & - attribute multiline { bool }?& - attribute offset { pos }?& - attribute placeholder_text { text }?& - attribute placeholder_color { ccolor }?& - attribute readonly { bool }?& - attribute scrollbar { bool }?& - attribute scrollbar_style { text }?& - attribute scroll_bottom { bool }?& - attribute scroll_top { bool }?& - attribute selected_column { text }?& - attribute selected_column_order { text }?& - attribute sortable { bool }?& - attribute sound_closed { text }?& - attribute sound_disabled { text }?& - attribute sound_enter { text }?& - attribute sound_leave { text }?& - attribute sound_opened { text }?& - attribute sound_pressed { text }?& - attribute sound_selected { text }?& - attribute sprite { text }?& - attribute sprite2 { text }?& - attribute sprite_asc { text }?& - attribute sprite_heading { text }?& - attribute sprite_bar { text }?& - attribute sprite_background { text }?& - attribute sprite_desc { text }?& - attribute sprite_disabled { text }?& - attribute sprite_list { text }?& - attribute sprite2_disabled { text }?& - attribute sprite_not_sorted { text }?& - attribute sprite_over { text }?& - attribute sprite2_over { text }?& - attribute sprite_pressed { text }?& - attribute sprite2_pressed { text }?& - attribute sprite_selectarea { text }?& - attribute square_side { xsd:decimal }?& - attribute textcolor { ccolor }?& - attribute textcolor_disabled { ccolor }?& - attribute textcolor_over { ccolor }?& - attribute textcolor_pressed { ccolor }?& - attribute textcolor_selected { ccolor }?& - attribute text_align { align }?& - attribute text_valign { valign }?& - attribute tooltip { text }?& - attribute tooltip_style { text }? - -## -# Objects # -## -objects = element objects { (script | object)* } -script = - element script { - text & - attribute file { text }? & - attribute directory { text }? - } -object = - element object { - ((object - | action - | \attribute - | column - | \include - | item - | repeat - | script - | translatableAttribute)* - | text), - unique_settings, - base_settings, - ex_settings - } -action = - element action { - text, - attribute on { text }, - attribute file { text }? - } -\attribute = - element attribute { - (keep | translate)*, - attribute id { text } - } -column = - element column { - translatableAttribute?, - ( - attribute id { text }& - attribute color { ccolor }?& - attribute heading { text }?& - attribute width { text }?& - attribute hidden { bool }? - ) - } -\include = - element include { - attribute file { text }| - attribute directory { text } -} -item = - element item { - text, - attribute enabled { bool }? - } -keep = element keep { text } -repeat = - element repeat { - object+, - attribute count { xsd:nonNegativeInteger }, - attribute var { text }? - } -translate = element translate { text } -translatableAttribute = - element translatableAttribute { - text, - ( - attribute id { text }& - attribute comment { text }?& - attribute context { text }? - ) - } - -## -# Styles # -## -styles = element styles { style* } -style = - element style { - attribute name { text }, - base_settings, - ex_settings - } - -## -# Setup # -## -setup = element setup { (icon | scrollbar | tooltip | color)* } -scrollbar = - element scrollbar { - attribute name { text }& - attribute width { xsd:decimal }& - attribute alwaysshown { bool }?& - attribute maximum_bar_size { xsd:decimal }?& - attribute minimum_bar_size { xsd:decimal }?& - attribute scroll_wheel { bool }?& - attribute show_edge_buttons { bool }?& - attribute sprite_button_top { text }?& - attribute sprite_button_top_pressed { text }?& - attribute sprite_button_top_disabled { text }?& - attribute sprite_button_top_over { text }?& - attribute sprite_button_bottom { text }?& - attribute sprite_button_bottom_pressed { text }?& - attribute sprite_button_bottom_disabled { text }?& - attribute sprite_button_bottom_over { text }?& - attribute sprite_bar_vertical { text }?& - attribute sprite_bar_vertical_over { text }?& - attribute sprite_bar_vertical_pressed { text }?& - attribute sprite_back_vertical { text }? - } -icon = - element icon { - attribute name { text }& - attribute size { size }& - attribute sprite { text }& - } -tooltip = - element tooltip { - attribute name { text }& - attribute sprite { text }?& - attribute anchor { valign }?& - attribute axis_color { ccolor }?& - attribute axis_width { xsd:decimal { minInclusive = "0" } }?& - attribute buffer_zone { xsd:decimal }?& - attribute font { text }?& - attribute maxwidth { xsd:decimal }?& - attribute offset { pos }?& - attribute textcolor { ccolor }?& - attribute delay { xsd:integer }?& - attribute use_object { text }?& - attribute hide_object { bool }? - } -color = - element color { - rgba, - attribute name { text } - } - -## -# Sprites # -## -sprites = element sprites { sprite* } -sprite = - element sprite { - (effect?, image+), - attribute name { text } - } -image = - element image { - effect?, - ( - attribute texture { text }?& - attribute size { clientarea }?& - attribute texture_size { clientarea }?& - attribute real_texture_placement { rect }?& - attribute backcolor { ccolor }?& - attribute bordercolor { ccolor }?& - attribute border { bool }?& - attribute z_level { xsd:float }?& - attribute fixed_h_aspect_ratio { xsd:decimal }?& - attribute round_coordinates { bool }?& - attribute wrap_mode { wrapmode }? - ) - } -effect = - element effect { - attribute add_color { ccolor }?, - attribute grayscale { empty }? - } diff --git a/binaries/data/mods/mod/gui/gui.rng b/binaries/data/mods/mod/gui/gui.rng index ae7a8bd24e..0c38ed1001 100644 --- a/binaries/data/mods/mod/gui/gui.rng +++ b/binaries/data/mods/mod/gui/gui.rng @@ -1,12 +1,6 @@ - - - diff --git a/binaries/data/mods/mod/gui/gui_page.rnc b/binaries/data/mods/mod/gui/gui_page.rnc deleted file mode 100644 index 35f758d4dd..0000000000 --- a/binaries/data/mods/mod/gui/gui_page.rnc +++ /dev/null @@ -1,11 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element page { - element include { - text - }* -} diff --git a/binaries/data/mods/mod/gui/gui_page.rng b/binaries/data/mods/mod/gui/gui_page.rng index c50e60f9e4..72d08f5420 100644 --- a/binaries/data/mods/mod/gui/gui_page.rng +++ b/binaries/data/mods/mod/gui/gui_page.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/materials/material.rnc b/binaries/data/mods/public/art/materials/material.rnc deleted file mode 100644 index f9bbf9295d..0000000000 --- a/binaries/data/mods/public/art/materials/material.rnc +++ /dev/null @@ -1,46 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" - - -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## -element material { - element alternative { - attribute material { text } - & attribute quality { - xsd:decimal { minInclusive = "0" } - }? - & attribute if { text }? - }* - & element alpha_blending { - # flag; true if present - empty - }? - & element shader { - attribute effect { text } - } - & element define { - attribute name { text }, - attribute value { text } - }* - & element uniform { - attribute name { text }, - attribute value { - list { - # X Y Z W - xsd:float, - xsd:float?, - xsd:float?, - xsd:float? - } - } - }* - & element renderquery { - attribute name { text } - }* - & element required_texture { - attribute name { text }, - attribute define { text }? - }* -} diff --git a/binaries/data/mods/public/art/materials/material.rng b/binaries/data/mods/public/art/materials/material.rng index 62b7479220..3eaaabf0af 100644 --- a/binaries/data/mods/public/art/materials/material.rng +++ b/binaries/data/mods/public/art/materials/material.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/particles/particle.rnc b/binaries/data/mods/public/art/particles/particle.rnc deleted file mode 100644 index 106933c9df..0000000000 --- a/binaries/data/mods/public/art/particles/particle.rnc +++ /dev/null @@ -1,44 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element particles { - element texture { - text - }? & - element blend { - attribute mode { "add" | "subtract" | "over" | "multiply" } - }? & - element start_full { # flag; true if present - empty - }? & - element use_relative_velocity { # flag; true if present - empty - }? & - element constant { - attribute name { text } & - attribute value { xsd:float } - }* & - element uniform { - attribute name { text } & - attribute min { xsd:float } & - attribute max { xsd:float } - }* & - element copy { - attribute name { text } & - attribute from { text } - }* & - element expr { - attribute name { text } & - attribute from { text } & - attribute mul { xsd:float } & - attribute max { xsd:float } - }* & - element force { - attribute x { xsd:float }? & - attribute y { xsd:float }? & - attribute z { xsd:float }? - }* -} diff --git a/binaries/data/mods/public/art/particles/particle.rng b/binaries/data/mods/public/art/particles/particle.rng index 84a825b353..1320604a8d 100644 --- a/binaries/data/mods/public/art/particles/particle.rng +++ b/binaries/data/mods/public/art/particles/particle.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/terrains/terrain.rnc b/binaries/data/mods/public/art/terrains/terrain.rnc deleted file mode 100644 index 2b0e356c55..0000000000 --- a/binaries/data/mods/public/art/terrains/terrain.rnc +++ /dev/null @@ -1,21 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element Terrains { - element Terrain { - attribute groups { text } & # comma-separated list of groups - attribute mmap { - list { - xsd:integer { minInclusive = "0" maxInclusive = "255" }, # R - xsd:integer { minInclusive = "0" maxInclusive = "255" }, # G - xsd:integer { minInclusive = "0" maxInclusive = "255" } # B - } - }? & - attribute angle { xsd:float }? & # degrees - attribute size { xsd:float }? & - attribute movementclass { text }? - } -} diff --git a/binaries/data/mods/public/art/terrains/terrain.rng b/binaries/data/mods/public/art/terrains/terrain.rng index 0032b302d0..e4898e2736 100644 --- a/binaries/data/mods/public/art/terrains/terrain.rng +++ b/binaries/data/mods/public/art/terrains/terrain.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/terrains/terrain_texture.rnc b/binaries/data/mods/public/art/terrains/terrain_texture.rnc deleted file mode 100644 index a7ebbc7cbd..0000000000 --- a/binaries/data/mods/public/art/terrains/terrain_texture.rnc +++ /dev/null @@ -1,33 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element terrain { - element textures { - element texture { - attribute name { text } & - attribute file { text } - }* - } & - element material { - text - }? & - element alphamap { - text - }? & - element props { - attribute groups { text }? & # comma-separated list of groups - attribute mmap { - list { - xsd:integer { minInclusive = "0" }, # R - xsd:integer { minInclusive = "0" }, # G - xsd:integer { minInclusive = "0" } # B - } - }? & - attribute angle { xsd:float }? & # degrees - attribute size { xsd:float }? & - attribute movementclass { text }? - }* -} diff --git a/binaries/data/mods/public/art/terrains/terrain_texture.rng b/binaries/data/mods/public/art/terrains/terrain_texture.rng index 7184d91ed6..29bbb222d3 100644 --- a/binaries/data/mods/public/art/terrains/terrain_texture.rng +++ b/binaries/data/mods/public/art/terrains/terrain_texture.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/textures/texture.rnc b/binaries/data/mods/public/art/textures/texture.rnc deleted file mode 100644 index bdd53631fe..0000000000 --- a/binaries/data/mods/public/art/textures/texture.rnc +++ /dev/null @@ -1,19 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element Textures { - element File { - attribute pattern { text }? & - attribute format { "dxt1" | "dxt3" | "dxt5" | "rgba" | "alpha" }? & - attribute mipmap { "true" | "false" }? & - attribute normal { "true" | "false" }? & - attribute alpha { "none" | "player" | "transparency" }? & - attribute filter { "box" | "triangle" | "kaiser" }? & - attribute kaiserwidth { xsd:float }? & - attribute kaiseralpha { xsd:float }? & - attribute kaiserstretch { xsd:float }? - }* -} diff --git a/binaries/data/mods/public/art/textures/texture.rng b/binaries/data/mods/public/art/textures/texture.rng index e0e5da9892..a3cd2fe06d 100644 --- a/binaries/data/mods/public/art/textures/texture.rng +++ b/binaries/data/mods/public/art/textures/texture.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/art/variants/variant.rnc b/binaries/data/mods/public/art/variants/variant.rnc deleted file mode 100644 index ce946f012b..0000000000 --- a/binaries/data/mods/public/art/variants/variant.rnc +++ /dev/null @@ -1,57 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element variant { - attribute name { text }? & - attribute frequency { xsd:nonNegativeInteger }? & - attribute file { text }? & - element mesh { - text - }? & - element textures { - element texture { - attribute file { text }? & - attribute name { text } - }* - }? & - element decal { - attribute width { xsd:float } & # X - attribute depth { xsd:float } & # Z - attribute angle { xsd:float } & - attribute offsetx { xsd:float } & - attribute offsetz { xsd:float } - }? & - element particles { - attribute file { text } - }? & - element color { list { - xsd:nonNegativeInteger, # R - xsd:nonNegativeInteger, # G - xsd:nonNegativeInteger # B - } }? & - element animations { - element animation { - attribute name { text } & - attribute id { text }? & - attribute frequency { xsd:nonNegativeInteger }? & - attribute file { text }? & - attribute speed { xsd:nonNegativeInteger } & - attribute event { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }? & - attribute load { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }? & - attribute sound { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }? - }* - }? & - element props { - element prop { - (attribute actor { text }? & - attribute attachpoint { text } & - attribute minheight { xsd:float }? & - attribute maxheight { xsd:float }? & - attribute selectable { "true" | "false" }?) - }* - }? -} - diff --git a/binaries/data/mods/public/art/variants/variant.rng b/binaries/data/mods/public/art/variants/variant.rng index 391da0ae25..a4cfe77094 100644 --- a/binaries/data/mods/public/art/variants/variant.rng +++ b/binaries/data/mods/public/art/variants/variant.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/maps/scenario.rnc b/binaries/data/mods/public/maps/scenario.rnc deleted file mode 100644 index af2f84ba86..0000000000 --- a/binaries/data/mods/public/maps/scenario.rnc +++ /dev/null @@ -1,140 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -start = Scenario - -## -# Defines # -## -color_rgb = - attribute r { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }, - attribute g { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }, - attribute b { xsd:decimal { minInclusive = "0" maxInclusive = "1" } } - -suncolor_rgb = # RGB can be > 1 due to overbrightness - attribute r { xsd:decimal { minInclusive = "0" } }, - attribute g { xsd:decimal { minInclusive = "0" } }, - attribute b { xsd:decimal { minInclusive = "0" } } - -pos_xyz = - attribute x { xsd:float }, - attribute y { xsd:float }, - attribute z { xsd:float } - -pos_xz = - attribute x { xsd:decimal }, - attribute z { xsd:decimal } - -angle = attribute angle { xsd:float } - -## -# Scenario # -## -# TODO: bounds are not documented for many of these -Scenario = element Scenario { - attribute version { xsd:positiveInteger } & - element Environment { - element SkySet { text } & - element SunColor { suncolor_rgb } & - element SunElevation { angle } & - element SunRotation { angle } & - element AmbientColor { color_rgb } & - element Fog { - element FogFactor { - xsd:decimal { minInclusive = "0" } # TODO: what is the max? - } & - element FogThickness { - xsd:decimal { minInclusive = "0" } # TODO: what is the max? - } & - element FogColor { color_rgb } - }? & - element Water { - element WaterBody { - element Type { text } & # Not implemented - element Color { color_rgb } & - element Height { xsd:decimal } & - element Waviness { xsd:decimal } & - element Murkiness { xsd:decimal } & - element Tint { color_rgb } & - element WindAngle { xsd:decimal }? - } - } & - element Postproc { - element Brightness { xsd:decimal }, - element Contrast { xsd:decimal }, - element Saturation { xsd:decimal }, - element Bloom { xsd:decimal }, - element PostEffect { text } - }? - } & - element Terrain { - attribute patches { xsd:positiveInteger }?, - attribute texture { text }?, - attribute priority { xsd:nonNegativeInteger }?, - attribute height { xsd:positiveInteger }? - }? & - element Script { - text - }? & - element Camera { # Camera can have weird float values - element Position { pos_xyz }, - element Rotation { angle }, - element Declination { angle } - }? & - element ScriptSettings { - text - } & - element Entities { - element Entity { - attribute uid { xsd:positiveInteger } & - element Template { text } & - element Player { xsd:nonNegativeInteger }? & - element Position { - pos_xz - } & - element Orientation { - attribute y { xsd:decimal } - } & - element Obstruction { - attribute group { xsd:positiveInteger }, - attribute group2 { xsd:positiveInteger }? - }? & - element Garrison { - element GarrisonedEntity { - attribute uid { xsd:positiveInteger } & - } & - } & - element Turrets { - element Turret { - attribute turret { text } & - attribute uid { xsd:positiveInteger } & - } & - } & - element Actor { - attribute seed { xsd:integer } - }? - }* - }? & - element Paths { - element Path { - attribute name { text } & - attribute timescale { xsd:decimal } & - attribute orientation { text } & - attribute mode { text } & - attribute style { text } & - element Node { - attribute deltatime { - xsd:decimal { minInclusive = "0" } - } & - element Position { pos_xyz }? & - element Target { pos_xyz }? - }* - }* - }? & - element Triggers { # Unused - empty - }? -} diff --git a/binaries/data/mods/public/maps/scenario.rng b/binaries/data/mods/public/maps/scenario.rng index 2aecf51c95..5136e744ff 100644 --- a/binaries/data/mods/public/maps/scenario.rng +++ b/binaries/data/mods/public/maps/scenario.rng @@ -1,12 +1,6 @@ - - - diff --git a/binaries/data/mods/public/simulation/data/pathfinder.rnc b/binaries/data/mods/public/simulation/data/pathfinder.rnc deleted file mode 100644 index dabb1d36b3..0000000000 --- a/binaries/data/mods/public/simulation/data/pathfinder.rnc +++ /dev/null @@ -1,20 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element Pathfinder { - element MaxSameTurnMoves { xsd:nonNegativeInteger } & - element PassabilityClasses { - element * { - element Obstructions { xsd:string } & - element MinWaterDepth { xsd:decimal }? & # TODO: fixed type - element MaxWaterDepth { xsd:decimal }? & - element MaxTerrainSlope { xsd:decimal }? & - element MinShoreDistance { xsd:decimal }? & - element MaxShoreDistance { xsd:decimal }? & - element Clearance { xsd:decimal }? - }+ - } -} diff --git a/binaries/data/mods/public/simulation/data/pathfinder.rng b/binaries/data/mods/public/simulation/data/pathfinder.rng index 81b57f1555..c1e45d2f0f 100644 --- a/binaries/data/mods/public/simulation/data/pathfinder.rng +++ b/binaries/data/mods/public/simulation/data/pathfinder.rng @@ -1,11 +1,5 @@ - - - diff --git a/binaries/data/mods/public/simulation/data/territorymanager.rnc b/binaries/data/mods/public/simulation/data/territorymanager.rnc deleted file mode 100644 index 0717edde38..0000000000 --- a/binaries/data/mods/public/simulation/data/territorymanager.rnc +++ /dev/null @@ -1,17 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -## -# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file -# and use a converter tool like trang to generate the Relax NG XML (.rng) file -## - -element TerritoryManager { - element ImpassableCost { - xsd:integer { minInclusive = "0" maxInclusive = "255" } - } & - element BorderThickness { - xsd:decimal - } & - element BorderSeparation { - xsd:decimal - } -} diff --git a/binaries/data/mods/public/simulation/data/territorymanager.rng b/binaries/data/mods/public/simulation/data/territorymanager.rng index 6dcfd82beb..87e0fdac41 100644 --- a/binaries/data/mods/public/simulation/data/territorymanager.rng +++ b/binaries/data/mods/public/simulation/data/territorymanager.rng @@ -1,11 +1,5 @@ - - - diff --git a/source/tools/xmlvalidator/generate_rngs.sh b/source/tools/xmlvalidator/generate_rngs.sh deleted file mode 100755 index 621b208b76..0000000000 --- a/source/tools/xmlvalidator/generate_rngs.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -VFSROOT=${1:-"../../../binaries/data/mods"} - -for schema in $(find "$VFSROOT" -name '*.rnc') -do - trang "$schema" "${schema/.rnc/.rng}" -done