PGM icon indicating copy to clipboard operation
PGM copied to clipboard

Standalone XML parser

Open Electroid opened this issue 4 years ago • 8 comments

Users should be able to test and validate their XMLs without running a Bukkit server. At first, this could be a command line tool, potentially even a simple HTTP server.

Electroid avatar May 09 '20 21:05 Electroid

Working on this...

KingOfSquares avatar Jun 08 '20 22:06 KingOfSquares

Thoughts on abstracting out the parser into its own Maven module? And making it only depend on itself(and jdom)

KingOfSquares avatar Jun 10 '20 16:06 KingOfSquares

It would mean the module would have its own checks for bukkit and pgm types (Materials, Mobs, etc..), so you would have to convert it into Bukkit stuff when it arrives to the main package again.

PGM sends map.xml file to the parser -> The parser uses the jdom stuff to parse the XML and sends MapModules back out -> PGM reacts to the sent modules accordingly.

This also means you can use the parser for other stuff. Some examples: what this issue describes, in-game XML editors, online graphical representation from xml...

KingOfSquares avatar Jun 10 '20 16:06 KingOfSquares

I'd rather we use Bukkit types, and for now not a seperate module. One step at a time.

Electroid avatar Jun 10 '20 18:06 Electroid

Then i'm not entirely sure what to do. MapFactoryImpl already seems like the result to me.

KingOfSquares avatar Jun 11 '20 11:06 KingOfSquares

Not sure if answers your request or even half-answers it, but I found a PGM XML schema awhile back. I forked it and make a few corrections to it. It's still not perfect, but it is really helpful for real-time xml validation. It does not validate it like pgm does when loading the map, but at least you can validate the elements, attributes, etc. Plus it speeds up the xml writing process a ton! https://github.com/harvanchik/PGMSchema

harvanchik avatar Sep 28 '20 05:09 harvanchik

Very cool! We should definitely have an "official" version provided by PGM.

Electroid avatar Sep 28 '20 15:09 Electroid

Very cool! We should definitely have an "official" version provided by PGM.

Totally agree! I am constantly trying to fix errors in the one I linked.

harvanchik avatar Sep 28 '20 16:09 harvanchik