Skip to content

[Bug]: A ReqIF document with a prefixed root element (reqif:REQ-IF) is read as zero documents  #87

Closed

Description

@samatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the reqifsharp
  • I have searched open and closed issues to ensure it has not already been reported

Description

ReqIFDeserializer recognizes the root element with xmlReader.Name == "REQ-IF". Name includes the namespace prefix, so a document that binds the ReqIF namespace to a prefix (<reqif:REQ-IF xmlns:reqif="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd">) is skipped. Deserialize returns an empty list, without an error and without a validation problem: the document is valid against the schema.

The same check is likely used for other elements that are read by name; they should be checked too.

Proposal

  • Match on LocalName and NamespaceURI instead of Name, in the sync and async paths and for the nested elements.

Acceptance criteria

  • The prefixed copy of a test document deserializes to the same object graph as the unprefixed original.

Steps to Reproduce

  1. Write a valid document with the serializer (coffee.reqif, 3 spec objects).
  2. Make a copy in which the ReqIF namespace is bound to the prefix reqif and every ReqIF element is written as reqif:....
  3. Deserialize both with validation on:
coffee.reqif:          1 document(s), schema problems: 0, spec objects: 3
coffee-prefixed.reqif: 0 document(s), schema problems: 0, spec objects:

System Configuration

  • reqifsharp version: ReqIFSharp 10.1.2, ReqIFSharp.Extensions 5.2.2
  • Environment (Operating system, version and so on): Windows 11
  • .NET Framework version: .NET 10
  • Additional information: Found while planning editing and export in the ReqIF Viewer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions