GDML Import Error Due to Comment at End of File

GDML giles with comments after the closing GDML tag, </gdml>, produce an error when being loaded:

$ root 
root [0] TGeoManager::Import("root-test.gdml")
Info in <TGeoManager::Import>: Reading geometry from file: root-test.gdml
Info in <TGeoManager::TGeoManager>: Geometry GDMLImport, Geometry imported from GDML created
Error in <TXMLEngine::ParseFile>: Unexpected end of xml file
Error in <TGeoManager::Import>: Cannot open file
(TGeoManager *) 0x7ff2fb337400

The GDML file with a comment at the end:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE gdml [
<!ENTITY common_materials SYSTEM "../common/common-materials.xml">
<!ENTITY common_defines   SYSTEM "../common/common-defines.xml">
<gdml xmlns:gdml=""



   <tube name="solid" rmin="1" rmax="4" z="20" deltaphi="360." aunit="deg" />

   <volume name="My_Vol">
      <solidref ref="solid"/>

<setup name="Default" version="1.0"> <world ref="My_Vol"/></setup>
<!-- A comment which causes an error. -->


This is problem with simple XML parser, used for GDML files parsing.
I will try to fix it.


1 Like

Problem fixed now in master, v6-12-00-patches and v6-10-00-patches branches.

1 Like

Just checked master and it works like a charm. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.