Skip to content

SSP-Schema V1.0.0 and V1.0.1 Exceptions #1127

@mpemy

Description

@mpemy

Describe the bug

I am building an OSCAL Converter to Word application using C# under .Net Framework 4.7.2 with Visual Studio 2019.
When I load SSP Schema to validate my oscal XML file I have an exception. This is the exception message:
System.Xml.Schema.XmlSchemaException: 'The Pattern constraining facet is invalid - parsing "^([\p{_xmlI}-[:𐀀-�]][\p{_xmlC}-[:𐀀-�]]*)$" - [x-y] range in reverse order.'

This exception occurs when I try to compile the schema set.
These are the code lines where the exception occur
XmlSchemaSet schema = new XmlSchemaSet();
schema.Add(XMLNamespace, XsdSchemaPath);
schema.Compile();

Who is the bug affecting?

Tool vendors who are working to develop OSCAL-based tools and utilities.

What is affected by this bug?

Because of this bug, I cannot validate if the oscal XML file my application creates is a valid v1.0.0 oscal file or a valid v1.0.1. But when I load the RC2 schema I do not have this exception.
{Describe the impact the bug is having.}
My application cannot Validate the OSCAL V1.0.0 files it produces against the official OSCAL Schema.

When does this occur?

Once you load the schema and try to compile it, the IDE fire an exception
{Describe the conditions under which the bug is occurring.}

How do we replicate the issue?

  1. Start a basic console application with C# under .Net Framework 4.7.2
  2. Load the ssp schema with the namespace XMLNamespace = @"http://csrc.nist.gov/ns/oscal/1.0", once you compile the schema with the method Compile(), you get the exception. This is true for XML schema in the folder. This is the file in question
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OSCALConversion;
using OSCALToolKitClasses;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Linq;

namespace OSCALConversionConsole
{
    class Program
    {
        static string sspSchema = @"C:\Users\Mous\Downloads\oscal-1.0.1\oscal-1.0.1\xml\schema\oscal_ssp_schema.xsd";
        static string sapSchema = @"C:\Users\Mous\Downloads\oscal-1.0.1\oscal-1.0.1\xml\schema\oscal_assessment-plan_schema.xsd";
        static string sarSchema = @"C:\Users\Mous\Downloads\oscal-1.0.1\oscal-1.0.1\xml\schema\oscal_assessment-results_schema.xsd";
        static string poamSchema = @"C:\Users\Mous\Downloads\oscal-1.0.1\oscal-1.0.1\xml\schema\oscal_poam_schema.xsd";
        static string completeSchema = @"C:\Users\Mous\Downloads\oscal-1.0.1\oscal-1.0.1\xml\schema\oscal_complete_schema.xsd";

        protected const string XMLNamespace = @"http://csrc.nist.gov/ns/oscal/1.0";
        static void Main(string[] args)
        {
            try
            {
                XmlSchemaSet schema = new XmlSchemaSet();
                schema.Add(XMLNamespace, completeSchema);
                schema.Compile();
            }
            catch (Exception exs)
            {
                string mess = exs.Message;
            }
        }
    }
}

If applicable, add screenshots to help explain your problem.}

Expected behavior (i.e. solution)

The Pattern constraining facet is invalid - parsing "^([\p{_xmlI}-[:𐀀-�]][\p{_xmlC}-[:𐀀-�]]*)$" - [x-y] range in reverse order.

Other Comments

{Add any other context about the problem here.}

Metadata

Metadata

Labels

Scope: MetaschemaIssues targeted at the metaschema pipelinebug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions