Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use specialized URI type for package spec that is more relaxed than System.Uri #1965

@twsouthwick

Description

@twsouthwick

Is your feature request related to a problem? Please describe.
The current Uri usage in the System.IO.Packaging is very strict to the official RFC, but appears to be too strict for what Office documents can have

Describe the solution you'd like
We should have a generalized type (i.e. OpenXmlUri) that will easily convert to System.Uri or string representations.

Describe alternatives you've considered
There are a few attempts at handling this, most recently, this:

private sealed class RewrittenUri : Uri
{
public RewrittenUri(string uriString, string original)
: base(uriString)
{
Target = original;
}
public string Target { get; }
public string Rewritten => OriginalString;
public override string ToString() => Target;
}

It may be useful to start with.

TODO:

  • Find where in the spec the Uri type is defined for the packaging spec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions