DeRPiNkY: XSLT zusammen mit XML-Schema ?

Beitrag lesen

Klingt plausibel, ich brings aber irgendwie immer noch nicht zum laufen, bin einfach zu blöd scheinbar!

Hier mein Code:

<xsl:template match="/">
<html>
<head>
<title>Stueckliste</title>
</head>
<body>
<xsl:apply-templates select="./*[name()='Head']"/>
<xsl:apply-templates select="./*[name()='BOM']"/>
<xsl:apply-templates select="./*[name()='Head']" mode="toc"/>
</body>
</html>
</xsl:template>

<!-- Darstellung der Kopfdaten  - - - -  -->

<xsl:template match="*[name()='Article']/*[name()='Head']">
<table class="tab1" bgcolor="#c0c0c0" bordercolor="black" width="650px" heigth="40px" cellspacing="0" cellpadding="0">
<colgroup>
<col width="60px"></col>
<col width="85px"></col>
<col width="155px"></col>
<col width="30px"></col>
<col width="45px"></col>
<col width="75px"></col>
<col width="200px"></col>
</colgroup>
<tr>
<td class="border1" rowspan="2" height="10px"><p align="center">Siemens PTD&#160;T</p></td>
<td class="border1" rowspan="2"><p align="center">engeneering <font size="3">BOM</font></p></td>
<td class="border1" bgcolor="#007575"><font color="white"><p>&#160;ident no. -EX</p></font></td>
<td class="border1" bgcolor="#007575"><font color="white"><p>&#160;RI</p></font></td>
usw....

Das XML-Dokument schaut folgendermaßen aus:

<Article xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
         xsi:schemaLocation='http://www.bernd.de Article-Schema.xsd'
  xmlns='http://www.bernd.de'>
<Head>
  <ART.PartID></ART.PartID>
  <ART.ZNr></ART.ZNr>
  <ART.WeightC></ART.WeightC>
  .
                .
                .
  <ART.Surface></ART.Surface>
  <ART.MatText></ART.MatText>
</Head>
<BOM>
  <Position>
   <ARTART.PosNo></ARTART.PosNo>
   <ARTART.PartID></ARTART.PartID>
   .
                        .
                        .

kannst du was damit anfangen?
Vielen Dank!

Cu Bernd

AH,

hat doch so ungefähr gestimmt wie du das gesagt hast!
Bist und bleibst einfach der Chef!
Jetzt gehts:

<xsl:template match="//*[name() = 'Article']">
<html>
<head>
<title>Stueckliste</title>
</head>
<body>
<xsl:apply-templates select="*[name() ='Head']"/>
<xsl:apply-templates select="*[name()='BOM']"/>
<xsl:apply-templates select="*[name()='Head']" mode="toc"/>
</body>
</html>
</xsl:template>

und

<xsl:template match="//*[name() = 'Head']">

<table class="tab1" bgcolor="#c0c0c0" bordercolor="black" width="650px" heigth="40px" cellspacing="0" cellpadding="0">
<colgroup>
<col width="60px"></col>
<col width="85px"></col>
<col width="155px"></col>
<col width="30px"></col>
<col width="45px"></col>
<col width="75px"></col>
<col width="200px"></col>
</colgroup>
<tr>
<td class="border1" rowspan="2" height="10px"><p align="center">Siemens PTD&#160;T</p></td>
<td class="border1" rowspan="2"><p align="center">engeneering <font size="3">BOM</font></p></td>
<td class="border1" bgcolor="#007575"><font color="white"><p>&#160;ident no. -EX</p></font></td>
<td class="border1" bgcolor="#007575"><font color="white"><p>&#160;RI</p></font></td>
usw....

Vielen Vielen Dank für deine Hilfe!

noch eine Frage: was ist der unterschied zwischen name() und local-name() ?
Schönen Tag noch!

Cu Bernd