준비 시간에 소스 분석기 사용

실행 파일을 준비할 때 소스 분석기를 지정하면 해당 시점에 참조되는 URI를 해석하는 방법을 프로세서에 알릴 수 있습니다.

프로시저

실행 파일을 준비하는 시점에 소스 분석기를 지정하십시오.

그러면 예를 들어, 스타일시트의 xsl:import 및 xsl:include 지시문에서 해당 시점에 참조되는 URI를 해석하는 방법을 프로세스에 알립니다.

기본 소스-분석 동작은 기본 URI가 사용 가능한 경우 표현식, 조회 또는 스타일시트 관점에서 상대적 URI를 해석하거나 기본 URI가 사용 불가능한 경우 현재 작업 디렉토리에 상대적인 파일 경로로 해석하는 것입니다. 절대적 URI는 그대로 사용됩니다.

이 동작을 변경하려면 XSourceResolver 인터페이스를 구현하는 Java™ 클래스를 작성하고 스타일시트를 준비하기 전에 XStaticContext에 등록하십시오.

다음은 소스 분석기를 등록하는 방법에 대한 기본 예제입니다.
XFactory factory = XFactory.newInstance();

// Register the source resolver with the static context
XStaticContext staticContext = factory.newStaticContext();
XSourceResolver sourceResolver=new ASourceResolver(replacementBase);
staticContext.setSourceResolver(sourceResolver);

// Prepare the sylesheet
XSLTExecutable executable = factory.prepareXSLT(new StreamSource(stylesheetFile), staticContext);

XDynamicContext dynamicContext = factory.newDynamicContext();

// Execute the stylesheet
XSequenceCursor cursor = executable.execute(new StreamSource(inputFile), dynamicContext);

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_resolvers_source_prep
파일 이름:txml_resolvers_source_prep.html