Problem in frameworkExtensionScript.xsd: removeAction element's id attribute is too restrictive

Having trouble installing Oxygen? Got a bug to report? Post it all here.
kai_weber
Posts: 24
Joined: Tue May 05, 2020 9:57 am
Location: Tübingen, Germany
Contact:

Problem in frameworkExtensionScript.xsd: removeAction element's id attribute is too restrictive

Post by kai_weber »

When working on an oXygen framework extension script I noticed that action IDs can be any string, but the frameworkExtensionScript.xsd delivered with oXygen (I'm using v25.0) defines the @id-attribute of the <removeAction> element with data type xs:NCName:

Code: Select all

<xs:element name="removeAction">
    <xs:annotation>
      <xs:documentation>Removes an action that was added in the Content Completion Assistant from
        the base framework configuration.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:attribute name="id" use="required" type="xs:NCName">
        <xs:annotation>
          <xs:documentation>Action ID.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
So when I try to remove actions with action IDs that don't fit the xs:NCName data model, I get validation errors in my extension script file.

Here's an example from an open source project: Ediarum defines an author action with the ID "sic-corr[deleted]". My .exf file, which is based on the ediarum.BASE.edit framework, fails validation at the line:

Code: Select all

<removeAction id="sic-corr[deleted]"/>
Luckily, being able to validate the extension script or not doesn't influence the functionality: Even with the validation error for the above code line, the action is effectively removed from the derived framework, so it's not too big a deal.

Best regards,
Kai
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Problem in frameworkExtensionScript.xsd: removeAction element's id attribute is too restrictive

Post by alex_jitianu »

Hi Kai,

Thank you for reporting this issue. I've added an issue to relax the schema and accept any string. You are right, the validation error doesn't affect the functionality. Meanwhile, you can make the change yourself in {oxygenInstallDir}\frameworks\extensions\frameworkExtensionScript\frameworkExtensionScript.xsd and replace xs:NCName with xs:string:

Code: Select all

<xs:attribute name="id" use="required" type="xs:NCName">
best regards,
Alex
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problem in frameworkExtensionScript.xsd: removeAction element's id attribute is too restrictive

Post by Radu »

Hi,
As an update the newly released Oxygen 26 should no longer report a validation error in this case.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply