XDMF3 reader doesn't support Geometry references?

The following problem is observed using Paraview 5.5.1. The attached XDMF file uses topology and geometry defined at the Domain level (for re-use in a real scenario), and references those in a single-element quadrilateral grid. The file loads fine with the older (v2?) reader, but fails with version 3 with the following error:

['Format' not found in generateHeavyControllers in XdmfCoreItemFactory
terminate called after throwing an instance of 'XdmfError'
  what():  'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
Aborted (core dumped)

It seems to be a problem with the Geometry DataItem element, which for some reason is expected to have all the tags (Format, Dimensions, etc.) although it is a reference to a previously defined DataItem.

bad.xdmf (1.1 KB)

Your .xdmf file does not validate against Xdmf.dtd
https://gitlab.kitware.com/xdmf/xdmf/blob/master/Xdmf.dtd

/home/glow/Downloads/bad.xdmf:20: element DataItem: validity error : Element DataItem does not carry attribute Dimensions
/home/glow/Downloads/bad.xdmf:25: element DataItem: validity error : Element DataItem does not carry attribute Dimensions
/home/glow/Downloads/bad.xdmf:28: element DataItem: validity error : Element DataItem does not carry attribute Dimensions
/home/glow/Downloads/bad.xdmf:31: element DataItem: validity error : Element DataItem does not carry attribute Dimensions

So it appears that the Xdmf2 reader is just more lenient.
A segfault is still not good though.

@mwestphal Thanks for your answer. The xdmf file I’ve uploaded essentially follows the example given on the xdmf.org website in section Geometry. This is the example, shortened a bit for simplicity

    <Domain>
        <DataItem Name="Point Data" Format="XML" Dimensions="2 4 3">
[...]
        </DataItem>
        <Grid Name="Two Quads">
            <Topology Type="Quadrilateral" NumberOfElements="2" >
[...]
            </Topology>
            <Geometry GeometryType="XYZ">
                <DataItem Reference="XML">
                    /Xdmf/Domain/DataItem[@Name="Point Data"]
                </DataItem>
            </Geometry>
        </Grid>
    </Domain>
</Xdmf>

So the Geometry item contains a DataItem with a Reference attribute, but nothing else. From the validation messages you’ve posted it seems that the Xdmf.dtd expects there to be a Dimensions attribute, which is not contained in the example above. It seems strange to require any attributes apart from Reference, because the DataItem is a Reference to a well-defined other DataItem, so why would it need any other attribures? But regardless, I added it in this file

bad_fix1.xdmf (1.2 KB)

It doesn’t change Paraview’s behavior. Still the same message and a segfault:

'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
terminate called after throwing an instance of 'XdmfError'
  what():  'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
Aborted (core dumped)

So Paraview expects a Format attribute in addition, which is apparently not required by the DTD.
But then I checked, and the ‘fixed’ file also doesn’t validate against the mentioned DTD, but in a much more serious way:

$ xmllint --dtdvalid Xdmf.dtd bad_fix1.xdmf
bad_fix1.xdmf:3: element Xdmf: validity error : No declaration for attribute xmlns:xi of element Xdmf
bad_fix1.xdmf:4: element Domain: validity error : Element Domain content does not follow the DTD, expecting (Information* , Grid+), got (DataItem DataItem DataItem DataItem Grid )

From the above it seems that the DTD doesn’t allow any specification of DataItem on a Domain level. That would explain a lot of my problems, but the mentioned document from xdmf.org explicitly states that this is a feature that allows re-use of DataItems:

It is valid to have DataItem elements to be direct children of the Xdmf or Domain elements. This could be useful if several Grids share the same Geometry but have separate Topology

So which part is wrong here, and which is correct? The Xdmf.dtd, the xdmf.org documentation, or Paraview’s implementation?

the .dtd file and the mentioned documentation are both from xdmf.org, and seems to be inconsistent.

I’m not sure what is wrong here.

@Dave_DeMarle was one of the main contributor. He may know.