혹시 XML DTD 쪽에 잘 아시는분 ㅠㅠ

DTD 에서 <!ELEMENT rec ANY>

설정하고

XML 에서 <rec>Hi Cathy. <span class="red"><b>Can I take a message?</b></span></rec>

넣었는데요

xsl 에서 <xsl:value-of select="rec" />

이렇게 해서 크롬에서 보면 테그가 안먹히고 들어 옵니다.
크롬에서 요소검사해서 보면 다음과 같이 큰따온표가 싸여서 문자열로 출려되네요
"Hi Cathy. Can I take a message?"

태그는 다 제거 되서 나오네요 에휴~~~~~~! 테그가 꼭 들어 가야는데 방법 없을까요?

오늘 파견 나간데서 오후 내내 이것만 붙잡고 있었습니다. ㅠㅠ 그 시간에 코딩을 했음 2-3페이지는

나갔을 텐데 ㅠㅠ

|

댓글 2개

rec><![CDATA[Hi Cathy. <span class="red"><b>Can I take a message?</b></span>]]></rec>
<xsl:value-of select="rec" disable-output-escaping="yes" />
출력만을 위한다면 위 처럼 하시면 될듯 하고요
span,b를 구조적으로 봐서
xsl template 로 처리하면

test.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<root>
<rec>Hi Cathy. <span class="red"><b>Can I take a message?</b></span></rec>
</root>

test.xsl
<?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="no" />
<xsl:template match="//b">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="//span[@class]">
<span>
<xsl:attribute name="class">
<xsl:value-of select="@class"/>
</xsl:attribute>
<xsl:apply-templates/>
</span>
</xsl:template>
</xsl:stylesheet>

방법은 여러가지일듯..
날림코드라 퍼포먼스 체크 그런거 없음 그냥 참고만 하시길...
오홀 감사합니다. 내일 해봐야지 ㅠㅠ 정말 감사 http://neouser.tistory.com/172
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

+
제목 글쓴이 날짜 조회
12년 전 조회 2,681
12년 전 조회 1,195
12년 전 조회 1,247
12년 전 조회 1,648
12년 전 조회 1,156
12년 전 조회 1,830
12년 전 조회 1,451
12년 전 조회 1,389
12년 전 조회 1,184
12년 전 조회 1,149
12년 전 조회 1,201
12년 전 조회 1,161
12년 전 조회 1,167
12년 전 조회 1,154
12년 전 조회 1,150
12년 전 조회 1,039
12년 전 조회 1,999
12년 전 조회 1,497
12년 전 조회 1,109
12년 전 조회 1,178
12년 전 조회 3,039
12년 전 조회 1,335
12년 전 조회 1,040
12년 전 조회 1,212
12년 전 조회 1,255
12년 전 조회 1,798
12년 전 조회 1,533
12년 전 조회 1,536
12년 전 조회 1,722
12년 전 조회 2,797