powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / xml-(xslt)->xml
3 сообщений из 3, страница 1 из 1
xml-(xslt)->xml
    #33603237
Фотография Критик
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
День добрый, есть ли встроенное усечение строк, отличное от приведенного ниже?
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
	<msxsl:script language="C#" implements-prefix="user">
		<![CDATA[
				public string trim(string s)
				{
					return s.Trim();
				}
		]]>
	</msxsl:script>
...
				<xsl:value-of select="user:trim(HEADER/@IDFILE)" />
...
Рейтинг: 0 / 0
xml-(xslt)->xml
    #33604362
qu-qu
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
КритикДень добрый, есть ли встроенное усечение строк, отличное от приведенного ниже?....

Код: plaintext
1.
2.
....normalize-space("  abc    def  ") 
<!-- Returns the argument string with the leading, trailing, and repeating white spaces stripped -->
MSDN
Example
The following example normalizes a block of text string with unnormalized white spaces (tabs, leading and trailing spaces, and multiple spaces between words. The text string is the value of an <text> element.

XML File (normSpace.xml)

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"
href="normalizeSpace.xsl"?>
<text>
This is a
test, with a lot of
irregular spacing and
waiting to be normalizaed.


</text>
XSLT File (normSpace.xsl)

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"
omit-xml-declaration="yes"/>

<xsl:template match="/text">
Unnormalized:
"<xsl:value-of select='.'/>"
Normalized: "<xsl:value-of select='normalize-space()'/>"
</xsl:template>

</xsl:stylesheet>
This XSLT produces the following output:

Unormalized:
"
This is a
test, with a lot of
irregular spacing and
waiting to be normalizaed.


"
Normalized:
"This is a test, with a lot of irregular spacing and waiting to be normalized."
...
Рейтинг: 0 / 0
xml-(xslt)->xml
    #33604548
Фотография Критик
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
спасибо
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / xml-(xslt)->xml
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]