Any hints: Failed to parse XML file: 9
aismann opened this issue · comments
D:_\GitHub_XDE_To_C++\miniML-Parser-master\miniML-Parser-master\tool>"D:_\GitHub_XDE_To_C++\miniML-Parser-master\miniML-Parser-master\tool\xml_code_generator.exe" "D:______\GitHub\LostLabyrinth-Portal\Resources\wiki\tool\monster.xsd"
Failed to parse XML file:
monster.xsd.txt
9
rename monster.xsd.txt => monster.xsd
Hi aismann,
I tried your schema file. It failed due to mixed attribute of xs:complexType on line 7. miniML parser doesn't support mixed content yet. It adds more complexity in the library than the benefit it brings. I tried multiple approach to support mixed content but it makes this parser more complex. The goal of this parser is not to support all the features/specifications of XML. Instead its aim is to be easy to use, small footprint that covers most common use cases.
If possible refactor your schema to avoid mixed content. You can use attribute or child element of complex element to hold
the content.
I quickly edited your monster.xsd file and tried generating source code. I've attached it for your reference. Use latest xml_code_generator.exe. It now shows the failure message.
monster.xsd.txt
Lost_Labyrinth_Monster.c.txt
Lost_Labyrinth_Monster.h.txt
Regards,
Nandkishor
The command I used to generate source code is,
xml_code_generator.exe -b -d C:\project\monster.xsd
The xml_code_generator tool doesn't cover all the complex features of XML schema. You can use it as a starting point to generate source. Then edit the source files manually to fine tune as per your requirement.
Hello Nandkishor,
Thanks for your help.
I will think about your tipps.