lemminx icon indicating copy to clipboard operation
lemminx copied to clipboard

Documentation for RelaxNG child elements colliding

Open gonuke opened this issue 7 months ago • 0 comments

I have a Relax-NG schema with multiple elements at the same level in the hierarchy, each with a different name, but each has a child element with the same name. Example snippet:

<element name="foo">
   <element name="date"><a:documentation>Date of a FOO object</a><text/></element>
</element>
<element name="bar">
   <element name="date"><a:documentation>Date of a BAR object</a><text/></element>
</element>

When I create an XML file such as:

<foo><date></date></foo>
<bar><date></date></bar>

and access the documentation for the date child element in either of these foo or bar elements, I get the same foo documentation shown in each case.

My guess is that the search for documentation is only using the depth in the hierarchy and not the context of where that element occurs.

Note: I experience this through the VS Code XML plugin

gonuke avatar Jun 10 '25 14:06 gonuke