DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: XML & XSL = HTML (well sort of)

  1. #1
    rob Guest

    XML & XSL = HTML (well sort of)


    I'm having a bit of a problem generating tables using XML & XSL. I get my
    XML from the ADO 2.5 recordset and I'm trying to generate an HTML table.
    Everything works fine except, empty when the recordset returns null values
    in the result set. This means that my <TD> elements are generate as <TD></TD>
    and so don't appear with cell borders in the browser. I think I need at
    least a non-breaking space between the cell but my XSL parser (MS DOM) complains.
    Does any know how to get XSL to insert a &nbsp;

    Thanks

    rob.

  2. #2
    Ken Myers Guest

    Re: XML & XSL = HTML (well sort of)


    I've been struggling with the same issue myself. No one has yet offered any
    suggestions that work. There are at least 2 other requests in here for the
    exact same help. Good luck.


    "rob" <EvolutionComputing@hotmail.com> wrote:
    >
    >I'm having a bit of a problem generating tables using XML & XSL. I get

    my
    >XML from the ADO 2.5 recordset and I'm trying to generate an HTML table.
    > Everything works fine except, empty when the recordset returns null values
    >in the result set. This means that my <TD> elements are generate as <TD></TD>
    >and so don't appear with cell borders in the browser. I think I need at
    >least a non-breaking space between the cell but my XSL parser (MS DOM) complains.
    > Does any know how to get XSL to insert a
    >
    >Thanks
    >
    >rob.



  3. #3
    Adriano Guest

    Re: XML & XSL = HTML (well sort of)


    Have you tried <![CDATA["&nbsp"]]> in the XSL?

    Alternatively, what about IsNull(<dbfield>, "&nbsp") in the SQL?

    "Ken Myers" <Ken.Myers@Frontstep.com> wrote:
    >
    >I've been struggling with the same issue myself. No one has yet offered

    any
    >suggestions that work. There are at least 2 other requests in here for

    the
    >exact same help. Good luck.
    >
    >
    >"rob" <EvolutionComputing@hotmail.com> wrote:
    >>
    >>I'm having a bit of a problem generating tables using XML & XSL. I get

    >my
    >>XML from the ADO 2.5 recordset and I'm trying to generate an HTML table.
    >> Everything works fine except, empty when the recordset returns null values
    >>in the result set. This means that my <TD> elements are generate as <TD></TD>
    >>and so don't appear with cell borders in the browser. I think I need at
    >>least a non-breaking space between the cell but my XSL parser (MS DOM)

    complains.
    >> Does any know how to get XSL to insert a
    >>
    >>Thanks
    >>
    >>rob.

    >



  4. #4
    sean Guest

    Re: XML & XSL = HTML (well sort of)


    already dealt with check out

    http://news.devx.com/cgi-bin/dnewswe...md_related.y=8


    Sean



    "Ken Myers" <Ken.Myers@Frontstep.com> wrote:
    >
    >I've been struggling with the same issue myself. No one has yet offered

    any
    >suggestions that work. There are at least 2 other requests in here for

    the
    >exact same help. Good luck.
    >
    >
    >"rob" <EvolutionComputing@hotmail.com> wrote:
    >>
    >>I'm having a bit of a problem generating tables using XML & XSL. I get

    >my
    >>XML from the ADO 2.5 recordset and I'm trying to generate an HTML table.
    >> Everything works fine except, empty when the recordset returns null values
    >>in the result set. This means that my <TD> elements are generate as <TD></TD>
    >>and so don't appear with cell borders in the browser. I think I need at
    >>least a non-breaking space between the cell but my XSL parser (MS DOM)

    complains.
    >> Does any know how to get XSL to insert a
    >>
    >>Thanks
    >>
    >>rob.

    >



  5. #5
    MartinR Guest

    Re: XML & XSL = HTML (well sort of)


    You may even check for empty elements within the XSL and insert optional cahracters
    (e.g. "-") when it is empty

    Here's an example that works with the msxml 1.0 spec. Be aware that some
    commands are different when using the 3.0 (no "when match" but "if" etc.)

    Fieldname is the Tag to check for.

    <xsl:choose>
    <xsl:when match=".[Fieldname!=' ']">
    <TD><FONT FACE="Arial" SIZE="1"><xsl:value-of select="Fieldname"/>
    </FONT></TD>
    </xsl:when>
    <xsltherwise>
    <TD><FONT FACE="Arial" SIZE="1">-</FONT></TD>
    </xsltherwise>
    </xsl:choose>



    Hope this helps
    Martin

    "Ken Myers" <Ken.Myers@Frontstep.com> wrote:
    >
    >I've been struggling with the same issue myself. No one has yet offered

    any
    >suggestions that work. There are at least 2 other requests in here for

    the
    >exact same help. Good luck.
    >
    >
    >"rob" <EvolutionComputing@hotmail.com> wrote:
    >>
    >>I'm having a bit of a problem generating tables using XML & XSL. I get

    >my
    >>XML from the ADO 2.5 recordset and I'm trying to generate an HTML table.
    >> Everything works fine except, empty when the recordset returns null values
    >>in the result set. This means that my <TD> elements are generate as <TD></TD>
    >>and so don't appear with cell borders in the browser. I think I need at
    >>least a non-breaking space between the cell but my XSL parser (MS DOM)

    complains.
    >> Does any know how to get XSL to insert a
    >>
    >>Thanks
    >>
    >>rob.

    >



  6. #6
    Lou K Guest

    Re: XML & XSL = HTML (well sort of)


    >> Does any know how to get XSL to insert a non-blank space?


    Instead of instinctively trying to use &nbsp;
    (which won't work because you have no entity declaration
    for nbsp), use the code &#160;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center