Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lddtool does not generate the correct closing tag for rule_type = Report #667

Closed
msbentley opened this issue Aug 4, 2023 · 0 comments Β· Fixed by #675
Closed

lddtool does not generate the correct closing tag for rule_type = Report #667

msbentley opened this issue Aug 4, 2023 · 0 comments Β· Fixed by #675
Assignees
Labels

Comments

@msbentley
Copy link

Checked for duplicates

Yes - I've already checked

πŸ› Describe the bug

When including a rule_type of Report in an ingest file, the output Schematron is invalid because the opening tag is sch:report but the closing tag is </sch:assert>.

πŸ•΅οΈ Expected behavior

I expected LDDTool to use both opening and closing tags for a given rule with report or assert, as appropriate.

πŸ“œ To Reproduce

Create a rule with rule_type report, e.g.

    <DD_Rule>    
        <local_identifier>label_file_version</local_identifier>
        <rule_context>/pds:Product_Observational/pds:Identification_Area</rule_context>
        <rule_assign>name="file-name" value="replace(tokenize(document-uri(/), '/')[last()],'\.[^.]+$','')"</rule_assign>
        
        <DD_Rule_Statement>
            <rule_type>Report</rule_type>
            <rule_test>
                contains($file-name, '__')
            </rule_test>
            <rule_message>
                Label filename (&lt;sch:value-of select="$file-name"/&gt;) must contain the version ID in the format __[major]_[minor].xml|lblx, and no "__" detected here
            </rule_message>
            <rule_description>Look for double-underscore</rule_description>
        </DD_Rule_Statement>

Inspect the generated schematron and note:

  <sch:pattern>
    <sch:rule context="/pds:Product_Observational/pds:Identification_Area">
      <sch:let name="file-name" value="replace(tokenize(document-uri(/), '/')[last()],'\.[^.]+$','')"/>
      <sch:report test="
                contains($file-name, '__')
            ">
       <title>/pds:Product_Observational/pds:Identification_Area/Rule</title>
        
                Label filename (<sch:value-of select="$file-name"/>) must contain the version ID in the format __[major]_[minor].xml|lblx, and no "__" detected here
            </sch:assert>

which is invalid since the closing report tag should is missing (instead it's assert).

πŸ–₯ Environment Info

  • Version of this software: 14.2.4
  • Operating System: MacOSX 13.3.1

πŸ“š Version of Software Used

14.2.4

🩺 Test Data / Additional context

No response

πŸ¦„ Related requirements

πŸ¦„ #xyz

βš™οΈ Engineering Details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

4 participants