xml 使用mvt:// wip剥离html

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml 使用mvt:// wip剥离html相关的知识,希望对你有一定的参考价值。

<mvt:assign name="l.stripped_descrip" value="l.settings:product:descrip" />
		<mvt:if expr="('<' IN l.stripped_descrip) AND ('>' IN l.stripped_descrip)">
			<mvt:assign name="l.tag_out" value="''" />
			<mvt:assign name="l.pos" value="1" />
			<mvt:while expr="l.pos LE len(l.stripped_descrip)">
				<mvt:if expr="substring(l.stripped_descrip,l.pos,1) EQ '<'">
					<mvt:while expr="l.pos LE len(l.stripped_descrip)">
						<mvt:if expr="substring(l.stripped_descrip,l.pos,1) EQ '>'">
							<mvt:whilestop />
						</mvt:if>
						<mvt:assign name="l.pos" value="l.pos + 1" />
					</mvt:while>
				<mvt:else>
					<mvt:assign name="l.tag_out" value="l.tag_out $ substring(l.stripped_descrip,l.pos,1)" />
				</mvt:if>
				<mvt:assign name="l.pos" value="l.pos + 1" />
			</mvt:while>
			<mvt:assign name="l.stripped_descrip" value="l.tag_out"/>
			<mvt:if expr="('<' IN l.stripped_descrip) OR ('>' IN l.stripped_descrip)">
				<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip,'<','')" />
				<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip,'>','')" />
			</mvt:if>
		<mvt:else>
			<mvt:if expr="('<' IN l.stripped_descrip) OR ('>' IN l.stripped_descrip)">
				<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip,'<','')" />
				<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip,'>','')" />
			</mvt:if>
		</mvt:if>
		<mvt:assign name="l.stripped_descrip" value="ltrim(l.stripped_descrip )" />
		<mvt:assign name="l.stripped_descrip" value="rtrim( l.stripped_descrip )" />
		<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip, asciichar(10), '')" />
		<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip, asciichar(13), '')" />
		<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip, asciichar(09), '')" />
		<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip, asciichar(32) $ asciichar(32) $ asciichar(32), ' ')" />
		<mvt:assign name="l.stripped_descrip" value="glosub(l.stripped_descrip, asciichar(32) $ asciichar(32), ' ')" />
		<mvt:assign name="l.settings:stripped_descrip" value="substring_var(l.stripped_descrip, 1, 160)" />
		<meta name="description" content="&mvt:stripped_descrip;" />

以上是关于xml 使用mvt:// wip剥离html的主要内容,如果未能解决你的问题,请参考以下文章

xml Miva - 使用mvt:do生成RMA

xml mvt:assign&mvt:eval示例

xml MVT:电话

xml MVT:电话

xml MVT:DO

xml MVT:DO