혹시 XML DTD 쪽에 잘 아시는분 ㅠㅠ > 자유게시판

자유게시판

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

혹시 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페이지는

나갔을 텐데 ㅠㅠ

추천
0
  • 복사

댓글 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>

방법은 여러가지일듯..
날림코드라 퍼포먼스 체크 그런거 없음 그냥 참고만 하시길...
© SIRSOFT
현재 페이지 제일 처음으로