Ashitacast XSD Validation

Talk about AshitaCast here. Need help with setting things up? Questions about how to do something? Post here.
Post Reply
anakappa
Posts: 4
Joined: Fri Jun 23, 2017 3:50 am

Ashitacast XSD Validation

Post by anakappa » Tue Jul 04, 2017 7:32 am

Hi all,

I wanted some contextual help when authoring ashitacast XML files, so I copied the ashitacast XML documentation down into XSD form. The XSD will allow you to validate your ashitacast XML files. In addition, most modern XML editors will be able to read XML schema documents and provide contextual suggestions as you edit. The XSD document can be found here https://pastebin.com/Zk5kHG9p

Image
matix
Addon/Plugin Developer
Posts: 49
Joined: Sun May 15, 2016 10:46 pm

Re: Ashitacast XSD Validation

Post by matix » Tue Jul 04, 2017 11:37 am

Awesome! If there was a like button, i'd be smashing it right now!
User avatar
atom0s
Site Admin
Posts: 376
Joined: Sat May 14, 2016 5:13 pm

Re: Ashitacast XSD Validation

Post by atom0s » Tue Jul 04, 2017 11:52 am

Very nice, thanks for posting this! I've uploaded a copy of it to the Ashita website here:
http://ashita.atom0s.com/downloads/AshitaCast.xsd

So it can be easily linked to. If you update this or make any type of changes etc. just post here and I'll update the copy on the server too. (I added a thanks/credits to you at the top in a simple comment as well.)
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
sumguy
Posts: 20
Joined: Tue Jul 04, 2017 10:31 pm

Re: Ashitacast XSD Validation

Post by sumguy » Tue Jul 04, 2017 11:37 pm

So I attempted to use this on Notepad++ and it spewed a load of errors when saving...
Validation of current file using XML schema:


ERROR: Element 'waist': This element is not expected.
ERROR: Element 'waist': This element is not expected.
ERROR: Element 'Ammo': This element is not expected. Expected is one of ( main, sub, range, ammo, head, neck, lear, rear, body, hands ).
ERROR: Element 'Ammo': This element is not expected. Expected is one of ( main, sub, range, ammo, head, neck, lear, rear, body, hands ).
ERROR: Element 'Ammo': This element is not expected. Expected is one of ( main, sub, range, ammo, head, neck, lear, rear, body, hands ).
ERROR: Element 'Ammo': This element is not expected. Expected is one of ( main, sub, range, ammo, head, neck, lear, rear, body, hands ).
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'buffactive': The attribute 'buffactive' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'buffactive': The attribute 'buffactive' is not allowed.
ERROR: Element 'if', attribute 'buffactive': The attribute 'buffactive' is not allowed.
ERROR: Element 'elseif', attribute 'buffactive': The attribute 'buffactive' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'ear1': This element is not expected. Expected is one of ( legs, feet ).
ERROR: Element 'if', attribute 'buffactive': The attribute 'buffactive' is not allowed.
ERROR: Element 'elseif', attribute 'buffactive': The attribute 'buffactive' is not allowed.
What's going on here?
anakappa
Posts: 4
Joined: Fri Jun 23, 2017 3:50 am

Re: Ashitacast XSD Validation

Post by anakappa » Wed Jul 05, 2017 10:40 am

"Element is not expected" errors are most likely due to the order of your elements. Right now I defaulted to using almost exclusively sequences, which is a way to describe a collection of elements with a specific allowable order. I can probably change this to an 'all' structure, but there are some implications on how I can restrict/extend common types in XSD using 'all'. I'll look into it tonight and post some changes to make it more forgiving to document order.
anakappa
Posts: 4
Joined: Fri Jun 23, 2017 3:50 am

Re: Ashitacast XSD Validation

Post by anakappa » Wed Jul 05, 2017 10:59 am

Here is an updated copy of the XSD that should help with your errors. Your issues above did have to do with using 'sequence' rather than 'all' when defining a common equipment data structure. The buffactive issue was an error on my part... forgot to add the attribute group to the condition block structure 8-)

Latest version: https://pastebin.com/741KsCKj
sumguy
Posts: 20
Joined: Tue Jul 04, 2017 10:31 pm

Re: Ashitacast XSD Validation

Post by sumguy » Wed Jul 05, 2017 12:29 pm

I'll give it a try. I had just hacked together my own sheet using other people's work as a guideline for what would work.
User avatar
atom0s
Site Admin
Posts: 376
Joined: Sat May 14, 2016 5:13 pm

Re: Ashitacast XSD Validation

Post by atom0s » Thu Jul 06, 2017 1:07 am

anakappa wrote:
Wed Jul 05, 2017 10:59 am
Here is an updated copy of the XSD that should help with your errors. Your issues above did have to do with using 'sequence' rather than 'all' when defining a common equipment data structure. The buffactive issue was an error on my part... forgot to add the attribute group to the condition block structure 8-)

Latest version: https://pastebin.com/741KsCKj
Hosted version that I linked above is updated with this new version too.
Lead Ashita Developer

Want to donate to say thanks?
https://www.paypal.me/atom0s
Tru14
Posts: 18
Joined: Sun Feb 19, 2017 10:56 am

Re: Ashitacast XSD Validation

Post by Tru14 » Mon Dec 11, 2017 12:30 pm

Late to the party but thanks for taking the time and effort to share this with us!

Receiving these errors on mine:

Code: Select all

Validation of current file using XML schema:

ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'legs', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'hands', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'legs', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'hands', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'legs', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'hands', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'head', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'body', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'hands', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'legs', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'feet', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'main', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'head', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'feet', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'head', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'back', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'feet', attribute 'augment': The attribute 'augment' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'gearlock', attribute 'delay': The attribute 'delay' is not allowed.
ERROR: Element 'gearlock': The attribute 'length' is required but missing.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'e_weatherelement': 'Light' is not a valid value of the union type 'ashitaWeatherElementType'.
ERROR: Element 'if', attribute 'e_dayelement': [facet 'enumeration'] The value 'Light' is not an element of the set {'dark', 'earth', 'fire', 'ice', 'light', 'thunder', 'unknown', 'water', 'wind'}.
ERROR: Element 'if', attribute 'e_dayelement': 'Light' is not a valid value of the atomic type 'ashitaElementType'.
ERROR: Element 'if', attribute 'mode': The attribute 'mode' is not allowed.
ERROR: Element 'elseif', attribute 'ad_skill': [facet 'enumeration'] The value 'Ninjutsu' is not an element of the set {'bluemagic', 'darkmagic', 'divinemagic', 'elementalmagic', 'enhancingmagic', 'enfeeblingmagic', 'healingmagic', 'ninjitsu', 'singing', 'summoning'}.
ERROR: Element 'elseif', attribute 'ad_skill': 'Ninjutsu' is not a valid value of the atomic type 'ashitaSkillType'.
ERROR: Element 'elseif', attribute 'ad_skill': [facet 'enumeration'] The value 'DarkMagic' is not an element of the set {'bluemagic', 'darkmagic', 'divinemagic', 'elementalmagic', 'enhancingmagic', 'enfeeblingmagic', 'healingmagic', 'ninjitsu', 'singing', 'summoning'}.
ERROR: Element 'elseif', attribute 'ad_skill': 'DarkMagic' is not a valid value of the atomic type 'ashitaSkillType'.
ERROR: Element 'elseif', attribute 'ad_skill': [facet 'enumeration'] The value 'ElementalMagic' is not an element of the set {'bluemagic', 'darkmagic', 'divinemagic', 'elementalmagic', 'enhancingmagic', 'enfeeblingmagic', 'healingmagic', 'ninjitsu', 'singing', 'summoning'}.
ERROR: Element 'elseif', attribute 'ad_skill': 'ElementalMagic' is not a valid value of the atomic type 'ashitaSkillType'.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'ad_element': 'Light' is not a valid value of the union type 'ashitaSpellElementType'.
ERROR: Element 'if', attribute 'ad_element': 'Lightning' is not a valid value of the union type 'ashitaSpellElementType'.
ERROR: Element 'elseif', attribute 'advanced': The attribute 'advanced' is not allowed.
ERROR: Element 'if', attribute 'ad_element': 'Light' is not a valid value of the union type 'ashitaSpellElementType'.
ERROR: Element 'equip', attribute 'when': The attribute 'when' is not allowed.
ERROR: Element 'if', attribute 'ad_element': 'Lightning' is not a valid value of the union type 'ashitaSpellElementType'.
ERROR: Element 'elseif', attribute 'ad_skill': [facet 'enumeration'] The value 'EnfeeblingMagic' is not an element of the set {'bluemagic', 'darkmagic', 'divinemagic', 'elementalmagic', 'enhancingmagic', 'enfeeblingmagic', 'healingmagic', 'ninjitsu', 'singing', 'summoning'}.
ERROR: Element 'elseif', attribute 'ad_skill': 'EnfeeblingMagic' is not a valid value of the atomic type 'ashitaSkillType'.
ERROR: Element 'elseif', attribute 'ad_skill': [facet 'enumeration'] The value 'EnhancingMagic' is not an element of the set {'bluemagic', 'darkmagic', 'divinemagic', 'elementalmagic', 'enhancingmagic', 'enfeeblingmagic', 'healingmagic', 'ninjitsu', 'singing', 'summoning'}.
ERROR: Element 'elseif', attribute 'ad_skill': 'EnhancingMagic' is not a valid value of the atomic type 'ashitaSkillType'.
ERROR: Element 'if', attribute 'advanced': The attribute 'advanced' is not allowed.
Some of these are from premade xml files that I tweeked myself and left some things but will the XSD still function with these errors? tried doing an 'ad_' lookup but only syntax I had used showed up, not the entire list of options. Thanks!
Post Reply