KWJ_nekko_6320
KWJ_nekko_6320

Reputation: 1

XML XInclude for game modding

I'm trying a game modding by using a "mask" for appending the existing xml file, but something is wrong.

(I don't know how to test XML parsing with multiple xml files and XInclude, both online and with VSCode. If anyone knows the way to test XInclude by myself please kindly inform me)

The original XML file in the game client looks like:

// (without any prolog)
<filename.xml>
    <settings> (blah blah) </settings>
    <grid> (blah blah) </grid>
    <nodes>
        <lots_of_items/>
    </nodes>
</filename.xml>

This file is updated in the client side very often so I just want to quote it into my modded xml file instead of direct copying.

Because of lack of a testbed for XInclude framework I'm stuck with smallest questions.

I tried XInclude inclusions like these but neither one worked:

<filename.xml xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="vanilla.xml">
    <nodes>
        <items_being_added/>
    </nodes>
</filename.xml>

(including the whole vanilla file; maybe this resulted in an unwanted nested structure?)

<filename.xml xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="vanilla.xml" xpointer="element(/1)">
    <nodes>
        <items_being_added/>
    </nodes>
</filename.xml>

(maybe making the unwanted nested structure again?)

<filename.xml xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="vanilla.xml" xpointer="element(/1/1)">
    <xi:include href="vanilla.xml" xpointer="element(/1/2)">
    <xi:include href="vanilla.xml" xpointer="element(/1/3)">
    <nodes>
        <items_being_added/>
    </nodes>
</filename.xml>

Also I've seen some people using the xmlns URL simply w3.org/2001/XInclude, perhaps this is needed to prevent the confusion of http: and https:?

Or maybe the game client has a very slimmed built-in XML parser so XInclude is not working at all? If it is so, is there any solution to forcefully include XInclude into the client?

Also, maybe using <nodes> tag again the file is not 'adding the items' into the <nodes> tag but 'replacing the whole <nodes> tag'?

Upvotes: 0

Views: 33

Answers (0)

Related Questions