frankx: automatischer Tabellenaufbau

Beitrag lesen

Hellihello

Nun ja, die verlinkte Lösung fusst ja auf einer Struktur:

<root>
<a>a1</a>
<b>b1</b>
<c>c1</c>
<a>a2</a>
<b>b2</b>
<c>b2</c>
</root>


>   
> während Du hast:  
> ~~~xml
  

>   
> <root>  
>  <a b="1">a1</a>  
>  <a b="1">b1</a>  
>  <a b="1">c1</a>  
>  <a b="2">a2</a>  
>  <a b="2">b2</a>  
>  <a b="2">c2</a>  
> </root>  
> 

Frage wäre vielleicht auch, ob Du das nur allein mit XSLT lösen musst. Denn der Artikel sagt ja:

Unfortunately products.xml has a flat structure. More specifically, it lacks tags to group all the data pertaining to a given product. One can infer that a new name marks the beginning of a new product, but it's not explicit in the markup.

Und Du hast noch eine flachere Struktur, was die Elemente angeht.

Zumal das verlinkte Beispiel darauf beruht, im Elementenbaum die Geschwister durchzugehen, bis das Element mit einem bestimmten Namen wieder auftaucht.

Dank und Gruß,

frankx

--
tryin to multitain  - Globus = Planet != Welt