PDA

View Full Version : Any Tool/Way to Reparse 4E Modules?



Ictinike
April 4th, 2011, 16:07
Greets (again),

Been trying the 4E Lore extension and figured out why it's not working and watned to find out if there is a tool that can take the existing db.xml file in a module and conver it back to it's soure?

The modules I built early on were not full featured and didn't contain a bunch of things but I came across a set of already parsed modules for 4E having all the data needed but they were parsed with an earlier version which did not containe the <Lore> nodes. While the data is in the module it's in there as a <formattedtext> tag.

If I were able to find a way to unparse, if you will, the parsed XML I have I could quickly reparse with the newest version to allow the automatic conversion of the <Lore> nodes.

I've tried placing the required <Lore> and <Skill> check nodes in the existing XML, updating the module and using however it seems not to be able to display the lore at all using the /lore command.

If updating the XML is the only way it will be a tedious job but something I might be able to write a small app to do on my side but if I have to reparse I don't have the source, just the compiled mods.

Wanted to ask the gurus :)

Thanks!
~Ictinike

Zeus
April 4th, 2011, 16:55
You can try the 4E Module Decompiler tool I wrote last year. It reverse engineers compiled module XML back to 4E Parser source. I haven't touched it since I first released it so you may not get clean source files for some of the content types. Give it a go though, NPCs should be OK.

You can find it in the tools section of my 4E Resource site (see sig for link).

Ictinike
April 5th, 2011, 00:38
DrZeuss,

Thanks again. I had already downloaded your module decompiler and tried a few things and figured it was an older/outdated version or hadn't been updated in awhile.

Whats odd is the modules I created worked 100% but this one, the one I received from another community mate seems to be hanging on some of the nodes.

I've gone and tried a few things but not done yet. I think I can get a merge of the NPC data w/fluff and comment out the other nodes it cannot find in the xslt but had to run off on other things. I may wish to consult with you a bit further just so I can understand it better. As well being a .net developer myself, albeit automotive industry, I wouldn't mind checking out the code if you were to be so inclined.

No worries if not, trust me I understand :)

I'll keep ya updated on this but like most of us sometimes you just have to meddle through it to learn it better and I'm hoping to have a few good hours this evening.

As always, excellent work and support and hoping someday I can offer as much!

Cheers,
~Ictinike

Zeus
April 5th, 2011, 11:30
Ictinike - The .NET tool code simply provides a wrapper to the XSL transformation that is being used to convert from XML back to text. If you take a look in the program folder you will find the XSL stylesheet that I use.

99.9% of the logic is implemented in the XSL, with the .NET code simply providing the window, controls and IO routines including calling the SAXON 9 engine to manage the XSL transformations.

You can update the XSL quite easily to support new tags or amend existing ones. XSL pretty much uses pattern matching to match <tags> and then manipulate the data within them. Take a look and let me know if you still would like access to the source code.

DrZ.

Ictinike
April 5th, 2011, 13:55
I'm seeing that :)

Yes right now I'm trying to build up, using xsl, those areas in the db.xml that aren't covered in the base install.

While I have gotten it to the point I can pull out the Lore as such:
zLore
Nature DC 20: (Description)

The parser isn't putting them in the proper node format after re-parsing which is a shame. Reading the thread and post here (https://www.fantasygrounds.com/forums/showpost.php?p=99884&postcount=23) Fot5 got this to work in earlier parser versions but seeing the end of the thread it appears not to be working in later than .115 versions.

So it seems regardless if I find a solution to decompile the module, work in the unique blocks of xml, and find a solution using your tool and xsl; I'm still not going to get it to work :)

~Ictinike