2012-12-03 2 views
1

저는 잠시 동안 제 코드를 변경하려고했지만 실패했습니다.ready.mobi 모바일 준비가 적절하게 xsl 태그를 중첩합니까?

나는 3.72에 피크에 준비 점수를 얻고 코드 표시를 할 수 있어요 잘 여기 기능 : 링크

을 제거하지만 ready.mobi과 함께 사용했을 때 ready.mobi/launch합니다. ? JSP 로케일 = en_EN 번호 조각-1 나는 다음과 같은 오류를 얻을

: 때문에 마크 업 오류의

FAIL near line -1 column -1 
    Your page does not validate against XHTML Basic 1.1 or XHTML Mobile Profile 1.2 

    FAIL near line 41 column 17 
    The content of element type "a" must match "(br|span|em|strong|dfn|code|samp|kbd|var|cite|abbr|acronym|q|tt|i|b|big|small|sub|sup|img|object|input|select|textarea|label|button|script|noscript)". 

    FAIL near line 46 column 17 
    *same element type "a" error line 

    FAIL near line 51 column 17 
    *same element type "a" error line 

    FAIL near line 56 column 17 
    ..... 

    FAIL near line 61 column 17 
    ... 

는 XHTML 모바일 프로필도 실패합니다. 가 링크

가 중첩 순서가 동의 할 수있는 검증을 위해 변경 제거 :

그러나

내 점수가 모두 XHTML 모바일 프로파일 5를하고 코드는 다음과 같은 경우 유효한 마크 업 할 수 있다고 한 . 그러나 이로 인해 링크가 끊어집니다.

은 전에 :

<xsl:element name="a"> 
    <xsl:attribute name="href"> 
     <xsl:value-of select="link"/> 
    </xsl:attribute> 
</xsl:element> 
    <xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute><xsl:text>more...</xsl:text></xsl:element> 

후 :

<xsl:element name="a"> 
    <xsl:attribute name="href"> 
     <xsl:value-of select="link"/> 
    </xsl:attribute> 
    <xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute><xsl:text>more...</xsl:text></xsl:element> 
</xsl:element> 

어떤 도움을 이해할 수있을 것이다. :) 많은 감사 !!!

답변

1

<a><p> 안에 넣으면 어떨까요?

<xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute> 
<xsl:element name="a"> 
    <xsl:attribute name="href"> 
     <xsl:value-of select="link"/> 
    </xsl:attribute> 
    <xsl:text>more...</xsl:text></xsl:element> 
</xsl:element> 

또는 훨씬 더 단순히 href 리터럴 결과 요소와 속성 값 템플릿를 사용하여 :

<p class="more"><a href="{link}">more...</a></p> 
+0

예! 두 솔루션 모두 완벽하게 작동했습니다. 대단히 감사합니다! :)) 변수 = 더 많은 선언과 함께 요소 이름 = p 및 이름 = 클래스를 사용하여 CSS를 할당하려면

,이 코드를 사용하면 CSS 스타일링에 제거되었습니다. 지금 어디서 잘못되었는지 생각하려고합니다. – RevXaisks

+1

@ user1792848 내가 제안하는 두 가지 "솔루션"은 동일해야하며 동일한 것을 표현하는 두 가지 다른 방법입니다. 필자는 가능할 때마다'

와 같은 리터럴 요소와 속성을 사용하는 것이 일반적으로 명확하고 문자 그대로 표현할 수없는 경우에는''과' , 예. 여기서 요소/속성 이름은 고정되어 있지 않고 런타임에 계산됩니다. 또는 일부 조건에 따라 속성을 추가하거나 추가하지 않으려 고합니다. –