Transformer transformer = tFactory.newTransformer(StreamXSL);
에 대한 예외가 발생합니다. 아래 오류가 명시 적으로 적용되지 않는 이유는 무엇입니까? "스타일 시트를 컴파일 할 수 없습니다"라는 이유를 이해할 수 없습니까? 여기에 TKSJava : XML/XSL Transformer 오류에 대한 자세한 정보를 얻는 방법은 무엇입니까?
static String getHtml(String xml)
{
Element elementObj = getElementObject(xml);
String xslName = getValueOfElement(elementObj, xml, "XSL_TO_RUN");
StreamSource StreamXML = new StreamSource(new StringReader(xml));
try{
TransformerFactory tFactory = TransformerFactory.newInstance();
if(xslName!=null){
String xslfile = xslName;
File xfile = new File(xslfile);
if (xfile.exists()){}
else
{
LogI.log(4,"getHtml:: ERROR: xsl file don´t Exist! " + xslName);
return null;
}
StreamSource StreamXSL = new StreamSource(xfile);
Transformer transformer = tFactory.newTransformer(StreamXSL);
}else{
LogI.log(0,"getHtml::ERROR->Error on create stream XSL");
return null;
}
} catch(TransformerConfigurationException ex){
LogI.log(0,"getHtml::Erro crossing the XML with the XSL:" + ex);
LogI.log(0,"getHtml::Erro crossing the XML with the XSL(1):" + ex.getMessageAndLocation());
LogI.log(0,"getHtml::Erro crossing the XML with the XSL(2):" + ex.getMessage());
for(int i=0;i<ex.getStackTrace().length;i++){
LogI.log(0, "ARQ::Pedido:: ERRO(2) ->" + ex.getStackTrace()[i]);
}
return null;
} catch(Exception e){
LogI.log(0,"getHtml::Erro crossing the XML with the XSL:" + e);
//out.clear();
//out.println(errorPage);
return null;
}
}
는 출력 :
ERRO: getHtml::Erro crossing the XML with the XSL:javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
ERRO: getHtml::Erro crossing the XML with the XSL(1):Could not compile stylesheet
ERRO: getHtml::Erro crossing the XML with the XSL(2):Could not compile stylesheet
ERRO: ARQ::Pedido:: ERRO(2) ->com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
ERRO: ARQ::Pedido:: ERRO(2) ->com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source)
ERRO: ARQ::Pedido:: ERRO(2) ->BizBanc.Arq.getHtml(Arq.java:189)
ERRO: ARQ::Pedido:: ERRO(2) ->BizBanc.Arq.getResponse(Arq.java:792)
xsl은 erros가없는 tomcat 환경에서 사용되는 것처럼 ok입니다. .. – Reversed
당신은 내 xsl이 중복 된 필드를 갖고있는 것이 옳았다. 도움을 주셔서 감사합니다! – Reversed