오페라에서 내 p
태그를 분리해서 사용하면 안되는 문제가 있습니다.오페라에서 작동하지 않는 XSLT copy-of 태그
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/data">
<html>
<link rel="stylesheet" type="text/css" href="temp.css"/>
<body>
<xsl:for-each select="item">
<h1><xsl:value-of select="@name"/></h1>
<xsl:if test="count(summary)>0">
<p class="summary"><xsl:copy-of select="summary" /></p>
</xsl:if>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
와 CSS : 나는 IE9에서이 프로그램을 실행할 때
body {
font-size:14px; text-align:center; width:400px; margin:0 auto; font-family:Verdana;
}
h1 {
color: #231F20; font-size: 1.2em;
}
.summary {
text-align: justify; padding: 1em; background-color: #F0F4F8;
border-left: 1px solid #BBB; border-right: 1px solid #BBB;
}
그것은 다음과 같습니다 여기
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="temp.xsl"?>
<data>
<item name="car">
<summary>It goes by land.</summary>
</item>
<item name="plane">
<summary>It simply flies.</summary>
</item>
</data>
는 XSL입니다 : 여기
는 XML 예제입니다 :
IE9는 본문의 너비를 고려하지 않았지만 중요하지는 않습니다. XSLT가 데이터를 올바르게 변환했습니다. summary
xml 태그는 p
태그와 class="summary"
사이에 위치합니다. 당신이 볼 수 있듯이
, 폭이 존중되지만 p
태그 사이에 삽입 summary
태그로, 두 분할되었다 :이 오페라 12에서 실행할 때
는하지만,이 얻을. 이 오페라의 관리자에서 볼 수있다 : 나는 b
, i
, 또는 span
처럼 html
태그를 포함 할 <summary>
태그를 기대하고 있기 때문에
내가 대신 value-of
의 copy-of
을 사용해야합니다.
왜 Opera는 p
태그를 두 개의 빈 태그로 분리하고 summary
을 삽입합니까? 어떻게 이것을 피하면 p
태그 안에 summary
태그의 내용을 넣을 수 있습니까?
오, 감사합니다. HTML5에 너무 깊이 들여다 보지 않았으므로 새로운 태그에 대해서는 생각해 본 적이 없습니다. 그것은 완벽하게 이해합니다. –