0

Azureサービス定義ファイルがあり、最後に値を追加して、いくつかの"physicalDirectory"属性(where @ph != 'EmptyFolder')を更新する必要があります。'\Deploy\'

私が思うクエリのxPath's場合はこのようなsmthになります

//x:Site[@physicalDirectory != 'EmptyFolder']/@physicalDirectory
//x:VirtualApplication/@physicalDirectory

したがって、最終結果は次のようになります。

<vApp name="main" physicalDirectory="..\blahblahblah\Deploy\" />

あなたは私がそれをするのを手伝ってくれますか?

これがサンプルファイルです

<ServiceDefinition name="Platform.Services.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
  <WorkerRole name="WorkflowService.Worker" vmsize="ExtraSmall">
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
    </Imports>
    <Certificates>
      <Certificate name="ThreeSeventyCertificate" storeLocation="LocalMachine" storeName="My" />
    </Certificates>
  </WorkerRole>
  <WebRole name="WebService.Web" vmsize="ExtraSmall" enableNativeCodeExecution="true">
     <Sites>
      <Site name="Web" physicalDirectory="EmptyFolder">
        <VirtualDirectory name="api" physicalDirectory="EmptyFolder">
          <VirtualApplication name="main" physicalDirectory="..\Platform.Services.AccountService.Web\" />
          <VirtualApplication name="v1.0" physicalDirectory="..\..\_releases\V1.0\Platform.Services.AccountService.Web\" />
        </VirtualDirectory>
        <VirtualDirectory name="docs" physicalDirectory="EmptyFolder">
          <VirtualApplication name="main" physicalDirectory="..\AccountService.Documentation\" />
          <VirtualApplication name="v1.0" physicalDirectory="..\..\_releases\V1.0\AccountService.Documentation\" />
        </VirtualDirectory>
        <VirtualApplication name="reports" physicalDirectory="..\Platform.Services.ReportService.Web\" />
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
      <Site name="internal" physicalDirectory="..\InternalService.Web\">
        <Bindings>
          <Binding name="internal" endpointName="internal" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="https" port="443" certificate="ThreeSeventy" />
      <InternalEndpoint name="internal" protocol="http">
      </InternalEndpoint>
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
    </Imports>
    <Certificates>
      <Certificate name="ThreeSeventy" storeLocation="LocalMachine" storeName="My" />
    </Certificates>
    <ConfigurationSettings>
      <Setting name="TransportServiceEntities" />
      <Setting name="ReportServiceEntities" />
      <Setting name="AccountServiceEntities" />
      <Setting name="ThreeSeventyEntitiesMembership" />
    </ConfigurationSettings>
  </WebRole>
  <WorkerRole name="ChannelService.Worker" vmsize="ExtraSmall">
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
    <ConfigurationSettings>
      <Setting name="EngineEnabled" />
      <Setting name="PlatFormAPIConnectionString" />
    </ConfigurationSettings>
    <Certificates>
      <Certificate name="ThreeSeventyCertificate" storeLocation="LocalMachine" storeName="My" />
    </Certificates>
  </WorkerRole>
</ServiceDefinition>
4

1 に答える 1

1

どうですか:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="@physicalDirectory[. != 'EmptyFolder']">
    <xsl:attribute name="{name()}">
      <xsl:value-of select="concat(., 'Deploy\')"/>
    </xsl:attribute>
  </xsl:template>
</xsl:stylesheet>

サンプル入力で実行するphysicalDirectoryと、値が「EmptyFolder」の属性はそのままになります。

  <Site name="Web" physicalDirectory="EmptyFolder">
    <VirtualDirectory name="api" physicalDirectory="EmptyFolder">

そして、他のすべての末尾には「Deploy\」が追加されています。

  <VirtualApplication name="main" physicalDirectory="..\Platform.Services.AccountService.Web\Deploy\" />
  <VirtualApplication name="v1.0" physicalDirectory="..\..\_releases\V1.0\Platform.Services.AccountService.Web\Deploy\" />
于 2013-02-05T11:57:39.067 に答える