Jump to content

xpath error


SlicksGirl

Recommended Posts

so i am getting this error

 

2019-03-25T23:13:02 62.173 ERR XML loader: Patching 'recipes.xml' from mod 'DW Mods - Dyes Mod' failed
2019-03-25T23:13:02 62.174 EXC XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute
Exception: XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute
 at XmlPatcher.singlePatch (.XmlFile _targetFile, System.Xml.XmlElement _patchElement, System.String _patchName) [0x00000] in <filename unknown>:0 
 at XmlPatcher.PatchXml (.XmlFile _xmlFile, .XmlFile _patchXml, System.String _patchName) [0x00000] in <filename unknown>:0 
 at XmlPatcher.LoadAndPatchConfig (System.String _configName) [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Logger:masterLogException(Exception)
Logger:Exception(Exception)
Log:Exception(Exception)
XmlPatcher:LoadAndPatchConfig(String)
<loadSingleXml>c__Iterator1:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

and my code looks like this

 

<?xml version="1.0" encoding="UTF-8" ?>

<!--recipes-->

<append xpath="/recipes">

blah blah blah

</append>

 

I copied and pasted the xpath code over from the items one for this mod and the items one has no errors. I've also ran the code through a validator, used ccleaner on my computer, validated the steam files, and started a brand new game. It still says the xpath file isnt coded. any ideas why?

Link to comment
Share on other sites

still getting an error....

 

ERR XML loader: Patching 'item_modifiers.xml' from mod 'DW Mods - Dyes Mod' failed
EXC XML.Patch (/append/item_modifiers): Patch element does not have an 'xpath' attribute
Exception: XML.Patch (/append/item_modifiers): Patch element does not have an 'xpath' attribute

 

<?xml version="1.0" encoding="UTF-8" ?>

<!--items-->

<append xpath="/items">

<!--itemmods-->
<item_modifiers>
..........

</item_modifiers>

</append>

 

 ERR XML loader: Patching 'recipes.xml' from mod 'DW Mods - Dyes Mod' failed
161.705 EXC XML.Patch (/append/recipes): Patch element does not have an 'xpath' attribute
Exception: XML.Patch (/append/recipes): Patch element does not have an 'xpath' attribute

 

<?xml version="1.0" encoding="UTF-8" ?>

<!--recipes-->

<append xpath="/recipes">

<recipes>
......
</recipes>

</append>

Link to comment
Share on other sites

Sample I haven't used yet but works if that helps the thought process for recipes

 

<append xpath="/recipes">
   <recipe name="SteelWheel" count="1" craft_area="workbench">
     <ingredient name="resourceForgedSteel" count="25" />
     <ingredient name="resourceSpring" count="5" />
     <ingredient name="resourceMechanicalParts" count="5" />
   </recipe>
</append>

Link to comment
Share on other sites

Sample I haven't used yet but works if that helps the thought process for recipes

 

<append xpath="/recipes">
   <recipe name="SteelWheel" count="1" craft_area="workbench">
     <ingredient name="resourceForgedSteel" count="25" />
     <ingredient name="resourceSpring" count="5" />
     <ingredient name="resourceMechanicalParts" count="5" />
   </recipe>
</append>

 

yeah, my other mod worked fine with this exact code set up for xpath and i simply copied it over, put them in a new file, and changed the content for the next mod. and it kept failing. the content code had been tested directly pasted into the vanilla files and worked fine. even worked fine as part of the previous mod. I simply decided to make my mod into modlets to make it easier to edit things later on. and the second mod refused to work, despite having this same exact set up as you showed.

Link to comment
Share on other sites

Ok so silly question as I am running out of ideas here but in each xml do you have a starting point and end point ?

I always use my modlet name I dont see a start and end point in your recipes.xml or is that just not copied over for the forum ?

 

 

 

<Ragsy_Wheels_Of_Steel> 

<append xpath="/recipes">
   <recipe name="SteelWheel" count="1" craft_area="workbench">
     <ingredient name="resourceForgedSteel" count="25" />
     <ingredient name="resourceSpring" count="5" />
     <ingredient name="resourceMechanicalParts" count="5" />
   </recipe>
</append>

</Ragsy_Wheels_Of_Steel>

 

On one the code quotes starts <DWModsAdminMod> for blocks.xml

Link to comment
Share on other sites

Ok so silly question as I am running out of ideas here but in each xml do you have a starting point and end point ?

I always use my modlet name I dont see a start and end point in your recipes.xml or is that just not copied over for the forum ?

 

 

 

<Ragsy_Wheels_Of_Steel> 

<append xpath="/recipes">
   <recipe name="SteelWheel" count="1" craft_area="workbench">
     <ingredient name="resourceForgedSteel" count="25" />
     <ingredient name="resourceSpring" count="5" />
     <ingredient name="resourceMechanicalParts" count="5" />
   </recipe>
</append>

</Ragsy_Wheels_Of_Steel>

 

On one the code quotes starts <DWModsAdminMod> for blocks.xml

 

simply not copied over. hard to forget to write it because notepadd++ automatically writes it after <anything>

Link to comment
Share on other sites

I notice also in your item_modifiers.xml you have <append xpath="/items">

 

To be honest I wish I had started modding before A17

 

XML Modding for A16 and previous versions you decide what you want to do and put code in ...job done .

 

yea i saw that, fixed it, still got the eror..

 

before 17 modding wasnt as easy as this. yeah you pasted it in and every time you wanted a new mod.. you had to add in the code... and then hope you didnt mess something up. anytime you wiped a server, verified your game cache, or got an update to the game.. you had to manually ad all your mods back in. it was a tedious nightmare.

 

although it seems like more of en effort to create mod files and use xpath, it will make readding those same mods each game, easier and easier. it also makes finding bugs easier, you have one short page of code to look in, instead of 6,000+ lines of code.

Link to comment
Share on other sites

Ok well in that case probably best I didn't start there I would have pulled out whats left of my hair lol.

 

The best way of learning xpath other than tutorials and vids posted in these forums is to just look at other modders work on how they coded stuff, many if not all modders here are quite ok if you take their code ideas and mould it to what you want and I am no exception.

 

If you really want to get good advise on a one to one level then join Guppy's discord, there is live support on there too and a lot of us still learning the ways of xpath but people are very knowledgable and there seems to be always someone who knows or can point you in the right directions.

Link to comment
Share on other sites

Ok well in that case probably best I didn't start there I would have pulled out whats left of my hair lol.

 

The best way of learning xpath other than tutorials and vids posted in these forums is to just look at other modders work on how they coded stuff, many if not all modders here are quite ok if you take their code ideas and mould it to what you want and I am no exception.

 

If you really want to get good advise on a one to one level then join Guppy's discord, there is live support on there too and a lot of us still learning the ways of xpath but people are very knowledgable and there seems to be always someone who knows or can point you in the right directions.

 

yea, i joined his discord back on a15, I've been modding since a11 (and coding since around 1998). I've just not posted my stuff here much because when i do, there is this one forum guy that bullies me and admins have to take down my threads. so now, i just mainly keep to myself, except with i cannot get something to work after days of trying, like with xpath.

Link to comment
Share on other sites

yea, i joined his discord back on a15, I've been modding since a11 (and coding since around 1998). I've just not posted my stuff here much because when i do, there is this one forum guy that bullies me and admins have to take down my threads. so now, i just mainly keep to myself, except with i cannot get something to work after days of trying, like with xpath.

 

Thats a lot of experience on coding .... and I am sorry you have had the problems on the forums too.

 

If I do think of something to help you out with this issue then I will let you know but for now I am out of idea's.

Link to comment
Share on other sites

Thats a lot of experience on coding .... and I am sorry you have had the problems on the forums too.

 

If I do think of something to help you out with this issue then I will let you know but for now I am out of idea's.

 

no worries, i should buckle down and take a course and get certified. Coding is soo much like math that its easy for me to pick up. The error just radomly resolved itself. so somehow i fixed it and dont even know what i did. But i'm going to create a template file set so that all i have to do is fill the pages up with content. I'll probably release that as a mod on the forums with instructions on how to use it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...