Ich habe das folgende XML mit internen XSLT. Einige der Vorlagen werden angewendet und einige von ihnen nicht, und ich kann keinen Reim oder Grund finden.XSLT-Vorlage nicht angewendet
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="#style1"?>
<!DOCTYPE dmodule [
<!ELEMENT xsl:stylesheet (#PCDATA)>
<!ATTLIST xsl:stylesheet
id ID #IMPLIED>
]>
<dmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:nsiv="http://www.pbmassoc.com/nsiv" nsiv:spec-issue="3.0.1">
<?MENTORPATH?>
<?xml-stylesheet type="text/xsl" href="#style1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="style1">
<xsl:template match="/">
<html>
<head>
<title>XML Compare</title>
<style>
table, th, td {
border: 1px solid black;
}
.warning {
color: red;
font-size: 16pt;
font-weight: bold;
}
.caution {
font-size: 14pt;
font-weight:bold;}
</style>
</head>
<body>
<h1>
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/modelic"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/sdc"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/chapnum"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/section"/>
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/subsect"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/subject"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/discode"/>
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/discodev"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/incode"/>
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/incodev"/>-
<xsl:value-of select="dmodule/idstatus/dmaddres/dmc/avee/itemloc"/>:
<xsl:value-of select="dmodule/idstatus/dmaddres/dmtitle/techname"/> -
<xsl:value-of select="dmodule/idstatus/dmaddres/dmtitle/infoname"/>
</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match = "dmodule/content/refs">
<br/>
<table>
<caption>References</caption>
<tr>
<th>Data Module Code</th>
<th>Title</th>
</tr>
<xsl:apply-templates select = "dmodule/content/refs/refdm"/>
</table>
</xsl:template>
<xsl:template match = "dmodule/content/refs/refdm">
<tr>
<td>
<xsl:value-of select="avee/modelic"/>-<xsl:value-of select="avee/sdc"/>-<xsl:value-of select="avee/chapnum"/>-
<xsl:value-of select="avee/section"/><xsl:value-of select="avee/subsect"/>
-<xsl:value-of select="avee/subject"/>-<xsl:value-of select="avee/discode"/><xsl:value-of select="avee/discodev"/>-
<xsl:value-of select="avee/incode"/><xsl:value-of select="avee/incodev"/>
-<xsl:value-of select="avee/itemloc"/>
</td>
<td>
<xsl:value-of select="dmtitle/techname"/> - <xsl:value-of select="dmtitle/infoname"/>
</td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/reqconds">
<br/>
<table>
<caption>Pre-Requisites</caption>
<tr>
<th>Data Module Code</th>
<th>Title</th>
</tr>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/reqconds/reqcondm"/>
</table>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/reqconds/reqcondm">
<tr>
<td>
<xsl:value-of select="refdm/avee/modelic"/>-<xsl:value-of select="refdm/avee/sdc"/>-
<xsl:value-of select="refdm/avee/chapnum"/>-<xsl:value-of select="refdm/avee/section"/>
<xsl:value-of select="refdm/avee/subsect"/>-<xsl:value-of select="refdm/avee/subject"/>
-<xsl:value-of select="refdm/avee/discode"/><xsl:value-of select="refdm/avee/discodev"/>-
<xsl:value-of select="refdm/avee/incode"/><xsl:value-of select="refdm/avee/incodev"/>
-<xsl:value-of select="refdm/avee/itemloc"/>
</td>
<td>
<xsl:value-of select = "reqcond"/>
</td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/supequip">
<br/>
<table>
<caption>Support Equipment</caption>
<tr>
<th>Nomenclature</th>
<th>Manufacturer Code</th>
<th>Part Number</th>
</tr>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/supequip/supeqli/supequi"/>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/supequip/nosupeq"/>
<xsl:if test = "not(dmodule/content/proced/prelreqs/supequip)">
<tr>
<td colspan = "3">No Support Equipment</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/supequip/supeqli/supequi">
<tr>
<td><xsl:value-of select = "nomen"/></td>
<td><xsl:value-of select = "identno/mfc"/></td>
<td><xsl:value-of select = "identno/pnr"/></td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/supequip/nosupeq">
<tr>
<td colspan = "3">No Support Equipment</td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/supplies">
<br/>
<table>
<caption>Consumables</caption>
<tr>
<th>Nomenclature</th>
<th>Manufacturer Code</th>
<th>Part Number</th>
</tr>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/supplies/supplyli/supply"/>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/supplies/nosupply"/>
<xsl:if test = "not(dmodule/content/proced/prelreqs/supplies)">
<tr>
<td colspan = "3">No Consumables</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match = "xsl:stylesheet"/>
<xsl:template match = "dmodule/content/proced/prelreqs/supplies/supplyli/supply">
<tr>
<td><xsl:value-of select = "nomen"/></td>
<td><xsl:value-of select = "identno/mfc"/></td>
<td><xsl:value-of select = "identno/pnr"/></td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/supplies/nosupply">
<tr>
<td colspan = "3">No Consumables</td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/spares">
<br/>
<table>
<caption>Spares</caption>
<tr>
<th>Nomenclature</th>
<th>Manufacturer Code</th>
<th>Part Number</th>
</tr>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/spares/sparesli/spare"/>
<xsl:apply-templates select = "dmodule/content/proced/prelreqs/spares/nospares"/>
<xsl:if test = "not(dmodule/content/proced/prelreqs/supplies)">
<tr>
<td colspan = "3">No Spares</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/spares/sparesli/spare">
<tr>
<td><xsl:value-of select = "nomen"/></td>
<td><xsl:value-of select = "identno/mfc"/></td>
<td><xsl:value-of select = "identno/pnr"/></td>
</tr>
</xsl:template>
<xsl:template match = "dmodule/content/proced/prelreqs/safety">
<br/>
<h2>Safety</h2>
<xsl:apply-templates select = "warning"/>
<xsl:apply-templates select = "caution"/>
<xsl:apply-templates select = "note"/>
</xsl:template>
<xsl:template match = "warning">
<p class = "warning">WARNING</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match = "para">
<p><xsl:value-of select = "."/></p>
</xsl:template>
<xsl:template match = "caution">
<p clas = "caution">Caution</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match = "note">
<p class = "note">Note</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match = "dmodule/content/proced/mainfunc">
<h2>Procedure</h2>
<ol>
<xsl:apply-templates/>
</ol>
</xsl:template>
<xsl:template match = "dmodule/content/proced/mainfunc/step1">
<li><xsl:value-of select = "para"/></li>
</xsl:template>
<xsl:template match = "idstatus"/>
<xsl:template match = "closereqs">
<br/>
<table>
<caption>Close-Up Requirements</caption>
<tr>
<th>Data Module</th>
<th>Requirement</th>
</tr>
<xsl:apply-templates select = "reqconds"/>
<xsl:choose>
<xsl:when test = "not(dmodule/content/proced/closereqs)">
<tr>
<td colspan = "2">No Close-Up Requirements</td>
</tr>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select = "noconds"/>
</xsl:otherwise>
</xsl:choose>
</table>
</xsl:template>
<xsl:template match = "noconds">
<tr>
<td colspan = "2">No Close-Up Requirements</td>
</tr>
</xsl:template>
<xsl:output method="html"/>
</xsl:stylesheet>
<idstatus>
<dmaddres>
<dmc>
<avee>
<modelic>XYZ</modelic>
<sdc>AA</sdc>
<chapnum>01</chapnum>
<section>3</section>
<subsect>4</subsect>
<subject>11</subject>
<discode>02</discode>
<discodev>A</discodev>
<incode>520</incode>
<incodev>A</incodev>
<itemloc>A</itemloc>
</avee>
</dmc>
<dmtitle>
<techname>XYZ Device</techname>
<infoname>Removal</infoname>
</dmtitle>
<issno inwork="11" issno="000" type="new"/>
<issdate day="05" month="22" year="2009"/>
<language country="US" language="en"/>
</dmaddres>
<status>
<rpc rpcname="Acme">1234</rpc>
<orig>1234</orig>
<applic>
<displaytext>ALL</displaytext>
</applic>
<brexref>
<refdm>
<avee>
<modelic>XYZ</modelic>
<sdc>AA</sdc>
<chapnum>05</chapnum>
<section>0</section>
<subsect>2</subsect>
<subject>20</subject>
<discode>35</discode>
<discodev>A</discodev>
<incode>015</incode>
<incodev>A</incodev>
<itemloc>C</itemloc>
</avee>
</refdm>
</brexref>
<qa>
<firstver type="tabtop"/>
<secver type="tabtop"/>
</qa>
<remarks>
<p>Ref Designator: </p>
</remarks>
</status>
</idstatus>
<content>
<refs>
<refdm>
<avee>
<modelic>XYZ</modelic>
<sdc>AA</sdc>
<chapnum>01</chapnum>
<section>1</section>
<subsect>1</subsect>
<subject>10</subject>
<discode>10</discode>
<discodev>A</discodev>
<incode>100</incode>
<incodev>A</incodev>
<itemloc>C</itemloc>
</avee>
<dmtitle>
<techname>Pre-Maintenance Checklist</techname>
<infoname>Pre-Operation</infoname>
</dmtitle>
</refdm>
<reftp>
<pubcode>XYZ-7</pubcode>
<pubtitle>Installation and Repair Practices </pubtitle>
</reftp>
</refs>
<proced>
<prelreqs>
<reqconds>
<reqcondm>
<reqcond>Pre-Maintenance Checklist</reqcond>
<refdm>
<avee>
<modelic>XYZ</modelic>
<sdc>AA</sdc>
<chapnum>01</chapnum>
<section>1</section>
<subsect>1</subsect>
<subject>10</subject>
<discode>10</discode>
<discodev>A</discodev>
<incode>100</incode>
<incodev>A</incodev>
<itemloc>C</itemloc>
</avee>
<dmtitle>
<techname>Pre-Maintenance Checklist</techname>
<infoname>Pre-Operation</infoname>
</dmtitle>
</refdm>
</reqcondm>
</reqconds>
<reqpers>
<person man="2"/>
</reqpers>
<supequip>
<supeqli>
<supequi>
<nomen>Lift</nomen>
<identno>
<mfc>123</mfc>
<pnr id="d6791e219" nsiv:sfield="pnr pnrsupeq">301–781</pnr>
</identno>
<qty>1</qty>
</supequi>
<supequi>
<nomen>Screwdriver</nomen>
<identno>
<mfc>113</mfc>
<pnr id="d6791e229" nsiv:sfield="pnr pnrsupeq">01534343</pnr>
</identno>
<qty>1</qty>
</supequi>
</supeqli>
</supequip>
<supplies>
<nosupply/>
</supplies>
<spares>
<nospares/>
</spares>
<safety>
<safecond>
<warning><para>Heavy lift involved.</para></warning>
</safecond>
</safety>
</prelreqs>
<mainfunc>
<step1>
<para>Disconnect the thing from the other thing.</para>
</step1>
<step1>
<para>Remove nut (u), lock washer (v), and four flat washers (w).</para>
</step1>
<step1>
<para>Loosen fasteners (x).</para>
</step1>
<step1>
<warning>
<para>Two people shall support component when handling component. Failure to comply
could result in personnel injury and damage to equipment.</para>
</warning>
<para>Lift and remove the heavy thing.</para>
</step1>
</mainfunc>
<closereqs>
<reqconds>
<noconds/>
</reqconds>
</closereqs>
</proced>
</content>
</dmodule>
Der Ausgang I in Chrome bekommen sieht wie folgt aus:
XYZ- AA- 01- 34- 11- 02A- 520a A: XYZ-Gerät - Entfernen
Referenzen Data Module Code Titel
Vorraussetzungen Data Module Code Titel
Support Equipment Nomenklatur Herstellercode Teilenummer Kein Support Equipment
Verbrauchs Nomenklatur Herstellercode Teilenummer Kein Verbrauchs
Spares Nomenklatur Herstellercode Teilenummer Keine Ersatzteile
Sicherheit Verfahren 1 Trennen Sie das Ding von der anderen Sache. 2. Entfernen Sie die Mutter (u), die Sicherungsscheibe (v) und die vier Unterlegscheiben (w). 3. Lösen Sie die Befestigungselemente (x). 4. Heben Sie das schwere Teil an und entfernen Sie es.
Close-Up-Anforderungen Data Module Requirement Keine Nahaufnahme Anforderungen
Die Elemente, die nicht erscheinen, die Art und Weise sind ich sie erwarten, dass die Unterstützung Ausrüstung sind ("supequi" Element), die Warnungen ("Warning" -Element), die Referenzen ("refdm" -Element) und die erforderlichen Bedingungen ("reqcondm" -Element).
Sind Sie sicher, dass das Stylesheet mit einer Zeile wie ' ' kompiliert? –
Hat es getan, aber ich habe den Fehler trotzdem behoben. Vielleicht hat Chrome es einfach ignoriert? –