Removing Tag Attributes from HTML - Classic ASP

When parsing a string of HTML to enterrogate for data, sometimes the HTML attributes would create unneeded headaches. I wrote this function to take a string of HTML and remove all tag attributes.

' * ==================================================================================================

Function ClearTagAttributes(sHTML,sTagType)
	
	' ---- Removes all attributes from specified
	'		tags
	Dim iStart, sFront, sBack, aTempArray, i, iNumRows
	
	aTempArray = split(sHTML,"<" & sTagType,-1,1)
	
	iNumRows = uBound(aTempArray)
	If iNumRows > 1 Then
		For i = 0 To iNumRows
			iStart = instr(1,aTempArray(i),">",1)
			sBack = Right(aTempArray(i),len(aTempArray(i)) - iStart)
			aTempArray(i) = ">" & sBack
		Next
	End If	
	sHTML = Join(aTempArray,"<" & sTagType)
	ClearTagAttributes = sHTML
	
End Function
keywords: 

AuthorInfo

Joe is a User Experience Engineer, Front End Specialist and Application Developer for Bridgeway Software, Inc and part-time consultant for NGO and non-profit organizations in the Houston area. Joe is also a part-time Portrait Photographer at MEDIA.24Moves.com and organizer of the HoustonPhotowalks.com photography club. He and his wife Marty run the AutismHouston.com Support and Playdate group.

-

@ext237

-

@drupaltips

-

Flickr

-

LinkedIn

-

Ports

-

Contact


Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /home/content/e/x/t/ext237/html/modules/ctools/includes/css-cache.inc on line 52