如何使用XSLT 1将XML转换为HTML表?

时间:2017-03-28 15:49:13

标签: html xslt xslt-1.0

我有一个非常简单的XML文件,其中包含多个packages: yum: libxslt-devel: [] libxml2-devel: [] libjpeg-devel: [] zlib1g-devel: [] libpng12-devel: [] container_commands: 01_setup_newspaper: command: mkdir -p /home/wsgi/.newspaper_scraper/memoized && chmod 644 /home/wsgi/.newspaper_scraper/memoized 个节点。每个人都包含newspaper<Elem><Label>

例如:

<RowNumber>

假设<ColOrder>节点已经在RowNumber上排序,ColOrder升序,我们的想法是生成一个HTML表格,如:

<Root>
    <Elem>
      <Label>David</Label>
      <RowNumber>1</RowNumber>
      <ColOrder>1</ColOrder>
    </Elem>
    <Elem>
      <Label>John</Label>
      <RowNumber>1</RowNumber>
      <ColOrder>2</ColOrder>
    </Elem>
    <Elem>
      <Label>Brian</Label>
      <RowNumber>1</RowNumber>
      <ColOrder>3</ColOrder>
    </Elem>
    <Elem>
      <Label>Emily</Label>
      <RowNumber>2</RowNumber>
      <ColOrder>1</ColOrder>
    </Elem>
    <Elem>
      <Label>Donald</Label>
      <RowNumber>2</RowNumber>
      <ColOrder>2</ColOrder>
    </Elem>
</Root>

我试图将max RowNumber存储在变量中并循环遍历它,但看起来它不是在XSLT中执行的正确方法。

如何在XSLT 1中完成?

0 个答案:

没有答案