We have a field that contains HTML markup for formatting on a website, but we need to request only the text that should be displayed on the screen, and not such things as CSS tags, tag names, property names, etc.
Is there a way to ignore markup in an SQL query or stored procedure? If there are ways to do this, will we have performance problems later?
I assume there is some way to use angle brackets to parse searchable text fields.
, :
http://blog.sqlauthority.com/2007/06/16/sql-server-udf-user-defined-function-to-strip-html-parse-html-no-regular-expression/
. , .
@Nissan: HTML IMO. , . , , (, ) unencoded < . , , HTML.
<
, img elements 'ALT. title s. , " , ". .
img
ALT
title
, HTML , , . DOM - , BeautifulSoup HTML - nodeValue .
nodeValue
, , OP - , , . , HTML, HTML , .
; , .
:
. UDF . , ( ), .
. HTML - . , 95% UDF, 100%.
. - HTML- , # , , .
...
, , :
.
, , HTML , .
, , , , .
, HTML- , : http://www.regular-expressions.info/examples.html
, html:
WHERE dbo.anyRemoveHtml(yourColumn)='your search text'
the index will not be used and you are scanning the table. this may not be a problem when the application has little data, but will result in a slower and slower SELECT, since more data is added to the table.
note: dbo.anyRemoveHtml is just a compiled name representing the function that you choose to remove HTML and doesn’t actually exist
Source: https://habr.com/ru/post/1732394/More articles:Сообщения об ошибках Pear с PHP5.3.0 - phpHow to detect memory leaks in Flash? - flexCapturing asp.net controls in javascript - javascriptMySQL Optimization - databaseSpring singleton beans in different application contexts - javaStrange exceptions in the .Net CF framework format for WinCE 6.0 R3 - .netUse numbers in mobile web form - htmlRails: Как использовать переменную javascript вне, но внутри представления? - javascriptProblems with TSQL IN expression - sqliPad - resizing modal UIViewController - model-view-controllerAll Articles