Overview : 예를 들어, 문자열 "Hello, XSLT World!"
에서 8번째 문자부터 4개의 문자를 추출하면 "XSLT"
가 됩니다.
substring() 함수 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html> <body> <h2>substring() 함수 예제</h2> <!-- 원본 문자열 변수 --> <xsl:variable name="text" select="'Hello, XSLT World!'"/> <!-- 8번째 문자부터 4개의 문자를 추출 --> <p>추출된 문자열: <xsl:value-of select="substring($text, 8, 4)"/></p> </body> </html> </xsl:template> </xsl:stylesheet> |
8번째 문자부터 4개의 문자를 추출 -> XSLT