2017-10-02 5 views
0

Ich bin hier auf einen Engpass gestoßen,Konvertieren von XML nach HTML mit Xsl stylessheet

Ich habe eine XML-Datei, die folgende Struktur enthält.

<content> 
    <procedure> 
    <commonInfo> 
    <title>   <inlineSignificantData significantParaDataType="psd51">TASK 72-31-00-030-001</inlineSignificantData> LP Compressor (LPC) Fan Module - Disassemble</title> 
    <para/> 
    <commonInfoDescrPara> 
    <title>General</title> 
    <para>This TASK gives the procedure to disassemble the LP Compressor (Fan) Module.</para> 
    <para>Fig/item numbers in parentheses in the procedure agree with those used in the IPC. Only the primary Fig/item numbers are used. For the service bulletin alpha variants refer to the IPC.</para> 
    <para>Apply the approved penetrating oils before the removal of threaded parts and parts having an interference fit. Let the parts soak before removal. For the approved penetrating oils and procedures, refer to the SPM <dmRef><dmRefIdent><dmCode assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="240" infoCodeVariant="A" itemLocationCode="D" modelIdentCode="IHIX1" subSubSystemCode="4" subSystemCode="6" systemCode="70" systemDiffCode="00"/></dmRefIdent></dmRef>.</para> 
    <para>Refer to <internalRef internalRefId="fig-0001" internalRefTargetType="figure"/> for a sectional view of a LP compressor (fan) module.</para> 
    </commonInfoDescrPara> 
</commonInfo> 
<preliminaryRqmts> 
<reqCondGroup> 
<noConds/></reqCondGroup> 
<reqSupportEquips><supportEquipDescrGroup><supportEquipDescr id="seq-0001"><name>Removal puller</name><identNumber><manufacturerCode>VENDOR1</manufacturerCode><partAndSerialNumber><partNumber>SE 201</partNumber></partAndSerialNumber></identNumber><reqQuantity>1</reqQuantity> 
</supportEquipDescr> 
</preliminaryRqmts> 
</procedure> 
    </content> 

und ich habe XSL-Datei, die diese

<

xsl:template match="content"> 
    <ol class="ata-list"> 
     <xsl:apply-templates select="description|procedure"/> 
    </ol>--> 
    </xsl:template> 

in HTML umwandelt, was Ich mag würde hier zu tun ist, ich will nicht das folgende XML innerhalb der <ol> </ol> drucken Stichworte.

<commonInfo> 
<title>   <inlineSignificantData significantParaDataType="psd51">TASK 72-31-00-030-001</inlineSignificantData> LP Compressor (LPC) Fan Module - Disassemble</title> 
</commonInfo> 

Stattdessen würde Ich mag Details über die Tags drucken

<dev> 
apply template <commonInfo> 
<dev> 

<ol class="ata-list"> 
     <xsl:apply-templates select="procedure"/> with out the common tags 
    </ol>--> 

Wie kann ich das achive? pelase helfen

+0

Konnten Sie sich nicht die Mühe machen, Ihre XML-Datei lesbar einzurücken? –

Antwort

0

Versuchen Modi:

<xsl:template match="content"> 
    <dev> 
     <xsl:apply-templates select="procedure/commonInfo" mode="ci"/> 
    </dev> 
    <ol class="ata-list"> 
     <xsl:apply-templates select="description|procedure" mode="dp"/> 
    </ol> 
    </xsl:template> 

und haben dann verschiedene Template-Regeln für die beiden Bearbeitungsmodi (fügen Sie ein mode="x" Attribut auf die entsprechenden xsl:template und xsl:apply-templates Elemente).