STARIONGROUP / reqifsharp

A C# library for reading and writing reqif documents
https://reqifsharp.org
Apache License 2.0
24 stars 14 forks source link

Cannot read ATTRIBUTE-VALUE-XHTML #12

Closed blopez closed 5 years ago

blopez commented 5 years ago

Prerequisites

Description

I got a ReqIF file where some SPEC-OBJECT elements have ATTRIBUTE-VALUE-XHTML fields that are not properly read after Deserialize. Is there any way to read these values, including formatting or just as plain text?

Steps to Reproduce

Example of SPEC-OBJECT within my ReqIF file:

<SPEC-OBJECT IDENTIFIER="rmf-spec-obj-id">
          <VALUES>
            <ATTRIBUTE-VALUE-XHTML>
              <DEFINITION>
                <ATTRIBUTE-DEFINITION-XHTML-REF>rmf-field-id</ATTRIBUTE-DEFINITION-XHTML-REF>
              </DEFINITION>
              <THE-VALUE>
                <xhtml:div>Description of the SpecObject that includes formatted tables and/or style:<xhtml:ul class="noindent">
                    <xhtml:li>Element 1</xhtml:li>
                    <xhtml:li>Element 2</xhtml:li>
                  </xhtml:ul></xhtml:div>
              </THE-VALUE>
            </ATTRIBUTE-VALUE-XHTML>
             </VALUES>
            <TYPE>
            <SPEC-OBJECT-TYPE-REF>_id</SPEC-OBJECT-TYPE-REF>
          </TYPE>
        </SPEC-OBJECT>

The way I'm deserializing my file: ReqIFDeserializer deserializer = new ReqIFDeserializer(); ReqIF reqIf = deserializer.Deserialize(@"myFile.reqif");

As a result, I the SpecObjects are created properly within the ReqIF item, but in the list of Values, this ATTRIBUTE-VALUE-XHTML field is never read.

System Configuration

samatstariongroup commented 5 years ago

@blopez that looks like a bug. Could you please send me a complete reqif file that we can use as an example to fix this. Would us get it fixed faster.

blopez commented 5 years ago

Sure, please find attached a zip file, with a reqif file inside. I just cut out some SPEC-OBJECTS for simplicity, so I'm not sure if I somehow disturbed the SPEC-HIERARCHY nodes below. Looking forward to hearing from you!

sample_debug.zip

samatstariongroup commented 5 years ago

@blopez I just updated the testreqif.reqif file with XHTML content based on the original issue and added a unit test for it at ReqIFDeSerializerTestFixture. and it seems to be working as is.

samatstariongroup commented 5 years ago

@blopez I just added the sample_dubg reqif file to the test project and checked with a unit test whether i can read the value of the XHTML attributes, seems to be working. Perhaps i didn't understand the original question. Can you have a look at the test and let me know if this solves the issue?

https://github.com/RHEAGROUP/reqifsharp/blob/development/ReqIFSharp.Tests/SampleDebugTestFixture.cs

samatstariongroup commented 2 years ago

@blopez working on a web based reqif viewer, check it out here: https://viewer.reqifsharp.org/ and let us know what you think!