This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Non-well-formed HTML in XSL


Thanks a lot for the previous help. Template matching makes more sense
now.

I would like to print HTML that will (eventually) be well-formed. However,
the XSL to display it is not well-formed and thus I get an error. What I
need is a way to tell XSL to disregard the non-well-formedness of the HTML
I'm writing.

--------
some.xsl
--------

<table>

  <tr><td>
    <xsl:attribute name="rowspan">
      <xsl:value-of select="count(meet)"/>
    </xsl:attribute>

      <xsl:value-of select="../instructor"/>
  </td>

  <xsl:for-each select="meet">

    <xsl:if test="ancestor::node()[position() != 1]">
      </tr><tr>   # this is the problem
    </xsl:if>

    <td>some info</td>

  </xsl:for-each>

  </tr>

</table>

--------
What I want the HTML to look like
--------
<table>

  <tr>
    <td rowspan="2">Johnson</td>
    <td>some info</td>
  </tr>
  <tr>
    <td>some info</td>
  </tr>

  <tr>
    <td rowspan="2">Galbraith</td>
    <td>some info</td>
  </tr>

</table>

---------
sample XML input
---------

      <course>
        <title>Early Childhood Development</title>
        <subject>EDUC</subject>
        <number>104</number>
        <section>010</section>
        <instructor>Phillips</instructor>

        <meets>
          <meet>
            <format>LEC</format>
            <building>SMI</building>
            <room>205</room>
            <days>MWF</days>
            <starts>1100</starts>
            <ends>1230</ends>
          </meet>


_ryan


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]