HtmlNodeChildren
Returns a table containing child nodes of an HTML Node
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT *
FROM SQLHTTP.net.HtmlNodeChildren ( @HtmlNode )
Name | Type | Description |
---|---|---|
@HtmlNode | nvarchar(MAX) | String containing an HTML node |
Column name | Data type | Description |
---|---|---|
RowID | int | Node Index |
HTMLNode | nvarchar(MAX) | Node Content |
Note that line breaks are presented as separate nodes
1 2 3 4 5 6 7 8 9 10 |
DECLARE @HtmlNode nvarchar(MAX) SET @HtmlNode = '<div> <img src="image.png" alt="Logo"> <span>Sample Text</span> </div>' SELECT * FROM SQLHTTP.net.HtmlNodeChildren(@HtmlNode) |
1 2 3 4 5 6 7 8 9 |
RowID HTMLNode ----------- ------------------------------------------------ 1 2 <img src="image.png" alt="Logo"> 3 4 <span>Sample Text</span> 5 |