Enum HtmlControlType

Enum HtmlControlType

Namespace: Aspose.Words.Loading
Assembly: Aspose.Words.dll (25.12.0)

Type of document nodes that represent <input> and <select> elements imported from HTML.

public enum HtmlControlType

Fields

FormField = 0

A form field.

StructuredDocumentTag = 1

A structured document tag

Examples

Shows how to set preferred type of document nodes that will represent imported <input> and <select> elements.

const string html = @"
                                                                                                                                        &lt;html&gt;
                                                                                                                                            &lt;select name='ComboBox' size='1'&gt;
                                                                                                                                                &lt;option value='val1'&gt;item1&lt;/option&gt;
                                                                                                                                                &lt;option value='val2'&gt;&lt;/option&gt;
                                                                                                                                            &lt;/select&gt;
                                                                                                                                        &lt;/html&gt;
                                                                                                                                    ";

                                                                                                                                    HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
                                                                                                                                    htmlLoadOptions.PreferredControlType = HtmlControlType.StructuredDocumentTag;

                                                                                                                                    Document doc = new Document(new MemoryStream(Encoding.UTF8.GetBytes(html)), htmlLoadOptions);
                                                                                                                                    NodeCollection nodes = doc.GetChildNodes(NodeType.StructuredDocumentTag, true);

                                                                                                                                    StructuredDocumentTag tag = (StructuredDocumentTag) nodes[0];
 English