포럼에서 GetMedia로 오류를 검색하면 함수에 제공하는 변수가 정수가 아님을 알 수 있습니다.umbraco xslt getMedia 오류
다음은 오류입니다. System.OverflowException : 값이 Int32에 비해 너무 크거나 작습니다.
<xsl:value-of select="$currentPage/image" />
출력했다 :
1663
다음 내가 이것을 시도 : 그것은 나에게 내가 위에서 당신을 쓴 오류를 반환
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/image, false())" />
나는 나의 변수를 확인합니다. $ currentPage/image 대신에 1663을 썼다면 작동하지만, 하드 코드 된 것이므로 하드 코딩되지 않을 것입니다.
여기 내 XSLT
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:value-of select="$currentPage/image" />
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/image, false())" />
<div class="tfirst">
<p>
<!--xsl:if test="not($media/error)">
<img src="{$media/umbracoFile}" class="left timg" />
</xsl:if-->
<div class="ttext">
<h2><xsl:value-of select="umbraco.library:StripHtml($currentPage/title)" /></h2>
<xsl:value-of select="$currentPage/abstractText" disable-output-escaping="yes" />
</div>
</p>
</div>
<div class="ttext">
<xsl:if test="$currentPage/showMultipleColumns='1'">
<xsl:attribute name="class">showMultipleColumns</xsl:attribute>
</xsl:if>
<xsl:value-of select="$currentPage/bodyText" disable-output-escaping="yes" />
</div>
</xsl:template>
는 당신의 도움을 주셔서 감사합니다. 벤자민
편집 ------------------
나는 시험 경우를 추가하려고했지만 내가 $ currentPage를 교체 할 경우 지금은 나에게 또 다른 오류를 줄/image by 1663 : System.Xml.Xsl.XslTransformException : 경로 식에서 결과 트리 단편을 사용하려면 먼저 msxsl : node-set() 함수를 사용하여 노드 집합으로 변환합니다.
내가 항상 가지고있는 $ currentPage/image를 보겠습니다. System.OverflowException : 값이 Int32에 비해 너무 크거나 작습니다.
<xsl:variable name="atest" select="umbraco.library:GetMedia($currentPage/image, false())" />
<xsl:variable name="media">
<xsl:if test="$currentPage/image > 0">
<xsl:value-of select="$atest" />
</xsl:if>
</xsl:variable>
Edit2가 ------------
항상 오류가 점점 아래이 시도 : System.OverflowException이를 : 여기에
는 XSLT이다 값이 너무 큰 중 하나였다 Int32에서는 너무 작습니다.<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/image, false())" />
<xsl:if test="$media">
<img src="{$media/umbracoFile}" class="left timg" />
</xsl:if>
안녕하세요, 지금 시도해 보았습니다. System.Xml.Xsl.XslTransformException : 결과 트리 조각을 경로 식에 사용하려면 먼저 msxsl : node- set() 함수. 자세한 내용은 내 게시물의 편집 부분을 참조하십시오. – Benjamin
테스트가 잘못되어 테스트에서 줄의 순서가 바뀌 었습니다. 제 예제의 정확한 순서대로 시도하십시오. –
예제를 시도했지만 항상 int32에 대한이 오류가 발생했습니다. 내 편집 2보기 – Benjamin