juls_pro_37: XSLT 1.0 Nummerierung (count)

Beitrag lesen

hi, dachte so wäre es einfacher zu erkennen. wenn ich Test bei der LineNumSalesLine hinzufüge.

Bei all den Lines mit <LineNumSalesLineTest> muss gezählt werden, wie viele <LineNumSalesLine> vorhanden sind und immer fortlaufend nummerieren; bekomme aber immer nur den Wert "9" ausgegeben.

Gezählt werden soll also die Anzahl der <LineNumSalesLine> unter dem Knoten "Item". (diese ist 8x vorhanden)

So sollte es korrekt aussehen: (Beispiel: LineNum 8 hat somit die LineNumSalesLineTest 9, LineNum9 hat die LineSumSalesLineTest 10,...)

XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrderResponse>
   <Interchange>
      <Interchange_Control_Number>5637334349</Interchange_Control_Number>
   </Interchange>
   <HeaderInformation>
      <ConfirmDocNum>SO0001084-3</ConfirmDocNum>
   </HeaderInformation>
   <LineInformation>
      <Item>
         <LineNum>1</LineNum>
         <SupplierArticleNumber>P0003975A</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0003975A</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S02754</BuyerArticleNumber>
         <LineNumSalesLine>1</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>2</LineNum>
         <SupplierArticleNumber>P0090610</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0090610</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S29648</BuyerArticleNumber>
         <LineNumSalesLine>2</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>3</LineNum>
         <SupplierArticleNumber>P0090631</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0090631</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S29649</BuyerArticleNumber>
         <LineNumSalesLine>3</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>4</LineNum>
         <SupplierArticleNumber>P0090611</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0090611</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S29652</BuyerArticleNumber>
         <LineNumSalesLine>4</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>5</LineNum>
         <SupplierArticleNumber>P0090615</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0090615</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S29657</BuyerArticleNumber>
         <LineNumSalesLine>5</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>6</LineNum>
         <SupplierArticleNumber>P0090635</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0090635</OrigSupplierArticleNumber>
         <BuyerArticleNumber>S29664</BuyerArticleNumber>
         <LineNumSalesLine>6</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>7</LineNum>
         <SupplierArticleNumber>P0003200A</SupplierArticleNumber>
         <OrigSupplierArticleNumber>P0003200A</OrigSupplierArticleNumber>
         <LineNumSalesLine>7</LineNumSalesLine>
      </Item>
      <Item>
         <LineNum>8</LineNum>
         <SupplierArticleNumber>P0001555</SupplierArticleNumber>
         <LineNumSalesLineTest>9</LineNumSalesLineTest>
      </Item>
      <Item>
         <LineNum>9</LineNum>
         <SupplierArticleNumber>P0009051</SupplierArticleNumber>
         <LineNumSalesLineTest>10</LineNumSalesLineTest>
      </Item>
      <Item>
         <LineNum>10</LineNum>
         <SupplierArticleNumber>P0009068</SupplierArticleNumber>
         <LineNumSalesLineTest>11</LineNumSalesLineTest>
      </Item>
      <Item>
         <LineNum>11</LineNum>
         <SupplierArticleNumber>P0075511</SupplierArticleNumber>
         <LineNumSalesLineTest>12</LineNumSalesLineTest>
      </Item>
      <Item>
         <LineNum>12</LineNum>
         <SupplierArticleNumber>P0001113</SupplierArticleNumber>
         <LineNumSalesLineTest>13</LineNumSalesLineTest>
      </Item>
      <Item>
         <LineNum>13</LineNum>
         <SupplierArticleNumber>P00MESD2</SupplierArticleNumber>
         <OrigSupplierArticleNumber>EDIPER</OrigSupplierArticleNumber>
         <LineNumSalesLine>9</LineNumSalesLine>
      </Item>
      <Item>
         <LineChange>7</LineChange>
         <LineNum>14</LineNum>
         <SupplierArticleNumber>EDIPER</SupplierArticleNumber>
         <LineNumSalesLine>9</LineNumSalesLine>
         <LineText>
            <Qualifier>ZZZ</Qualifier>
            <Text>Article remplace par P00MESD2</Text>
         </LineText>
      </Item>
      <Item>
         <LineChange>7</LineChange>
         <LineNum>15</LineNum>
         <GTIN>3660965369511</GTIN>
         <SupplierArticleNumber>BKPROL150</SupplierArticleNumber>
         <LineNumSalesLine>8</LineNumSalesLine>
      </Item>
   </LineInformation>
</OrderResponse>

LG Julian