【发布时间】:2018-09-06 05:41:58
【问题描述】:
我正在使用 xsl 将 xml 转换为 xml。你能帮我写个xsl代码来把输入转换成输出吗?
给定输入:
<ATTRIBUTE-VALUE>
<THE-VALUE>
<div xmlns="http://www.w3.org/1999/xhtml">
<h1 dir="ltr" id="_1536217498885">Main Description</h1>
<p>The main description text goes here.</p>
<h1 dir="ltr" id="_1536217498886">Key Consideration</h1>
<p>The key consideration text goes here.</p>
<h1 dir="ltr" id="_1536217498887">Skills</h1>
<p>The Skills text goes here.</p>
<h1 dir="ltr" id="_1536217498888">Synonyms</h1>
<p>The Synonyms text goes here.</p>
</div>
</THE-VALUE>
</ATTRIBUTE-VALUE>
预期输出:
<MainDescription><![CDATA[The main description text goes here.]]></MainDescription>
<KeyConsiderations><![CDATA[The key consideration text goes here.]]></KeyConsiderations>
<Skills>The skills text goes here.</Skills>
<Synonyms>The synonyms text goes here.</Synonyms>
【问题讨论】:
-
我对 xslt 很陌生。谁能提供 xslt-1.0 的解决方案?
标签: xml xslt xslt-2.0 xslt-grouping xslt-3.0