Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] Parse/Merge .xml & preserve <![CDATA[...]]>

Experienced Elementalist
Joined
Oct 2, 2005
Messages
234
Reaction score
48
Okay, so I am trying to Parse the Libconfig.xml file, from <TABLE to </TABLE> then search for name='???' in <TABLE name='KeyInfo' RowCount='77' TableInfoID = '17' FieldCnt = '4'> and create new .xml files.

Here are some examples:
KeyInfo.xml
CharacterInfo.xml
ADActorInfo.xml
AmmoSlotWindow.xml
and so on...

I tried using an XSLT 2.0 Script using saxon9he.jar and split the file up by table and rename it to the table name, but it removed all of the CDATA tags from the file.

Here is an example:
altasking - [Help] Parse/Merge .xml & preserve  <![CDATA[...]]> - RaGEZONE Forums


becomes

altasking - [Help] Parse/Merge .xml & preserve  <![CDATA[...]]> - RaGEZONE Forums


also here is the XSLT script that I used:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
    xmlns:emp="http://www.semanticalllc.com/ns/employees#"
    xmlns:h="http://www.w3.org/1999/xhtml"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:j="http://www.w3.org/2005/xpath-functions"
    version="3.0"
    expand-text="yes"
    >
<xsl:template match="TABLE">
  <xsl:result-document indent="yes" href="xml/{@name}.xml">
    <xsl:copy-of select="."/>
  </xsl:result-document>
</xsl:template>
</xsl:stylesheet>

and after doing some research it turns out that XSLT does not support CDATA..

So I am wondering if anyone here can help do this and Preserver all of the CDATA tags in libconfig.xml there are 2,973,198 of them in all.

And then I would also like to Merge them all back into a new libconfig.xml file.

 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top