0
A
답변
1
것처럼 아래에 입력 XML : XSL을 사용하여
다음<Order OrderNo="T122345">
<Customer FirstName="John" LastName="Doe" MobileNo="123456789"/>
<OrderDates>
<OrderDate Type="PickDate" Name="PickUpdateDate" Value="2017-11-10 10:00:00" />
</OrderDates>
</Order>
아래와 같이 :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<!--prepare message formatted template as below-->
<xsl:template name="message">
<xsl:param name="client.firstname"/>
<xsl:param name="client.lastname"/>
<xsl:param name="client.order.no"/>
<xsl:param name="client.pickup.date"/>
<xsl:param name="client.mobile.no"/>
<xsl:variable name="var.h" select="concat('
', 'hi ', $client.firstname, ' ', $client.lastname, ',', '
', '', '
')"/>
<xsl:variable name="var.b.str1" select="concat('Thanks for your order # is ', $client.order.no, '.', '
')"/>
<xsl:variable name="var.b.str2" select="concat('We will send you updates on pick up by ', $client.pickup.date, ' on your mobile # ', $client.mobile.no, '.', '
')"/>
<xsl:variable name="var.s" select="concat('', '
', 'Regards', '
', 'Team', '
')"/>
<Message>
<xsl:value-of select="concat($var.h, $var.b.str1, $var.b.str2, $var.s)"/>
</Message>
</xsl:template>
<!--run you formatted message template by call-template function-->
<xsl:template match="/Order">
<xsl:call-template name="message">
<xsl:with-param name="client.firstname" select="./Customer/@FirstName" />
<xsl:with-param name="client.lastname" select="./Customer/@LastName" />
<xsl:with-param name="client.order.no" select="./@OrderNo" />
<xsl:with-param name="client.pickup.date" select="./OrderDates/OrderDate[@Type = 'PickDate' and @Name = 'PickUpdateDate']/@Value" />
<!--below you can pass city code as below for mobile no-->
<xsl:with-param name="client.mobile.no" select="concat('91-', ./Customer/@MobileNo)" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
당신은 예상 된 결과 달성 :
<?xml version="1.0" encoding="UTF-8"?>
<Message>
hi John Doe,
Thanks for your order # is T122345.
We will send you updates on pick up by 2017-11-10 10:00:00 on your mobile # 91-123456789.
Regards
Team
</Message>
을
관련 문제
- 1. 자리 표시자를 PHP 문자열로 동적 데이터로 바꿉니다
- 2. 자리 표시자를 동적 내용이있는 문자열로 바꿉니다.
- 3. 셸을 사용하여 변수를로드하여 자리 표시자를 바꿉니다.
- 4. 텍스트 자리 표시자를 정규 표현식으로 바꿉니다.
- 5. 텍스트 파일에 저장된 문자열의 자리 표시자를 변수로 바꿉니다.
- 6. C# 자리 표시자를 사용하여 텍스트 파일을 실행하고 자리 표시자를 사용자 입력으로 바꿉니다.
- 7. bash를 사용하여 .conf 파일의 단일 자리 표시자를 바꿉니다
- 8. Chrome의 맞춤 텍스트로 기본 html5 날짜 자리 표시자를 바꿉니다.
- 9. 자리 표시자를 컨트롤러에서 수정해야합니까?
- 10. 자리 표시자를 추가하는 방법?
- 11. 자리 표시자를 SED로 바꾸기
- 12. jQuery에서 자리 표시자를 사용하는 방법?
- 13. wordpress에서 자리 표시자를 사용하는 방법
- 14. 자리 표시자를 word라는 이미지로 바꾸시겠습니까?
- 15. 동영상 자리 표시자를 삭제하는 방법?
- 16. Eclipse는 자리 표시자를 자동 완성합니까?
- 17. 자리 표시자를 사용하여 파일 제거
- 18. tensorflow 동적으로 자리 표시자를 만듭니다.
- 19. 텍스트에서 자리 표시자를 얻는 방법?
- 20. 자리 표시자를 식별하는 정규 표현식
- 21. 동적 자리 표시자를 사용하여 전체 페이지 캐시를 구현하는 수단
- 22. Sitecore에서 동적 자리 표시자를 사용하는 많은 자리 표시 자 설정을 업데이트하는 방법
- 23. 속성 자리 표시자를 설정하기 전에 SystemPropertyInitializer를 사용하여 속성 자리 표시자를 설정하기 전에
- 24. 자리 표시자를 해결할 수 없습니다. | 스프링 자리 표시 자
- 25. tinymce textarea에서 자리 표시자를 사용하는 방법
- 26. UITableView 행에 자리 표시자를 설정하는 방법은 무엇입니까?
- 27. 자리 표시자를 사라지게하고 커서를 앞에 위치 시키십시오.
- 28. 준비된 명령문 자리 표시자를 작은 따옴표로 묶음
- 29. 플러그인 내 자리 표시자를 사용하는 ZF
- 30. 자리 표시자를 chnaging하지 않고 이미지 크기를 변경하십시오.