2009-10-13 7 views
3

XslCompiledTransform은 Microsoft에서 XslTransform이 사용되지 않으므로 사용해야한다고 알려주기 때문에 사용하고 있습니다. JIT 컴파일러에서 내부 제한 사항이 발생했습니다. VS2008

<ExactDatetime>200-02-02</ExactDatetime> 된 XslTransform

을 사용하여 작동

<ExactDatetime>200-02-02</ExactDatetime>)) 된 XslTransform

를 사용하여 작동)

<ExactDatetime></ExactDatetime> XslCompiledTransform

를 사용하지

작품 :

XslTransform xslDoc = new XslTransform(); 
xslDoc.Load(xslPath); 
xslDoc.Transform(doc, Response.Output); 

는 JIT (사용 일 예 200- 실패 02-02)

XslCompiledTransform xslDoc = new XslCompiledTransform(); 
xslDoc.Load(xslPath); 
xslDoc.Transform(doc, new XmlTextWriter(Response.Output)); 

JIT 컴파일러에 내부 제한 사항이 있습니다.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidProgramException: JIT Compiler encountered an internal limitation.

소스 오류 :

Line 33:   //xslDoc.Transform(doc, Response.Output); 
Line 34: 
Line 35:    xslDoc.Transform(doc, new XmlTextWriter(Response.Output)); 
Line 36:   } 
Line 37: } 

소스 파일 : C : \ 샤 히드 \ ccr_test \ TEST1 \하여 default.aspx.cs 라인 : 35

스택 추적 :

[InvalidProgramException: JIT Compiler encountered an internal limitation.] 
    <xsl:template name="date:_format-date">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, IList`1 year, IList`1 month, IList`1 day, IList`1 hour, IList`1 minute, IList`1 second, IList`1 timezone, IList`1 pattern) +0 
    <xsl:template name="date:format-date">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator date-time, XPathNavigator pattern) +5170 
    <xsl:template match="DateTime" name="dateTime">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 dt, XPathNavigator fmt) +12397 
    <xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +46057 
    Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +91 
    Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +28 
    System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) +88 
    System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) +193 
    System.Xml.Xsl.XmlILCommand.Execute(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) +28 
    System.Xml.Xsl.XslCompiledTransform.Transform(String inputUri, XmlWriter results) +81 
    _Default.Button1_Click(Object sender, EventArgs e) in c:\shahid\ccr_test\test1\Default.aspx.cs:35 
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
+0

날짜가 200 ** 0 ** - 02-02일까요? – SLaks

+1

노드로 수행중인 xsl은 무엇입니까? –

답변

0

format-date 함수가 잘못된 날짜 값에 대해 이전에하지 않았던 방식으로 불어 난 것처럼 보입니다. 세부 사항을 알지 못하면 원인에 대해 이론화하기가 어렵습니다. EXSLT 라이브러리를 가져 오거나 MSXML에 내장 된 라이브러리를 사용합니까?

예외를 방지하기 위해 format-date를 호출하기 전에 값을 확인하는 유틸리티 함수로이 호출을 래핑해야 할 수도 있습니다.

7

나는 똑같은 문제가 있었는데 같은 스타일 시트 (CCR)라고 생각합니다.

문제는 컴파일 된 XSLT가 document() 함수에 대한 액세스를 거부하고 오류를 제대로 처리하지 못했기 때문입니다. XslCompiledTransform.Load() 호출시 문서 함수의 사용을 허용하는 XsltSettings 개체를 전달합니다. 이 같은 것 :

myTransform.Load(filename,XsltSettings.TrustedXslt,new XmlUrlResolver()); 
+0

내 문제가 해결되었습니다! 감사합니다 – Ajaxe

+1

놀라운, 같은 문제, 같은 CCR.xslt, 동일한 솔루션. 고마워요! BTW, date의 업데이트 된 버전이 있습니다 : format-date function here : http://www.exslt.org/date/functions/format-date/date.format-date.template.xsl –

관련 문제