Menu

#51 NUnitASp performs web requests when using XHTML

open
nobody
None
5
2006-06-25
2006-06-25
No

Hi, I'm using a verion that I built by compiing the
HEAD from the souce code in CVS and I turned on a
sniffer and found out that when my ASP.net 2.0 pages
are set to use XHTML 1.0 like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xht
ml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
...
</html>

NUnitAsp makes the following reuqests to the web:

www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
www.w3.org/TR/xhtml1/DTD/xhtml-special.ent

XHTML is the default for ASP.Net 2.0 pages, if I
change back the DOCTYPE to DHTML 4.0 like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<html>
...
</html>

Then the problem goes away. The issue is that we
would loke to use XHTML but all those extra web
requests end up slowing down the tests.

Cheers

Gabo

Discussion

  • Douglas de la Torre

    Logged In: YES
    user_id=779209

    This bug is related to bug 1027754.

    I'm seeing similar problems that manifest as a DTD
    validation error ("The remote name could not be resolved")
    when I use NUnitAsp offline (no internet connection). I'm
    guessing that adding the DTDs programmatically somehow to
    the XmlDocument so it can resolve them when it calls Load
    would fix this bug (no longer needing to make outside
    calls to resolve the DTD), and also eliminate the issue in
    bug 1027754 where it fails to parse a given DTD.

     
  • Douglas de la Torre

    Logged In: YES
    user_id=779209

    I found that NUnit.Extensions.Asp.WebPage.ParsePageText()
    can be modified with a null XmlResolver to fix this issue:

    try
    {
    this.document.XmlResolver = null; // <-- add this line
    this.document.Load(reader1);
    }

    turns out others on the web have had this problem and used
    this approach to fix it.

    http://www.thescripts.com/forum/thread176851.html

     
  • Moritz Both

    Moritz Both - 2008-09-12

    When the machine has no internet connection, these request will result in an obscure failure of all tests:
    NUnit.Extensions.Asp.DoctypeDtdException :
    Problems with DOCTYPE DTD: <Timeout für Vorgang überschritten>. Your DOCTYPE is
    probably incorrect. If you're not sure what the DOCTYPE should be, use <!DOCTY
    PE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >, Visual Studio .NET's d
    efault.

    Also related: This creates a lot of completely unneccessary traffic, see:
    http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic

     

Log in to post a comment.

MongoDB Logo MongoDB