AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein XML Delphi Benoetige Hilfe bei der Erstellung einer XSL-Datei
Thema durchsuchen
Ansicht
Themen-Optionen

Benoetige Hilfe bei der Erstellung einer XSL-Datei

Offene Frage von "torud"
Ein Thema von torud · begonnen am 22. Apr 2007 · letzter Beitrag vom 26. Apr 2007
Antwort Antwort
torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#1

Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 22. Apr 2007, 12:53
Hallo Wissende,

mein Wissen ueber XML und XSL ist leider begrenzt, aber ich habe ne Aufgabe erhalten, die mich echt ins Schwitzen bringt. Mir wurde ne XML-Datei geschickt, die ich mittels XSL darstellen soll. Diese Datei hat nicht etwa ueber 20000 Zeilen!

Nun zu meiner Frage. Die Datei ist so strukturiert, dass sich gewisse Abschnitte gegenseitig referenzieren. Ich poste mal einen Ausschnitt, zu dem ich folgende Fragen habe.

Ich muss aus Schedules ueber DateSeq die MatchNo(s) des Tages herausbekommen. Wenn ich die habe, muss ich ueber die Matches die Match(es) herausfiltern und die Namen der Spieler ueber die SpielerID zusammensuchen. Da mein Wissen ueber XSL doch eher begrenzt ist, habe ich bisher nur das hier, was mir die MatchNo(s) des Tages auflistet.
Delphi-Quellcode:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <head>
  </head>
  <body>
  <h3>Infos</h3>
  <table>
   <xsl:for-each select="Export/Schedules/Schedule">
    <xsl:sort select="DateSeq" order="ascending" data-type="text" />
     <xsl:if test="DateSeq='8'">
      <tr><td>Match:
       <xsl:value-of select="MatchNo" />
      </td></tr>
     </xsl:if>
   </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
Hier das XML-Beispiel - stark eingekuerzt.

Delphi-Quellcode:
<Export>
  <DatabaseVersion>1.30.4</DatabaseVersion>
  <Players>
    <Player PlayerId="945d65f5-2583-4e04-a9d2-00828de8d8b4">
      <PlayerId>945d65f5-2583-4e04-a9d2-00828de8d8b4</PlayerId>
      <Upid>NULL</Upid>
      <Gender>M</Gender>
      <Surname>Safin</Surname>
      <FirstName>Marat</FirstName>
      <Initials>M </Initials>
      <Birthday>NULL</Birthday>
      <Country>RUS</Country>
      <Itfnumber>NULL</Itfnumber>
      <Ipin>NULL</Ipin>
      <ReduceName>NULL</ReduceName>
      <ScoreName>NULL</ScoreName>
      <ExternalId>S741</ExternalId>
      <Matricule>NULL</Matricule>
      <TitleId>-1</TitleId>
      <ValidSince>4/11/2007 11:59:59 AM</ValidSince>
      <DeathDate>NULL</DeathDate>
      <NameChanged>False</NameChanged>
      <Itfsurname>NULL</Itfsurname>
      <ItffirstName>NULL</ItffirstName>
      <Itfbirthday>NULL</Itfbirthday>
      <ExtSurname>Safin</ExtSurname>
      <ExtFirstName>Marat</ExtFirstName>
      <ExtBirthday>NULL</ExtBirthday>
      <LastConsentDate>2/21/2007 12:00:00 AM</LastConsentDate>
      <SoundsLike>S150M630</SoundsLike>
    </Player>
  </Players>
  <PlayerDatas>
    <PlayerData TournamentId="c1b6013e-dfc6-4290-a04a-9f02b8b5897a" PlayerId="945d65f5-2583-4e04-a9d2-00828de8d8b4">
      <TournamentId>c1b6013e-dfc6-4290-a04a-9f02b8b5897a</TournamentId>
      <PlayerId>945d65f5-2583-4e04-a9d2-00828de8d8b4</PlayerId>
      <ChRoom>False</ChRoom>
      <Origin>NULL</Origin>
      <SinglesProtRank>NULL</SinglesProtRank>
      <UseSinglesProt>False</UseSinglesProt>
      <DoublesProtRank>NULL</DoublesProtRank>
      <UseDoublesProt>False</UseDoublesProt>
      <PrstartDate>NULL</PrstartDate>
      <PrendDate>NULL</PrendDate>
      <DatePayment>NULL</DatePayment>
      <Balance>0</Balance>
    </PlayerData>
  </PlayerDatas>
  <Matches>
    <Match TournamentId="c1b6013e-dfc6-4290-a04a-9f02b8b5897a" EventId="3" MatchNo="19">
      <TournamentId>c1b6013e-dfc6-4290-a04a-9f02b8b5897a</TournamentId>
      <EventId>3</EventId>
      <MatchNo>19</MatchNo>
      <ScoringType>1</ScoringType>
      <FinalSetAdv>False</FinalSetAdv>
      <NumSets>3</NumSets>
      <Player1>9ca5e191-0922-4521-b8bc-8444b6411bc1</Player1>
      <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
      <Player2>b11c3f35-dccc-4297-9282-095678996a6f</Player2>
      <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
      <OfficialId>dc78ff2d-8dd9-4eda-b8d2-81c5bac760be</OfficialId>
      <Prog>R</Prog>
      <Winner>2</Winner>
      <DateStart>4/14/2007 1:15:24 PM</DateStart>
      <DateRes>4/14/2007 3:22:46 PM</DateRes>
      <Score>7/5 1/6 6/4</Score>
      <LongScore>7/5 1/6 6/4</LongScore>
      <ProcPrize>True</ProcPrize>
      <NumGames>NULL</NumGames>
      <DateSeq>2</DateSeq>
      <CourtId>2</CourtId>
      <MatchSeq>2</MatchSeq>
      <IsMoved>False</IsMoved>
      <ToFinish>False</ToFinish>
      <NotBefore>Followed By</NotBefore>
      <Process>R</Process>
      <RoundId>2</RoundId>
      <FreeTxt>NULL</FreeTxt>
      <ResultCode>N</ResultCode>
      <IsShow>False</IsShow>
      <Rrgroup>NULL</Rrgroup>
      <HeatRuleInEffect>False</HeatRuleInEffect>
    </Match>
  </Matches>
  <Schedules>
    <Schedule TournamentId="c1b6013e-dfc6-4290-a04a-9f02b8b5897a" EventId="1" MatchNo="2" DateSeq="9">
      <TournamentId>c1b6013e-dfc6-4290-a04a-9f02b8b5897a</TournamentId>
      <EventId>1</EventId>
      <MatchNo>2</MatchNo>
      <DateSeq>9</DateSeq>
      <ProgCourt>1</ProgCourt>
      <ProgSeq>2</ProgSeq>
      <NotBefore>
      </NotBefore>
      <FreeText>
      </FreeText>
      <ToFinish>False</ToFinish>
    </Schedule>
    <Schedule TournamentId="c1b6013e-dfc6-4290-a04a-9f02b8b5897a" EventId="1" MatchNo="3" DateSeq="9">
      <TournamentId>c1b6013e-dfc6-4290-a04a-9f02b8b5897a</TournamentId>
      <EventId>1</EventId>
      <MatchNo>3</MatchNo>
      <DateSeq>9</DateSeq>
      <ProgCourt>1</ProgCourt>
      <ProgSeq>3</ProgSeq>
      <NotBefore>
      </NotBefore>
      <FreeText>
      </FreeText>
      <ToFinish>False</ToFinish>
    </Schedule>
  </Schedules>
Danke
Tom
  Mit Zitat antworten Zitat
torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#2

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 07:57
Also da sich niemand an dieses Thema getraut hat, habe ich nun die XML-Datei eingelesen und Creiere daraus eine eigene kleiere Datei. Mit dieser Datei habe ich aber trotzdem noch immer das Problem der Darstellung per XSL. Ich bekomme es zwar hin, aber nicht wirklich DYNAMISCH.

Wie ich das meine? Ok, in der XML-Datei findet man nun die Court und dazu die dort stattfindenen Spiele. In der XSL schaffe ich es einfach nicht diese Courts dynamisch anzuzeigen. Also wenn nur auf Court 1 und 3 gespielt wird, sollen auch nur 2 Tabellen angezeigt werden. Die Aufgabe hat sich also um einiges vereinfacht, aber ich bekomme es einfach nicht hin. Wo fehlts da?

XML-Content:
Delphi-Quellcode:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="matches.xsl" ?>
<?xml-stylesheet type="text/css" href="index.css" ?>
<glossar>
 <court>
  <eintrag id="1">
   <DateSeq>2</DateSeq>
   <MatchNo>21</MatchNo>
   <NumSets>3</NumSets>
   <Player1>74c8a1dd-9332-40dc-959b-f6500ef8897c</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>7a07a4f3-c450-48be-b859-63dc90a11781</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>e73eded0-6917-42d8-b8bb-8ac4d0bf4ce0</OfficialId>
   <CourtId>1</CourtId>
   <Winner>1</Winner>
   <LongScore>6/4 4/6 6/3</LongScore>
   <npA>Guez David</npA>
   <npA2></npA2>
   <npB>di Mauro Alessio</npB>
   <npB2></npB2>
   <Country1>FRA</Country1>
   <Country1a></Country1a>
   <Country2>ITA</Country2>
   <Country2a></Country2a>
   <CountryOff></CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="1">
   <DateSeq>2</DateSeq>
   <MatchNo>22</MatchNo>
   <NumSets>3</NumSets>
   <Player1>7f1c5ab7-622c-4dda-81fb-52371bb162ce</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>b933a05e-8f04-41b1-84a2-7b794bfa5846</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>a3ee2e72-25c7-40ef-a919-3d52924a673a</OfficialId>
   <CourtId>1</CourtId>
   <Winner>2</Winner>
   <LongScore>6/2 6/4</LongScore>
   <npA>Llodra Michael</npA>
   <npA2></npA2>
   <npB>Luzzi Federico</npB>
   <npB2></npB2>
   <Country1>FRA</Country1>
   <Country1a></Country1a>
   <Country2>ITA</Country2>
   <Country2a></Country2a>
   <CountryOff></CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="1">
   <DateSeq>2</DateSeq>
   <MatchNo>26</MatchNo>
   <NumSets>3</NumSets>
   <Player1>c5c897d4-5c0a-4851-86a8-8849368eb628</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>ea151437-3427-40c7-ad20-2bc88272d99d</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>20d9aadd-cb1c-4fb3-96f2-bd3a28a360eb</OfficialId>
   <CourtId>1</CourtId>
   <Winner>1</Winner>
   <LongScore>7/6(7/4) 2/6 7/5</LongScore>
   <npA>Roitman Sergio</npA>
   <npA2></npA2>
   <npB>Lisnard Jean-Rene</npB>
   <npB2></npB2>
   <Country1>ARG</Country1>
   <Country1a></Country1a>
   <Country2>MON</Country2>
   <Country2a></Country2a>
   <CountryOff>Dercq Jean-Philippe</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="1">
   <DateSeq>2</DateSeq>
   <MatchNo>29</MatchNo>
   <NumSets>3</NumSets>
   <Player1>14d661c4-66b8-42ef-aec4-c5b2bc3ca8b1</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>031c5131-90b3-476b-af16-4e0ffb051587</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>975617c8-12fe-44fc-b969-bb682f0b15be</OfficialId>
   <CourtId>1</CourtId>
   <Winner>2</Winner>
   <LongScore>6/3 6/2</LongScore>
   <npA>Eysseric Jonathan</npA>
   <npA2></npA2>
   <npB>Pavel Andrei</npB>
   <npB2></npB2>
   <Country1>FRA</Country1>
   <Country1a></Country1a>
   <Country2>ROU</Country2>
   <Country2a></Country2a>
   <CountryOff></CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
 </court>
 <court>
  <eintrag id="2">
   <DateSeq>2</DateSeq>
   <MatchNo>19</MatchNo>
   <NumSets>3</NumSets>
   <Player1>9ca5e191-0922-4521-b8bc-8444b6411bc1</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>b11c3f35-dccc-4297-9282-095678996a6f</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>dc78ff2d-8dd9-4eda-b8d2-81c5bac760be</OfficialId>
   <CourtId>2</CourtId>
   <Winner>2</Winner>
   <LongScore>7/5 1/6 6/4</LongScore>
   <npA>Fraile Gorka</npA>
   <npA2></npA2>
   <npB>Seppi Andreas</npB>
   <npB2></npB2>
   <Country1>ESP</Country1>
   <Country1a></Country1a>
   <Country2>ITA</Country2>
   <Country2a></Country2a>
   <CountryOff>Dumusois Damien</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="2">
   <DateSeq>2</DateSeq>
   <MatchNo>23</MatchNo>
   <NumSets>3</NumSets>
   <Player1>16ac28f7-b261-41fb-993b-a03c42307cc5</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>4b59fa24-f0f6-491a-8210-01d13b8ec894</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>ce71ba19-70c4-4f9f-ad71-736ec42921e6</OfficialId>
   <CourtId>2</CourtId>
   <Winner>2</Winner>
   <LongScore>6/2 6/3</LongScore>
   <npA>Fognini Fabio</npA>
   <npA2></npA2>
   <npB>Galvani Stefano</npB>
   <npB2></npB2>
   <Country1>ITA</Country1>
   <Country1a></Country1a>
   <Country2>ITA</Country2>
   <Country2a></Country2a>
   <CountryOff>Thiemann Michael</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="2">
   <DateSeq>2</DateSeq>
   <MatchNo>27</MatchNo>
   <NumSets>3</NumSets>
   <Player1>7fa01731-af7f-4121-8794-9d9ed342a07f</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>a1632ec1-decd-4abe-937a-dedf7c93f7a3</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>04484905-52ab-41d4-b374-f1ecf638c2be</OfficialId>
   <CourtId>2</CourtId>
   <Winner>2</Winner>
   <LongScore>6/3 3/6 6/3</LongScore>
   <npA>Roger-Vasselin Edouard</npA>
   <npA2></npA2>
   <npB>Kunitsyn Igor</npB>
   <npB2></npB2>
   <Country1>FRA</Country1>
   <Country1a></Country1a>
   <Country2>RUS</Country2>
   <Country2a></Country2a>
   <CountryOff>Stellabotte Nicholas</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="2">
   <DateSeq>2</DateSeq>
   <MatchNo>28</MatchNo>
   <NumSets>3</NumSets>
   <Player1>bd3b8367-18f4-4cff-a835-e45107e7c41e</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>622fca60-51b8-453e-8926-60e32e2af642</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>1b39dbf3-b5cf-4715-b9f0-a12a0c91b0b7</OfficialId>
   <CourtId>2</CourtId>
   <Winner>2</Winner>
   <LongScore>6/4 7/6(7/5)</LongScore>
   <npA>Hernandez Oscar</npA>
   <npA2></npA2>
   <npB>Haehnel Jerome</npB>
   <npB2></npB2>
   <Country1>ESP</Country1>
   <Country1a></Country1a>
   <Country2>FRA</Country2>
   <Country2a></Country2a>
   <CountryOff>Solarino Giuseppe</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
 </court>
 <court>
  <eintrag id="3">
   <DateSeq>2</DateSeq>
   <MatchNo>16</MatchNo>
   <NumSets>3</NumSets>
   <Player1>ed9a5c6e-c1e5-4b3d-a319-5450449b208e</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>23dbabbe-8487-4ef5-a15b-51b483c08f35</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>a15b1952-df2a-4d1e-b610-de5b30666f37</OfficialId>
   <CourtId>3</CourtId>
   <Winner>1</Winner>
   <LongScore>6/3 6/3</LongScore>
   <npA>Kohlschreiber Philipp</npA>
   <npA2></npA2>
   <npB>Vik Robin</npB>
   <npB2></npB2>
   <Country1>GER</Country1>
   <Country1a></Country1a>
   <Country2>CZE</Country2>
   <Country2a></Country2a>
   <CountryOff>Mourier Cedric</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="3">
   <DateSeq>2</DateSeq>
   <MatchNo>17</MatchNo>
   <NumSets>3</NumSets>
   <Player1>7ae8d8b7-71a0-4263-9217-7083cde434be</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>913c2118-e3c9-40df-a91e-af6f95e62d02</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>0b556b8a-7312-49bd-9591-390ff82aaeda</OfficialId>
   <CourtId>3</CourtId>
   <Winner>2</Winner>
   <LongScore>6/4 6/2</LongScore>
   <npA>Lorenzi Paolo</npA>
   <npA2></npA2>
   <npB>Bozoljac Ilia</npB>
   <npB2></npB2>
   <Country1>ITA</Country1>
   <Country1a></Country1a>
   <Country2>SRB</Country2>
   <Country2a></Country2a>
   <CountryOff>Zaloga Gabriela</CountryOff>
   <EventId>3</EventId>
   <IsDoubles></IsDoubles>
  </eintrag>
  <eintrag id="3">
   <DateSeq>2</DateSeq>
   <MatchNo>24</MatchNo>
   <NumSets>3</NumSets>
   <Player1>6f8d7530-5b94-44ac-8cca-df86a72948c9</Player1>
   <Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
   <Player2>e15216e5-e6e5-4567-ab3e-73319c10a0ef</Player2>
   <Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
   <OfficialId>572ea728-a8be-4d6f-8182-98fe0f4abf3c</OfficialId>
   <CourtId>3</CourtId>
   <Winner>2</Winner>
   <LongScore>4/6 7/6(7/5) 4/1 Ret'd</LongScore>
<npA>Hernych Jan</npA>
<npA2></npA2>
<npB>Portas Albert</npB>
<npB2></npB2>
<Country1>CZE</Country1>
<Country1a></Country1a>
<Country2>ESP</Country2>
<Country2a></Country2a>
<CountryOff>Leicher Mike</CountryOff>
<EventId>3</EventId>
<IsDoubles></IsDoubles>
</eintrag>
<eintrag id="3">
<DateSeq>2</DateSeq>
<MatchNo>25</MatchNo>
<NumSets>3</NumSets>
<Player1>66c4ecf6-c5b7-47f0-aa47-76b8bde68fbd</Player1>
<Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
<Player2>dc9bc7ad-53d8-410f-9953-d8b11648e11e</Player2>
<Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
<OfficialId>408c8349-2ab9-44ec-af39-a59bf1e4e644</OfficialId>
<CourtId>3</CourtId>
<Winner>2</Winner>
<LongScore>6/3 2/6 6/3</LongScore>
<npA>Granollers-Pujol Marcel</npA>
<npA2></npA2>
<npB>Falla Alejandro</npB>
<npB2></npB2>
<Country1>ESP</Country1>
<Country1a></Country1a>
<Country2>COL</Country2>
<Country2a></Country2a>
<CountryOff></CountryOff>
<EventId>3</EventId>
<IsDoubles></IsDoubles>
</eintrag>
</court>
<court>
<eintrag id="4">
<DateSeq>2</DateSeq>
<MatchNo>18</MatchNo>
<NumSets>3</NumSets>
<Player1>298badad-81c1-49e3-b382-24859c85709e</Player1>
<Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
<Player2>a8bef101-76b6-4523-9c31-cb068201facc</Player2>
<Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
<OfficialId>5f035aeb-f308-4270-9914-5e6e3653b63b</OfficialId>
<CourtId>4</CourtId>
<Winner>1</Winner>
<LongScore>6/2 6/2</LongScore>
<npA>Garcia-Lopez Guillermo</npA>
<npA2></npA2>
<npB>Bastl George</npB>
<npB2></npB2>
<Country1>ESP</Country1>
<Country1a></Country1a>
<Country2>SUI</Country2>
<Country2a></Country2a>
<CountryOff></CountryOff>
<EventId>3</EventId>
<IsDoubles></IsDoubles>
</eintrag>
<eintrag id="4">
<DateSeq>2</DateSeq>
<MatchNo>20</MatchNo>
<NumSets>3</NumSets>
<Player1>e7281f53-17fa-4ef2-a3db-b612f87233da</Player1>
<Player1a>00000000-0000-0000-ffff-000000000000</Player1a>
<Player2>a3727fd7-7a5a-4f22-930d-dc1866bab4d8</Player2>
<Player2a>00000000-0000-0000-ffff-000000000000</Player2a>
<OfficialId>8f885e1f-4b87-40ef-af15-b8823ba9d2c6</OfficialId>
<CourtId>4</CourtId>
<Winner>1</Winner>
<LongScore>6/3 3/6 6/4</LongScore>
<npA>Gabashvili Teimuraz</npA>
<npA2></npA2>
<npB>Drouet Thomas</npB>
<npB2></npB2>
<Country1>RUS</Country1>
<Country1a></Country1a>
<Country2>MON</Country2>
<Country2a></Country2a>
<CountryOff>Gabas Arnaud</CountryOff>
<EventId>3</EventId>
<IsDoubles></IsDoubles>
</eintrag>
</court>
</glossar>
XSL-Content:
Delphi-Quellcode:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
 <html>
 <head>
  <link rel="stylesheet" href="index.css" type="text/css" />
 </head>

 <body onselectstart="return false" onDragStart="return false" onDrop="return false">

 <table class="match" cellpadding="0" cellspacing="0" align="center" width="100%">
  <tr><th colspan="4">Court 1</th></tr>
  <tr>
   <th class="small">No.</th>
   <th class="small">Player A</th>
   <th class="small">Player B</th>
   <th class="small">Result</th>
  </tr>
 <xsl:for-each select="glossar/court/eintrag">
  <xsl:if test="CourtId='1'">
   <tr>
    <td width="5%" valign="top"><xsl:value-of select="MatchNo" /></td>
    <td width="35%" valign="top"><xsl:value-of select="npA" /></td>
    <td width="35%" valign="top"><xsl:value-of select="npB" /></td>
    <td width="25%" valign="top"><xsl:value-of select="LongScore" /></td>
   </tr>
   <tr><td colspan="4">Umpire: <xsl:value-of select="OfficialId" /></td></tr>
  </xsl:if>
 </xsl:for-each>
 </table>


 </body>
 </html>
 </xsl:template>
</xsl:stylesheet>
Danke
Tom
  Mit Zitat antworten Zitat
Benutzerbild von Tiuri
Tiuri

Registriert seit: 22. Sep 2006
Ort: Celle
38 Beiträge
 
Delphi 2005 Personal
 
#3

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 09:23
Ich würde das Attribut id von eintrag und den Tag courtid von eintrag entfernen und dafür dem Tag court das Attribut id geben.
Die XSL-Datei würde dann so aussehen:
XML-Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
 <html>
  <head>
  </head>
  <body onselectstart="return false" onDragStart="return false" onDrop="return false">
    <xsl:apply-templates />
  </body>
 </html>
</xsl:template>

<xsl:template match="court">
<table class="match" cellpadding="0" cellspacing="0" align="center" width="100%">
 <tr><th colspan="4">Court <xsl:value-of select="./@id" /></th></tr>
 <tr>
  <th class="small">No.</th>
  <th class="small">Player A</th>
  <th class="small">Player B</th>
  <th class="small">Result</th>
 </tr>
 <xsl:for-each select="./eintrag">
  <tr>
   <td width="5%" valign="top"><xsl:value-of select="MatchNo" /></td>
   <td width="35%" valign="top"><xsl:value-of select="npA" /></td>
   <td width="35%" valign="top"><xsl:value-of select="npB" /></td>
   <td width="25%" valign="top"><xsl:value-of select="LongScore" /></td>
  </tr>
  <tr><td colspan="4">Umpire: <xsl:value-of select="OfficialId" /></td></tr>
 </xsl:for-each>
</table>
</xsl:template>

</xsl:stylesheet>
wobei hier jeder Court dargestellt wird.
Wie du nur bestimmte Courts darstellst, kannst du bei SelfHTML nachlesen
  Mit Zitat antworten Zitat
torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#4

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 09:35
Genau das war es, was ich brauchte. Ich werde den Code studieren und meine Lehren daraus ziehen!
Vielen vielen Dank!
Danke
Tom
  Mit Zitat antworten Zitat
Benutzerbild von Tiuri
Tiuri

Registriert seit: 22. Sep 2006
Ort: Celle
38 Beiträge
 
Delphi 2005 Personal
 
#5

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 10:52
das hab ich noch vergessen:
XML-Code:
<xsl:for-each select="./eintrag">
  <tr>
   <td width="5%" valign="top"><xsl:value-of select="./MatchNo" /></td>
   <td width="35%" valign="top"><xsl:value-of select="./npA" /></td>
   <td width="35%" valign="top"><xsl:value-of select="./npB" /></td>
   <td width="25%" valign="top"><xsl:value-of select="./LongScore" /></td>
  </tr>
  <tr><td colspan="4">Umpire: <xsl:value-of select="./OfficialId" /></td></tr>
</xsl:for-each>
ohne das "./" könnte es eventuell sein, dass die falschen Daten eingelesen werden.

Bitte, bitte, das ist das erste Mal, das ich hier jemandem helfen konnte.
  Mit Zitat antworten Zitat
torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#6

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 12:53
Es ging auch ohne ./
Aber danke trotzdem. Ist doch ein schönes Gefühl, wenn man helfen kann, oder!?
Danke
Tom
  Mit Zitat antworten Zitat
Benutzerbild von Tiuri
Tiuri

Registriert seit: 22. Sep 2006
Ort: Celle
38 Beiträge
 
Delphi 2005 Personal
 
#7

Re: Benoetige Hilfe bei der Erstellung einer XSL-Datei

  Alt 26. Apr 2007, 13:27
aber immer!
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:34 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz