2013-03-16 2 views
0

WSDL을 구문 분석 할 때 많은 wsdl:importxsd:import 요소가 나타납니다. 수입품을 파싱하고 @location 또는 @schemaLocation을 파서에 전달하고 싶습니다.가져온 파일의 구문 분석에 매개 변수 전달

가져온 파일이 filea.wsdl;filez.xsd;filev.xsd과 같은 파일을 가져올 때 파일 목록의 크기를 늘리려는 의도가 있습니다. 이렇게하면 이전에 가져온 파일을 제거 할 수 있습니다.

나는이 라인을 따라 함께 뭔가를 생각 :

<xsl:param name="file-list"/> 

<xsl:template match="/"> 
    <xsl:param name="file-list"/> 
    <xsl:apply-templates /> 
</xsl:template> 

<xsl:template match="wsdl:import"> 
    <xsl:apply-templates select="document(@location)"> 
     <xsl:with-param name="file-list" select="concat($file-list, ';', @location)`"/> 
    </xsl:apply-templates> 
</xsl:template> 

답변

1

기본적인 아이디어는 좋은 것 같다. 템플릿을 적용 할 때 당신은 너무, 함께하여 file-list 매개 변수를 전달해야합니다에 두 번째 템플릿에 <xsl:param name="file-list"/>

  1. 실제로 매개 변수를 전달하는 첫 번째 템플릿의 xsl:apply-templates<xsl:with-param name="file-list" value="$file-list"/>을 추가하고,
  2. 추가 거기에 매개 변수를 소개하십시오.