Входной XML:XSLT - Извлечение и манипулировать часть данных XML
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Description><![CDATA[Audience: Andrew Reed, Senior Training Specialist, Microsoft Corporation<br/>This session is for individuals who spend significant time writing and creating documents and have some familiarity with Microsoft Word.<br/>Thanks.]]></Description>
</root>
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/root">
<div>
<xsl:value-of disable-output-escaping="yes" select="Description"/>
</div>
</xsl:template>
</xsl:stylesheet>
Мне нужно добавить еще пару тегов БР после первого появления БР, это после строки Аудитории и перед тем, как начнется другое описание. Можете ли вы изменить мой XSLT, чтобы получить желаемый результат?
Так что я хочу вывода, как показано ниже:
Audience: Andrew Reed, Senior Training Specialist, Microsoft Corporation
This session is for individuals who spend significant time writing and creating documents and have some familiarity with Microsoft Word.
Thanks.
«Мне нужно добавить еще несколько тегов BR» - но выведенный образец не содержит никаких тегов BR. Вы хотите, чтобы вы преобразовали каждый элемент '
' в три возврата каретки? – LarsH