Filtering xhtml tags

Hi,

I’ve been using the sql query posted in SQL query to export Policy scan results with Remediation, Rationale and Proof - #2 by zyoutz.

SELECT da.host_name, da.ip_address, dp.policy_id, dp.title as policy_title, dpr.rule_id, dpr.title as rule_name, dpr.description, fapr.date_tested, htmlToText(fapr.proof) as proof, fapr.compliance, htmlToText(dpr.rationale) as rationale, htmlToText(dpr.remediation) as remediation
FROM fact_asset_policy_rule fapr
JOIN dim_policy dp on dp.policy_id = fapr.policy_id
JOIN dim_policy_rule dpr on dpr.policy_id = fapr.policy_id and fapr.rule_id = dpr.rule_id
JOIN dim_asset da on da.asset_id = fapr.asset_id

The method htmlToText was used to filter out the html tags from the policy compliance proof field. However this method doesnt seem to work on the policy compliance rationale or remediation fields. Probably because those fields contain xhtml.

Is there a simple method to filter the xhtml tags?

2021-04-08 10_21_14-Window

Hi Cwings,

This Query was initially asked by me from the community here and for long i have been trying different solution to get rid of unnecessary data and finally after ton research and time I finally modified the query which I will post on the original post and will tag you there so that you are notified.

I hope you will mark the post with solution thank you.

Manny

1 Like

Yes, I saw the post on SQL query to export Policy scan results with Remediation, Rationale and Proof - #16 by brian_w_gray.

That query works perfectly. Thank you.