### Create a Simple Word Document with Open XML SDK Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml/README.md Use this snippet to create a basic Word document with a single paragraph of text. Ensure you have the Open XML SDK installed. ```csharp using (var doc = WordprocessingDocument.Create("example.docx", WordprocessingDocumentType.Document)) { var mainPart = doc.AddMainDocumentPart(); mainPart.Document = new Document(new Body(new Paragraph(new Run(new Text("Hello, Open XML!"))))); } ``` -------------------------------- ### OpenXmlPart Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on methods for interacting with an OpenXmlPart, including feeding data, retrieving parent parts, getting streams, and checking if the root element is loaded. ```APIDOC ## OpenXmlPart Methods ### Description Provides methods for managing and accessing data within an OpenXmlPart, such as feeding data from a stream, retrieving parent parts, obtaining streams for reading or writing, and checking the loading status of the root element. ### Methods - **FeedData(System.IO.Stream sourceStream)** - void - Feeds data from the specified stream into the part. - **GetParentParts()** - System.Collections.Generic.IEnumerable! - Gets the parent parts of this part. - **GetStream()** - System.IO.Stream! - Gets a stream to the part's content. - **GetStream(System.IO.FileMode mode)** - System.IO.Stream! - Gets a stream to the part's content with the specified file mode. - **GetStream(System.IO.FileMode mode, System.IO.FileAccess access)** - System.IO.Stream! - Gets a stream to the part's content with the specified file mode and access. - **UnloadRootElement()** - DocumentFormat.OpenXml.OpenXmlPartRootElement? - Unloads the root element of the part. ### Properties - **IsRootElementLoaded** (bool) - Gets a value indicating whether the root element is loaded. - **OpenXmlPackage** (DocumentFormat.OpenXml.Packaging.OpenXmlPackage!) - Gets the parent OpenXmlPackage. - **RootElement** (DocumentFormat.OpenXml.OpenXmlPartRootElement?) - Gets the root element of the part. - **Uri** (System.Uri!) - Gets the URI of the part. ``` -------------------------------- ### Adding and Getting IPartEventsFeature Source: https://github.com/dotnet/open-xml-sdk/blob/main/docs/Features.md Add the IPartEventsFeature to a part or package to receive event notifications about part changes. Retrieve the feature using GetRequired. ```csharp OpenXmlPart part = GetSomePackage(); package.AddPartEventsFeature(); var feature = part.Features.GetRequired(); ``` -------------------------------- ### Adding and Getting IPartRootEventsFeature Source: https://github.com/dotnet/open-xml-sdk/blob/main/docs/Features.md Add the IPartRootEventsFeature to a part to receive event notifications about part root modifications. Retrieve the feature using GetRequired. ```csharp OpenXmlPart part = GetSomePart(); part.AddPartRootEventsFeature(); var feature = part.Features.GetRequired(); ``` -------------------------------- ### FeatureCollection Class Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides methods for managing features within a collection, including getting, setting, and checking read-only status. ```APIDOC ## FeatureCollection Class ### Description Manages a collection of features, allowing retrieval, setting, and checking for read-only status. ### Methods - **FeatureCollection(IFeatureCollection defaults, bool isReadOnly = false)**: Initializes a new instance of the FeatureCollection class. - **FeatureCollection(int initialCapacity)**: Initializes a new instance of the FeatureCollection class with a specified initial capacity. - **Get()**: Retrieves a feature of the specified type. - **GetEnumerator()**: Returns an enumerator that iterates through the FeatureCollection. - **Set(TFeature? instance)**: Sets a feature instance in the collection. ### Properties - **IsReadOnly**: Gets a value indicating whether the feature collection is read-only. - **this[Type key]**: Gets or sets the feature associated with the specified key. ``` -------------------------------- ### Basic LINQ to XML Usage with Open XML SDK Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Linq/README.md Demonstrates how to open a WordprocessingDocument and query its paragraphs using LINQ to XML. Ensure the 'example.docx' file exists. ```csharp using (var doc = WordprocessingDocument.Open("example.docx", false)) { var xDoc = doc.MainDocumentPart!.GetXDocument(); var paragraphs = from p in xDoc.Descendants(W.p) select p; } ``` -------------------------------- ### Adding and Getting IPackageEventsFeature Source: https://github.com/dotnet/open-xml-sdk/blob/main/docs/Features.md Add the IPackageEventsFeature to a package to receive event notifications about package changes. Retrieve the feature using GetRequired. ```csharp OpenXmlPackage package = GetSomePackage(); package.TryAddPackageEventsFeature(); var feature = package.Features.GetRequired(); ``` -------------------------------- ### Configure NuGet for Daily Builds Source: https://github.com/dotnet/open-xml-sdk/blob/main/README.md Add this configuration to your NuGet.config file to access the latest daily builds from the Open XML SDK Azure blob feed. ```xml ``` -------------------------------- ### OpenXmlCompositeElement Constructors and Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on creating and manipulating OpenXmlCompositeElement objects. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlCompositeElement.AddChild(DocumentFormat.OpenXml.OpenXmlElement! newChild, bool throwOnError = true) ### Description Adds a child element to the composite element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlCompositeElement.OpenXmlCompositeElement() ### Description Initializes a new instance of the OpenXmlCompositeElement class. ### Method POST ### Endpoint N/A (Constructor) ## DocumentFormat.OpenXml.OpenXmlCompositeElement.OpenXmlCompositeElement(params DocumentFormat.OpenXml.OpenXmlElement[]! childrenElements) ### Description Initializes a new instance of the OpenXmlCompositeElement class with specified child elements. ### Method POST ### Endpoint N/A (Constructor) ## DocumentFormat.OpenXml.OpenXmlCompositeElement.OpenXmlCompositeElement(string! outerXml) ### Description Initializes a new instance of the OpenXmlCompositeElement class from an outer XML string. ### Method POST ### Endpoint N/A (Constructor) ## DocumentFormat.OpenXml.OpenXmlCompositeElement.OpenXmlCompositeElement(System.Collections.Generic.IEnumerable! childrenElements) ### Description Initializes a new instance of the OpenXmlCompositeElement class with a collection of child elements. ### Method POST ### Endpoint N/A (Constructor) ``` -------------------------------- ### IPackage Interface Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Experimental interface for package management operations. ```APIDOC ## CreatePart ### Description Creates a new part within the package. ### Parameters #### Request Body - **partUri** (System.Uri) - Required - The URI of the part. - **contentType** (string) - Required - The content type of the part. - **compressionOption** (System.IO.Packaging.CompressionOption) - Required - The compression setting. ### Response - **IPackagePart** (object) - The created package part. ``` -------------------------------- ### Open Settings Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Configures settings for opening Open XML documents. ```APIDOC ## DocumentFormat.OpenXml.Packaging.OpenSettings ### Description Configures settings for opening Open XML documents. ### Constructors - **OpenSettings()** ### Properties - **AutoSave** (bool) - Gets or sets a value indicating whether to automatically save changes. - **CompatibilityLevel** (DocumentFormat.OpenXml.Packaging.CompatibilityLevel) - Gets or sets the compatibility level for the document. - **MarkupCompatibilityProcessSettings** (DocumentFormat.OpenXml.Packaging.MarkupCompatibilityProcessSettings) - Gets or sets the markup compatibility process settings. - **MaxCharactersInPart** (long) - Gets or sets the maximum number of characters allowed in a part. ``` -------------------------------- ### OpenXmlDomReader Constructors Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Constructors for creating OpenXmlDomReader instances. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlDomReader.OpenXmlDomReader(DocumentFormat.OpenXml.OpenXmlElement! openXmlElement) ### Description Initializes a new instance of the OpenXmlDomReader class. ### Method POST ### Endpoint N/A (Constructor) ## DocumentFormat.OpenXml.OpenXmlDomReader.OpenXmlDomReader(DocumentFormat.OpenXml.OpenXmlElement! openXmlElement, bool readMiscNodes) ### Description Initializes a new instance of the OpenXmlDomReader class, optionally reading miscellaneous nodes. ### Method POST ### Endpoint N/A (Constructor) ``` -------------------------------- ### OpenXmlPackage Properties and Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on accessing properties like FileOpenAccess, MarkupCompatibilityProcessSettings, MaxCharactersInPart, PackageProperties, and StrictRelationshipFound, as well as the Save method. ```APIDOC ## OpenXmlPackage Properties and Methods ### Description Provides access to various properties of an OpenXmlPackage, such as file access mode, markup compatibility settings, maximum characters allowed in a part, package properties, and the strict relationship found status. It also includes a method to save the package. ### Properties - **FileOpenAccess** (System.IO.FileAccess) - Gets the file open access mode. - **MarkupCompatibilityProcessSettings** (DocumentFormat.OpenXml.Packaging.MarkupCompatibilityProcessSettings) - Gets the markup compatibility process settings. - **MaxCharactersInPart** (long) - Gets the maximum number of characters allowed in a part. - **PackageProperties** (DocumentFormat.OpenXml.Packaging.IPackageProperties) - Gets the package properties. - **StrictRelationshipFound** (bool) - Gets a value indicating whether a strict relationship was found. ### Methods - **Save()** - void - Saves the current state of the package. ### Exceptions - **DocumentFormat.OpenXml.Packaging.OpenXmlPackageException** - Base exception class for OpenXmlPackage related errors. - **OpenXmlPackageException()** - Constructor. - **OpenXmlPackageException(string message)** - Constructor with a message. - **OpenXmlPackageException(string message, System.Exception innerException)** - Constructor with a message and inner exception. ``` -------------------------------- ### OpenXmlElement Methods and Properties Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Comprehensive documentation for OpenXmlElement, including methods for manipulation and property access. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlElement.AddAnnotation(object! annotation) ### Description Adds an annotation to the element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.AddNamespaceDeclaration(string! prefix, string! uri) ### Description Adds a namespace declaration to the element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Ancestors() ### Description Gets the ancestors of the element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Ancestors() ### Description Gets the ancestors of the element of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Annotation(System.Type! type) ### Description Gets an annotation of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Annotation() ### Description Gets an annotation of a specified generic type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Annotations(System.Type! type) ### Description Gets all annotations of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Annotations() ### Description Gets all annotations of a specified generic type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Append(params DocumentFormat.OpenXml.OpenXmlElement[]! newChildren) ### Description Appends new child elements to the current element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Append(System.Collections.Generic.IEnumerable! newChildren) ### Description Appends a collection of new child elements to the current element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.ChildElements.get ### Description Gets the child elements of the current element. ### Method GET ### Endpoint N/A (Property Access) ## DocumentFormat.OpenXml.OpenXmlElement.ClearAllAttributes() ### Description Clears all attributes from the element. ### Method DELETE ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Clone() ### Description Clones the current element. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Descendants() ### Description Gets the descendants of the element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Descendants() ### Description Gets the descendants of the element of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Elements() ### Description Gets the elements of the current element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.Elements() ### Description Gets the elements of the current element of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.ElementsAfter() ### Description Gets the elements that appear after the current element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.ElementsBefore() ### Description Gets the elements that appear before the current element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.ExtendedAttributes.get ### Description Gets the extended attributes of the element. ### Method GET ### Endpoint N/A (Property Access) ## DocumentFormat.OpenXml.OpenXmlElement.Features.get ### Description Gets the features of the element. ### Method GET ### Endpoint N/A (Property Access) ## DocumentFormat.OpenXml.OpenXmlElement.GetAttribute(string! localName, string! namespaceUri) ### Description Gets an attribute by its local name and namespace URI. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.GetAttributes() ### Description Gets all attributes of the element. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.GetFirstChild() ### Description Gets the first child element of a specified type. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.GetOrAddFirstChild() ### Description Gets the first child element of a specified type, or adds it if it does not exist. ### Method POST ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlElement.HasAttributes.get ### Description Gets a value indicating whether the element has attributes. ### Method GET ### Endpoint N/A (Property Access) ## DocumentFormat.OpenXml.OpenXmlElement.InsertAfterSelf(T! newElement) ### Description Inserts a new element after the current element. ### Method POST ### Endpoint N/A (Method Call) ``` -------------------------------- ### OpenXmlUnknownElement Methods and Properties Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on the override methods and properties for DocumentFormat.OpenXml.OpenXmlUnknownElement. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlUnknownElement ### Description Represents an unknown element in Open XML. ### Methods and Properties #### CloneNode(bool deep) - **Description**: Creates a duplicate of this node. - **Parameters**: - **deep** (bool) - Whether to clone recursively. - **Returns**: DocumentFormat.OpenXml.OpenXmlElement! #### InnerText.get - **Description**: Gets the text content of the unknown element. - **Returns**: string! #### LocalName.get - **Description**: Gets the local name of the unknown element. - **Returns**: string! #### NamespaceUri.get - **Description**: Gets the namespace URI of the unknown element. - **Returns**: string! #### Prefix.get - **Description**: Gets the prefix of the unknown element. - **Returns**: string! #### WriteTo(System.Xml.XmlWriter! xmlWriter) - **Description**: Writes the unknown element to the specified XmlWriter. - **Parameters**: - **xmlWriter** (System.Xml.XmlWriter!) - The XmlWriter to write to. - **Returns**: void ``` -------------------------------- ### OpenXmlPartWriterSettings.Async Property Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/net10.0/PublicAPI.Shipped.txt Property to configure asynchronous writing for OpenXmlPartWriter. ```APIDOC ## OpenXmlPartWriterSettings.Async Property ### Description Configures whether the OpenXmlPartWriter should operate asynchronously. ### Property - **Async** (bool): Gets or sets a value indicating whether asynchronous operations are enabled. ``` -------------------------------- ### OpenXmlElementEqualityOptions Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Configuration options for comparing OpenXmlElement instances. ```APIDOC ## OpenXmlElementEqualityOptions ### Include Extended Attributes Gets or sets a value indicating whether to include extended attributes in the comparison. - **Property**: `IncludeExtendedAttributes` - **Type**: `bool` ### Include MC Attributes Gets or sets a value indicating whether to include Markup Compatibility attributes in the comparison. - **Property**: `IncludeMCAttributes` - **Type**: `bool` ### Constructor - **Method**: `OpenXmlElementEqualityOptions()` - **Description**: Creates a new instance of `OpenXmlElementEqualityOptions`. ### Require Parsed Gets or sets a value indicating whether the elements must be parsed for comparison. - **Property**: `RequireParsed` - **Type**: `bool` ### Skip Prefix Comparison Gets or sets a value indicating whether to skip prefix comparison during equality checks. - **Property**: `SkipPrefixComparison` - **Type**: `bool` ``` -------------------------------- ### Custom AppDomain for IsolatedStorage Workaround Source: https://github.com/dotnet/open-xml-sdk/blob/main/samples/IsolatedStorageExceptionWorkaround/README.md This C# code demonstrates a workaround for IsolatedStorage exceptions by creating a new AppDomain with specific evidence. It defines interfaces and classes for managing extensions within this custom domain. ```csharp internal interface IExtension { void Run(); } internal class Extension : MarshalByRefObject, IExtension { public void Run() { } } internal class ExtensionWithAppDomain : MarshalByRefObject, IExtension { private readonly IExtension _other; public ExtensionWithAppDomain() { var evidence = new Evidence(); evidence.AddHostEvidence(new Zone(SecurityZone.MyComputer)); var domain = AppDomain.CreateDomain($"{AppDomain.CurrentDomain.FriendlyName}_Evidence", evidence); _other = (IExtension)domain.CreateInstanceAndUnwrap(typeof(Extension).Assembly.FullName, typeof(Extension).FullName); } public void Run() => _other.Run(); } ``` -------------------------------- ### OpenXmlComparableSimpleValue Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Offers methods for comparing and evaluating OpenXmlComparableSimpleValue instances. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlComparableSimpleValue.CompareTo(DocumentFormat.OpenXml.OpenXmlComparableSimpleValue? other) ### Description Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleValue.CompareTo(object? obj) ### Description Compares the current instance with another object. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleValue.CompareTo(T other) ### Description Compares the current instance with a specified value. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleValue.Equals(DocumentFormat.OpenXml.OpenXmlComparableSimpleValue? other) ### Description Determines whether the specified object is equal to the current object. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleValue.Equals(T other) ### Description Determines whether the specified value is equal to the current object. ### Method GET ### Endpoint N/A (Method Call) ``` -------------------------------- ### Manage Document Tasks and Comments in C# Source: https://github.com/dotnet/open-xml-sdk/blob/main/samples/DocumentTaskExample/README.md Methods for adding tasks, paragraphs with comments, and user mentions to a document. Requires a MainDocumentPart instance. ```csharp // add a new task to a document private static void AddNewTask(MainDocumentPart mdp, string title, User assignee, User assigner) // Add a new paragraph with a comment private static void AddNewParagraphRunWithComment(MainDocumentPart mdp, string strCommentId, string strParagraphText) // Add a comment that mentions another user private static void AddMentionComment(MainDocumentPart mdp, string strCommentId, string mention, string commentText, User mentioner, User mentionee, RandomParagraphIdGenerator pIdGener) ``` -------------------------------- ### Markup Compatibility Process Settings Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides access to settings for processing markup compatibility. ```APIDOC ## DocumentFormat.OpenXml.Packaging.MarkupCompatibilityProcessSettings ### Description Provides access to settings for processing markup compatibility. ### Properties - **ProcessMode** (DocumentFormat.OpenXml.Packaging.MarkupCompatibilityProcessMode) - Gets or sets the process mode for markup compatibility. - **TargetFileFormatVersions** (DocumentFormat.OpenXml.FileFormatVersions) - Gets or sets the target file format versions for markup compatibility. ``` -------------------------------- ### Insert Animated Model 3D Method Source: https://github.com/dotnet/open-xml-sdk/blob/main/samples/AnimatedModel3DExample/README.md This method is used to insert an Animated Model 3D into a PowerPoint presentation. It requires the path to the presentation file, a .png image of the 3D model, and a .glb file for the 3D model itself. ```csharp public static void InsertAnimatedModel3D(string pptxPath, string pngPath, string glbPath) ``` -------------------------------- ### OpenXmlComparableSimpleReference Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides methods for comparing instances of OpenXmlComparableSimpleReference. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlComparableSimpleReference.CompareTo(DocumentFormat.OpenXml.OpenXmlComparableSimpleReference? other) ### Description Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleReference.CompareTo(object? obj) ### Description Compares the current instance with another object. ### Method GET ### Endpoint N/A (Method Call) ## DocumentFormat.OpenXml.OpenXmlComparableSimpleReference.Equals(DocumentFormat.OpenXml.OpenXmlComparableSimpleReference? other) ### Description Determines whether the specified object is equal to the current object. ### Method GET ### Endpoint N/A (Method Call) ``` -------------------------------- ### PackageEventExtensions Class Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides extension methods for package events. ```APIDOC ## PackageEventExtensions Class ### Description Contains extension methods for package event handling. (No specific methods detailed in the provided text, this serves as a placeholder for potential extensions.) ``` -------------------------------- ### IPartExtensionFeature Interface Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Manages part extensions, allowing registration and retrieval of extensions based on content type. ```APIDOC ## IPartExtensionFeature Interface ### Description Provides functionality to manage part extensions. ### Methods - **Register(string contentType, string extension)**: Registers a part extension for a given content type. - **TryGetExtension(string contentType, out string extension)**: Attempts to retrieve the extension for a given content type. ``` -------------------------------- ### UInt32Value Conversions Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for converting between uint and DocumentFormat.OpenXml.UInt32Value. ```APIDOC ## UInt32Value Conversions ### Description Methods for converting between uint and DocumentFormat.OpenXml.UInt32Value. ### Methods #### static UInt32Value! FromUInt32(uint value) Creates a UInt32Value from a uint. #### Implicit Operator UInt32Value!(uint value) Converts a uint to a UInt32Value. #### Implicit Operator uint(UInt32Value! value) Converts a UInt32Value to a uint. #### static uint ToUInt32(UInt32Value! value) Converts a UInt32Value to a uint. ``` -------------------------------- ### HexBinaryValue Static Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/net10.0/PublicAPI.Shipped.txt Methods for creating and writing HexBinaryValue. ```APIDOC ## HexBinaryValue Static Methods ### Description Provides static methods for working with HexBinaryValue, including creation and byte conversion. ### Methods - **Create(ReadOnlySpan bytes)**: Creates a HexBinaryValue from a byte span. - **TryWriteBytes(Span bytes)**: Attempts to write the HexBinaryValue as bytes to a span. ### Parameters - **bytes** (System.ReadOnlySpan): The read-only span of bytes to create the HexBinaryValue from. - **bytes** (System.Span): The span to write the HexBinaryValue bytes into. ### Returns - **Create**: DocumentFormat.OpenXml.HexBinaryValue: The created HexBinaryValue object. - **TryWriteBytes**: bool: True if the bytes were successfully written, false otherwise. ``` -------------------------------- ### OpenXmlPartContainer Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for managing parts within an Open XML package container. ```APIDOC ## AddNewPart ### Description Adds a new part of type T to the container. ### Parameters #### Request Body - **contentType** (string) - Required - The content type of the part. - **id** (string) - Optional - The unique identifier for the part. ### Response - **T** (object) - The newly created part. ``` -------------------------------- ### OpenXmlPackage.AddPart Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Adds a new part to an Open XML package. ```APIDOC ## AddPart ### Description Adds a part of type T to the Open XML package. ### Method Method ### Parameters #### Request Body - **part** (T) - Required - The part to be added to the package. ### Response #### Success Response - **result** (T) - The added part. ``` -------------------------------- ### UInt64Value Conversions Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for converting between ulong and DocumentFormat.OpenXml.UInt64Value. ```APIDOC ## UInt64Value Conversions ### Description Methods for converting between ulong and DocumentFormat.OpenXml.UInt64Value. ### Methods #### static UInt64Value! FromUInt64(ulong value) Creates a UInt64Value from a ulong. #### Implicit Operator UInt64Value!(ulong value) Converts a ulong to a UInt64Value. #### Implicit Operator ulong(UInt64Value! value) Converts a UInt64Value to a ulong. #### static ulong ToUInt64(UInt64Value! value) Converts a UInt64Value to a ulong. ``` -------------------------------- ### OpenXmlPartReader Methods and Properties Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on the override methods and properties for DocumentFormat.OpenXml.OpenXmlPartReader. ```APIDOC ## DocumentFormat.OpenXml.OpenXmlPartReader ### Description Provides methods and properties for reading Open XML parts. ### Methods and Properties #### Attributes.get - **Description**: Gets the collection of attributes for the current element. - **Returns**: System.Collections.ObjectModel.ReadOnlyCollection #### Close() - **Description**: Closes the OpenXmlPartReader. - **Returns**: void #### Depth.get - **Description**: Gets the current depth of the reader within the XML structure. - **Returns**: int #### ElementType.get - **Description**: Gets the Type of the current element. - **Returns**: System.Type #### Encoding.get - **Description**: Gets the encoding of the XML document. - **Returns**: string? #### EOF.get - **Description**: Gets a value indicating whether the end of the file has been reached. - **Returns**: bool #### GetLineInfo() - **Description**: Gets the line information for the current node. - **Returns**: System.Xml.IXmlLineInfo #### GetText() - **Description**: Gets the text content of the current node. - **Returns**: string #### IsEndElement.get - **Description**: Gets a value indicating whether the current node is an end element. - **Returns**: bool #### IsMiscNode.get - **Description**: Gets a value indicating whether the current node is a miscellaneous node. - **Returns**: bool #### IsStartElement.get - **Description**: Gets a value indicating whether the current node is a start element. - **Returns**: bool #### LoadCurrentElement() - **Description**: Loads the current element. - **Returns**: DocumentFormat.OpenXml.OpenXmlElement? #### LocalName.get - **Description**: Gets the local name of the current node. - **Returns**: string #### NamespaceDeclarations.get - **Description**: Gets the namespace declarations for the current node. - **Returns**: System.Collections.Generic.IEnumerable> #### NamespaceUri.get - **Description**: Gets the namespace URI of the current node. - **Returns**: string #### Prefix.get - **Description**: Gets the prefix of the current node. - **Returns**: string #### Read() - **Description**: Moves the reader to the next node. - **Returns**: bool #### ReadFirstChild() - **Description**: Moves the reader to the first child of the current node. - **Returns**: bool #### ReadNextSibling() - **Description**: Moves the reader to the next sibling of the current node. - **Returns**: bool #### Skip() - **Description**: Skips the current node and its children. - **Returns**: void #### StandaloneXml.get - **Description**: Gets a value indicating whether the XML document is standalone. - **Returns**: bool? ``` -------------------------------- ### PartRootEventExtensions Class Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides extension methods for root part events. ```APIDOC ## PartRootEventExtensions Class ### Description Contains extension methods for root part event handling. (No specific methods detailed in the provided text, this serves as a placeholder for potential extensions.) ``` -------------------------------- ### OpenXmlReader.Create Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Factory methods to create an OpenXmlReader from an OpenXmlElement or an OpenXmlPart. ```APIDOC ## static DocumentFormat.OpenXml.OpenXmlReader.Create ### Description Creates an OpenXmlReader instance to read Open XML content. ### Parameters - **openXmlElement** (OpenXmlElement) - Required - The element to read. - **openXmlPart** (OpenXmlPart) - Required - The part to read. - **readMiscNodes** (bool) - Optional - Whether to read miscellaneous nodes. - **ignoreWhitespace** (bool) - Optional - Whether to ignore whitespace nodes. ### Response - **Returns** (OpenXmlReader) - A new OpenXmlReader instance. ``` -------------------------------- ### OpenXmlUnknownElementExtensions.CreateUnknownElement Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Creates an unknown element from a given outer XML string within a container. ```APIDOC ## static DocumentFormat.OpenXml.OpenXmlUnknownElementExtensions.CreateUnknownElement ### Description Creates an OpenXmlUnknownElement from the provided outer XML string. ### Parameters - **container** (OpenXmlPartContainer) - Required - The container for the element. - **outerXml** (string) - Required - The XML string representing the element. ### Response - **Returns** (OpenXmlUnknownElement) - The created unknown element. ``` -------------------------------- ### IPartRootEventsFeature Interface Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Represents a feature for handling root part-related events. ```APIDOC ## IPartRootEventsFeature Interface ### Description Interface for features that handle root part events. (No specific methods or properties detailed in the provided text.) ``` -------------------------------- ### OpenXmlPartContainer Methods Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Details on methods for managing parts and relationships within an OpenXmlPartContainer, including adding parts, relationships, and annotations, as well as deleting relationships. ```APIDOC ## OpenXmlPartContainer Methods ### Description Provides methods for managing parts and relationships within an OpenXmlPartContainer. This includes adding new parts (extended, external, hyperlink), creating relationships, deleting relationships, and managing annotations. ### Methods - **AddAnnotation(object annotation)** - void - Adds an annotation to the container. - **AddExtendedPart(string relationshipType, string contentType, string targetExt)** - DocumentFormat.OpenXml.Packaging.ExtendedPart! - Adds a new extended part. - **AddExtendedPart(string relationshipType, string contentType, string targetExt, string rId)** - DocumentFormat.OpenXml.Packaging.ExtendedPart! - Adds a new extended part with a specified relationship ID. - **AddExternalRelationship(string relationshipType, System.Uri externalUri)** - DocumentFormat.OpenXml.Packaging.ExternalRelationship! - Adds an external relationship. - **AddExternalRelationship(string relationshipType, System.Uri externalUri, string id)** - DocumentFormat.OpenXml.Packaging.ExternalRelationship! - Adds an external relationship with a specified ID. - **AddHyperlinkRelationship(System.Uri hyperlinkUri, bool isExternal)** - DocumentFormat.OpenXml.Packaging.HyperlinkRelationship! - Adds a hyperlink relationship. - **AddHyperlinkRelationship(System.Uri hyperlinkUri, bool isExternal, string id)** - DocumentFormat.OpenXml.Packaging.HyperlinkRelationship! - Adds a hyperlink relationship with a specified ID. - **AddNewPart()** - T! - Adds a new part of the specified type. - **AddNewPart(string id)** - T! - Adds a new part of the specified type with a specified ID. - **Annotation(System.Type type)** - object? - Gets an annotation of the specified type. - **Annotation()** - T? - Gets an annotation of the specified generic type. - **Annotations(System.Type type)** - System.Collections.Generic.IEnumerable! - Gets all annotations of the specified type. - **Annotations()** - System.Collections.Generic.IEnumerable! - Gets all annotations of the specified generic type. - **ChangeIdOfPart(DocumentFormat.OpenXml.Packaging.OpenXmlPart part, string newRelationshipId)** - string! - Changes the relationship ID of a part. - **CreateRelationshipToPart(DocumentFormat.OpenXml.Packaging.OpenXmlPart targetPart)** - string! - Creates a relationship to the target part. - **CreateRelationshipToPart(DocumentFormat.OpenXml.Packaging.OpenXmlPart targetPart, string id)** - string! - Creates a relationship to the target part with a specified ID. - **DeleteExternalRelationship(DocumentFormat.OpenXml.Packaging.ExternalRelationship externalRelationship)** - void - Deletes the specified external relationship. - **DeleteExternalRelationship(string id)** - void - Deletes the external relationship with the specified ID. ### Properties - **DataPartReferenceRelationships** (System.Collections.Generic.IEnumerable) - Gets the data part reference relationships. ``` -------------------------------- ### Manipulate OpenXmlPart with XLinq Source: https://github.com/dotnet/open-xml-sdk/blob/main/docs/Features.md Uses IPartRootXElementFeature to set the root element of an OpenXmlPart using XElement. ```csharp OpenXmlPart part = GetSomePart(); var node = new(W.document, new XAttribute(XNamespace.Xmlns + "w", W.w), new XElement(W.body, new XElement(W.p, new XElement(W.r, new XElement(W.t, "Hello World!"))))); part.SetXElement(node); ``` -------------------------------- ### Flat OPC Conversion Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods to convert Open XML packages to Flat OPC format. ```APIDOC ## ToFlatOpcDocument / ToFlatOpcString ### Description Converts an OpenXmlPackage into an XDocument or a string representation in Flat OPC format. ### Method Static Extension Method ### Parameters - **openXmlPackage** (OpenXmlPackage) - Required - The package to convert. ### Response - **XDocument/string** - The Flat OPC representation of the package. ``` -------------------------------- ### OpenXmlElementComparers.Create Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Creates an equality comparer for OpenXmlElement based on specified equality options. ```APIDOC ## static DocumentFormat.OpenXml.OpenXmlElementComparers.Create ### Description Creates an IEqualityComparer for OpenXmlElement based on the provided OpenXmlElementEqualityOptions. ### Parameters - **openXmlElementEqualityOptions** (OpenXmlElementEqualityOptions) - Required - The options defining how elements should be compared. ### Response - **Returns** (IEqualityComparer) - An equality comparer instance. ``` -------------------------------- ### OpenXmlPartContainer - Part and Relationship Utilities Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Utility methods for obtaining IDs of parts and managing annotations. ```APIDOC ## GET /api/parts/{part}/id ### Description Retrieves the unique identifier (ID) of a given part within the OpenXmlPartContainer. ### Method GET ### Endpoint /api/parts/{part}/id ### Parameters #### Path Parameters - **part** (DocumentFormat.OpenXml.Packaging.OpenXmlPart!) - The part for which to get the ID. ### Response #### Success Response (200) - **string!** - The unique identifier of the part. ### Response Example ```json { "partId": "rId1" } ``` ## POST /api/annotations/remove ### Description Removes all annotations of a specified type from the OpenXmlPartContainer. ### Method POST ### Endpoint /api/annotations/remove ### Parameters #### Request Body - **type** (System.Type!) - The type of annotations to remove. ### Response #### Success Response (200) - **void** - This operation does not return a value. ### Request Example ```json { "type": "System.Type.SpecificAnnotationType" } ``` ## POST /api/annotations/remove-generic ### Description Removes all annotations of a generic type T from the OpenXmlPartContainer. ### Method POST ### Endpoint /api/annotations/remove-generic ### Parameters #### Request Body - **T** (System.Type) - The generic type T for which to remove annotations. ### Response #### Success Response (200) - **void** - This operation does not return a value. ### Request Example ```json { "T": "System.Type.GenericAnnotationType" } ``` ``` -------------------------------- ### OpenXmlPartContainer - Relationship Management Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for managing reference and hyperlink relationships within an OpenXmlPartContainer. ```APIDOC ## DELETE /api/relationships/reference ### Description Deletes a reference relationship from the OpenXmlPartContainer. ### Method DELETE ### Endpoint /api/relationships/reference ### Parameters #### Request Body - **referenceRelationship** (DocumentFormat.OpenXml.Packaging.ReferenceRelationship!) - The reference relationship to delete. ### Response #### Success Response (200) - **bool** (bool) - True if the relationship was successfully deleted, false otherwise. ### Request Example ```json { "referenceRelationship": "{reference_relationship_object_representation}" } ``` ### Response Example ```json { "success": true } ``` ## DELETE /api/relationships/reference/{id} ### Description Deletes a reference relationship from the OpenXmlPartContainer using its unique identifier. ### Method DELETE ### Endpoint /api/relationships/reference/{id} ### Parameters #### Path Parameters - **id** (string!) - The unique identifier of the reference relationship to delete. ### Response #### Success Response (200) - **bool** (bool) - True if the relationship was successfully deleted, false otherwise. ### Response Example ```json { "success": true } ``` ## GET /api/relationships/external ### Description Retrieves all external relationships associated with the OpenXmlPartContainer. ### Method GET ### Endpoint /api/relationships/external ### Response #### Success Response (200) - **System.Collections.Generic.IEnumerable** - An enumerable collection of external relationships. ### Response Example ```json { "externalRelationships": [ { "id": "ext_rel_1", "targetUri": "http://example.com/resource1", "relationshipType": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink" } ] } ``` ## GET /api/relationships/external/{id} ### Description Retrieves a specific external relationship from the OpenXmlPartContainer using its unique identifier. ### Method GET ### Endpoint /api/relationships/external/{id} ### Parameters #### Path Parameters - **id** (string!) - The unique identifier of the external relationship to retrieve. ### Response #### Success Response (200) - **DocumentFormat.OpenXml.Packaging.ExternalRelationship!** - The retrieved external relationship. ### Response Example ```json { "id": "ext_rel_1", "targetUri": "http://example.com/resource1", "relationshipType": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink" } ``` ## GET /api/relationships/hyperlink ### Description Retrieves all hyperlink relationships associated with the OpenXmlPartContainer. ### Method GET ### Endpoint /api/relationships/hyperlink ### Response #### Success Response (200) - **System.Collections.Generic.IEnumerable** - An enumerable collection of hyperlink relationships. ### Response Example ```json { "hyperlinkRelationships": [ { "id": "hyper_rel_1", "targetUri": "http://example.com/page1" } ] } ``` ## GET /api/relationships/reference/{id} ### Description Retrieves a specific reference relationship from the OpenXmlPartContainer using its unique identifier. ### Method GET ### Endpoint /api/relationships/reference/{id} ### Parameters #### Path Parameters - **id** (string!) - The unique identifier of the reference relationship to retrieve. ### Response #### Success Response (200) - **DocumentFormat.OpenXml.Packaging.ReferenceRelationship!** - The retrieved reference relationship. ### Response Example ```json { "id": "ref_rel_1", "targetUri": "/parts/part1.xml", "relationshipType": "http://example.com/relationship/type" } ``` ``` -------------------------------- ### Feature Management Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Classes and enums related to event handling and feature collections within the SDK. ```APIDOC ## Feature Management ### Description Provides structures for tracking element events and managing feature collections. ### EventType Enum - **None** (0) - **Closed** (1) - **Closing** (2) - **Deleting** (3) - **Deleted** (4) - **Creating** (5) - **Created** (6) - **Removing** (7) - **Removed** (8) - **Reloading** (9) - **Reloaded** (10) - **Saved** (11) - **Saving** (12) - **Adding** (13) - **Added** (14) ### ElementEventArgs - **Element** (OpenXmlElement) - The element involved in the event. - **ParentElement** (OpenXmlElement) - The parent of the element involved. ``` -------------------------------- ### OpenXmlPackage Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Represents an Open XML package (document). ```APIDOC ## DocumentFormat.OpenXml.Packaging.OpenXmlPackage ### Description Represents an Open XML package (document). ### Properties - **AutoSave** (bool) - Gets a value indicating whether auto-save is enabled. - **CanSave** (bool) - Gets a value indicating whether the package can be saved. - **CompressionOption** (System.IO.Packaging.CompressionOption) - Gets or sets the compression option for the package. - **DataParts** (System.Collections.Generic.IEnumerable) - Gets an enumerable collection of data parts in the package. ### Methods - **CreateMediaDataPart**(DocumentFormat.OpenXml.Packaging.MediaDataPartType mediaDataPartType) - Creates a new MediaDataPart with the specified type. - **CreateMediaDataPart**(string contentType) - Creates a new MediaDataPart with the specified content type. - **CreateMediaDataPart**(string contentType, string extension) - Creates a new MediaDataPart with the specified content type and extension. - **DeletePart**(DocumentFormat.OpenXml.Packaging.DataPart dataPart) - Deletes the specified data part. - **DeletePartsRecursivelyOfType**() - Deletes all parts of the specified type recursively. - **Dispose**() - Releases all resources used by the OpenXmlPackage. ``` -------------------------------- ### Define SVG addition method in C# Source: https://github.com/dotnet/open-xml-sdk/blob/main/samples/SVGExample/README.md This method signature serves as the entry point for adding SVG content to a document. Ensure a PNG copy is generated for Office compatibility. ```csharp public static void AddSvg(string docPath, string svgPath) ``` -------------------------------- ### UInt16Value Conversions Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for converting between ushort and DocumentFormat.OpenXml.UInt16Value. ```APIDOC ## UInt16Value Conversions ### Description Methods for converting between ushort and DocumentFormat.OpenXml.UInt16Value. ### Methods #### static UInt16Value! FromUInt16(ushort value) Creates a UInt16Value from a ushort. #### Implicit Operator UInt16Value!(ushort value) Converts a ushort to a UInt16Value. #### Implicit Operator ushort(UInt16Value! value) Converts a UInt16Value to a ushort. #### static ushort ToUInt16(UInt16Value! value) Converts a UInt16Value to a ushort. ``` -------------------------------- ### IPartEventsFeature Interface Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Represents a feature for handling part-related events. ```APIDOC ## IPartEventsFeature Interface ### Description Interface for features that handle part events. (No specific methods or properties detailed in the provided text.) ``` -------------------------------- ### Feature Management Extensions Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Methods for managing features within the Open XML SDK, including disposable features and event registration. ```APIDOC ## Feature Management ### Description Methods to register disposable features and add event features to OpenXml packages and containers. ### Methods - **DisposableFeatureExtensions.Register**: Registers an IDisposable object with an IDisposableFeature. - **PackageEventExtensions.AddPackageEventsFeature**: Adds package events to an OpenXmlPackage. - **PartEventFeatureExtensions.AddPartEventsFeature**: Adds part events to an OpenXmlPackage. - **PartRootEventExtensions.AddPartRootEventsFeature**: Adds part root events to an OpenXmlPartContainer. ``` -------------------------------- ### OpenXmlPartReader API Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Provides methods for reading Open XML parts with various configuration options. ```APIDOC ## OpenXmlPartReader ### Description Initializes a new instance of the OpenXmlPartReader class to read Open XML parts. ### Constructors - OpenXmlPartReader(OpenXmlPart openXmlPart) - OpenXmlPartReader(OpenXmlPart openXmlPart, bool readMiscNodes) - OpenXmlPartReader(OpenXmlPart openXmlPart, bool readMiscNodes, bool ignoreWhitespace) - OpenXmlPartReader(OpenXmlPart openXmlPart, OpenXmlPartReaderOptions options) - OpenXmlPartReader(Stream partStream, IFeatureCollection features, OpenXmlPartReaderOptions options) ``` -------------------------------- ### MarkupCompatibilityAttributes Source: https://github.com/dotnet/open-xml-sdk/blob/main/src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt Manages markup compatibility attributes for Open XML documents. ```APIDOC ## MarkupCompatibilityAttributes ### Description Manages markup compatibility attributes such as Ignorable, MustUnderstand, PreserveAttributes, PreserveElements, and ProcessContent. ### Properties - **Ignorable** (StringValue?) - Gets or sets the Ignorable attribute. - **MustUnderstand** (StringValue?) - Gets or sets the MustUnderstand attribute. - **PreserveAttributes** (StringValue?) - Gets or sets the PreserveAttributes attribute. - **PreserveElements** (StringValue?) - Gets or sets the PreserveElements attribute. - **ProcessContent** (StringValue?) - Gets or sets the ProcessContent attribute. ```