• Normally attributes that are parsed by SQLDOM are stored in the table #tblDOMAttributes (which can be joined to table #tblDOM via the DEID column).

    In HTML 4, "selected" is really supposed to be attributes like this:

    <option selected="selected">My Option</option>

    SQLDOM has not support parsing out attributes that are not in the form of "name=value". Consequently, SQLDOM has not parsed out the selected attribute in someting like:

    <option selected>My Option</option>

    Back in the old days (HTML 2, and possibly HTML 3.2), "selected" with no value was allowed.

    Based on your request I modified SQLDOM and posted an updated version (.924) that parses out these old-fashioned quasi-attributes with no values. Please download version .924 from: https://sourceforge.net/projects/sqldom/files/

    Once you parse your HTML with version .924 you will be able to retrieve the selected options with something like this:

    EXEC #spactDOMLoad @HTML = '<html><body>Hello World.<option selected>Try this</option></body></html>'

    SELECT

    dom.Tag,

    dom.ID,

    txt.TextData,

    attr.Name,

    attr.Value

    FROM

    #tblDOM dom

    LEFT JOIN #tblDOM txt ON

    dom.DEID = txt.ParentDEID AND

    txt.TextData IS NOT NULL

    LEFT JOIN #tblDOMAttribs attr ON

    dom.DEID = attr.DEID