Aspose::Words::Loading::HtmlLoadOptions::get_PreferredControlType method
Contents
[
Hide
]HtmlLoadOptions::get_PreferredControlType method
Gets or sets preferred type of document nodes that will represent imported and
Aspose::Words::Loading::HtmlControlType Aspose::Words::Loading::HtmlLoadOptions::get_PreferredControlType() const
Remarks
Please note that setting this property does not guarantee that all imported controls will be of the specified type. If an HTML control is not representable with document nodes of the preferred type, Aspose.Words will use a compatible HtmlControlType for that control.
Examples
Shows how to set preferred type of document nodes that will represent imported and
const System::String html = u"\r\n <html>\r\n <select name='ComboBox' size='1'>\r\n <option value='val1'>item1</option>\r\n <option value='val2'></option>\r\n </select>\r\n </html>\r\n ";
auto htmlLoadOptions = System::MakeObject<Aspose::Words::Loading::HtmlLoadOptions>();
htmlLoadOptions->set_PreferredControlType(HtmlControlType::StructuredDocumentTag);
auto doc = System::MakeObject<Aspose::Words::Document>(System::MakeObject<System::IO::MemoryStream>(System::Text::Encoding::get_UTF8()->GetBytes(html)), htmlLoadOptions);
System::SharedPtr<Aspose::Words::NodeCollection> nodes = doc->GetChildNodes(NodeType::StructuredDocumentTag, true);
auto tag = System::ExplicitCast<Aspose::Words::Markup::StructuredDocumentTag>(nodes->idx_get(0));
See Also
- Class HtmlLoadOptions
- Namespace Aspose::Words::Loading
- Library Aspose.Words for C++