XML & MSIE: Use of default namespace declaration attribute in DTDnot supported.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tjerk Wolterink

    XML & MSIE: Use of default namespace declaration attribute in DTDnot supported.

    When i open the following xml file in internetexplore r:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE xc:content [
    <!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    %xhtml;
    ]>

    <xc:xcontent xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent" xmlns="http://www.w3.org/1999/xhtml" module="gastenb oek">
    <xc:bericht>
    <xc:id>1</xc:id>
    <xc:naam type="string">< ![CDATA[Tjerk Wolterink]]></xc:naam>
    <xc:email type="email"><![CDATA[tjerk@wolterink webdesign.com]]></xc:email>
    <xc:rating type="option">
    <xc:empty/>
    </xc:rating>
    <xc:content type="text">
    Ik moet zeggen je hebt er een mooi werkje van gemaakt<br />
    Zeker dat xml buttontje onderin maakt het compleet
    </xc:content>
    </xc:bericht>
    </xc:xcontent>

    Then internet explorer says the following:

    ------
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


    --------------------------------------------------------------------------------

    Use of default namespace declaration attribute in DTD not supported. Error processing resource 'http://tjerk.wolterink webde...
    ------


    What am i doing wrong??
  • David Carlisle

    #2
    Re: XML &amp; MSIE: Use of default namespace declaration attribute in DTD not supported.

    [color=blue]
    > What am i doing wrong??[/color]

    Nothing.

    When MSXML says

    Use of default namespace declaration attribute in DTD not supported.

    They mean,
    "We know this is a legal construct, but we are not going to support it"


    You can modify the xhtml dtd so it does work in IE (eg the XHTML+MathML
    one at

    works
    but since your input file clearly isn't XHTML, why have the DTD
    reference at all?

    David

    Comment

    • Tjerk Wolterink

      #3
      Re: XML &amp; MSIE: Use of default namespace declaration attribute inDTD not supported.

      David Carlisle wrote:
      [color=blue][color=green]
      >>What am i doing wrong??[/color]
      >
      >
      > Nothing.
      >
      > When MSXML says
      >
      > Use of default namespace declaration attribute in DTD not supported.
      >
      > They mean,
      > "We know this is a legal construct, but we are not going to support it"
      >
      >
      > You can modify the xhtml dtd so it does work in IE (eg the XHTML+MathML
      > one at
      > http://www.w3.org/Math/DTD/
      > works
      > but since your input file clearly isn't XHTML, why have the DTD
      > reference at all?
      >
      > David[/color]


      Because it can contain html, the xml is generated from a database,
      this xml file is then put in an xsl file, and that xsl file should
      not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.

      Comment

      • David Carlisle

        #4
        Re: XML &amp; MSIE: Use of default namespace declaration attribute in DTD not supported.

        Tjerk Wolterink <tjerk@wolterin kwebdesign.com> writes:
        [color=blue]
        > Because it can contain html, the xml is generated from a database,
        > this xml file is then put in an xsl file, and that xsl file should
        > not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.[/color]

        Yes but unless your DTD reference declares _all_ of the elements used,
        not just the XHTML ones, the file will not be dtd-valid anyway so
        there's not much to be gained in having a DTD at all.

        The only thing that can be gained is defaulting of the xhtml namespace
        declarations and that can't be made to work in IE. As the message said
        it is an intentional non-conformance by MS.

        The namespace Rec incidentally does advise against defaulting namespace
        declarations. This also would fail with mozilla, for different reasons,
        mozilla does not read external dtd files, so would never see the default
        namespace declaration.

        Can't you modify your generation from the datatabase so that your top
        level element has
        xmlns="http://www.w3.org/199/xhtml"
        which is all you need to ensure that unprefixed html elements are XHTML
        and matched by your stylesheet.



        David

        Comment

        • Tjerk Wolterink

          #5
          Re: XML &amp; MSIE: Use of default namespace declaration attribute inDTD not supported.

          David Carlisle wrote:
          [color=blue]
          > Tjerk Wolterink <tjerk@wolterin kwebdesign.com> writes:
          >
          >[color=green]
          >>Because it can contain html, the xml is generated from a database,
          >>this xml file is then put in an xsl file, and that xsl file should
          >>not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.[/color]
          >
          >
          > Yes but unless your DTD reference declares _all_ of the elements used,
          > not just the XHTML ones, the file will not be dtd-valid anyway so
          > there's not much to be gained in having a DTD at all.
          >
          > The only thing that can be gained is defaulting of the xhtml namespace
          > declarations and that can't be made to work in IE. As the message said
          > it is an intentional non-conformance by MS.
          >
          > The namespace Rec incidentally does advise against defaulting namespace
          > declarations. This also would fail with mozilla, for different reasons,
          > mozilla does not read external dtd files, so would never see the default
          > namespace declaration.
          >
          > Can't you modify your generation from the datatabase so that your top
          > level element has
          > xmlns="http://www.w3.org/199/xhtml"
          > which is all you need to ensure that unprefixed html elements are XHTML
          > and matched by your stylesheet.
          >
          >
          >
          > David[/color]

          i do not follow you there.

          My top level element has xmlns="http://www.w3.org/1999/xhtml"

          Here look at the xml:

          ===
          <?xml version="1.0" encoding="ISO-8859-1"?>

          <!DOCTYPE xc:content [
          <!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
          %xhtml;
          ]>

          <xc:xcontent xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent" xmlns="http://www.w3.org/1999/xhtml" module="gastenb oek">
          <xc:bericht>
          <xc:id>1</xc:id>
          <xc:naam type="string">< ![CDATA[Tjerk Wolterink]]></xc:naam>
          <xc:email type="email"><![CDATA[tjerk@wolterink webdesign.com]]></xc:email>
          <xc:rating type="option">
          <xc:empty/>
          </xc:rating>
          <xc:content type="text">
          Ik moet zeggen je hebt er een mooi werkje van gemaakt<br />
          Zeker dat xml buttontje onderin maakt het compleet
          </xc:content>
          </xc:bericht>
          </xc:xcontent>
          ===


          I do not have a DTD for the <xc: namespace, i'm planning to build a xsd for the xml format.
          But i do use :
          <!DOCTYPE xc:content [
          <!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
          %xhtml;
          ]>


          Because the <xc:content xml file can contain xhtml entities, if i do not add this doctype declaration
          then my xsl parser will complain (the xslt processor does not now &nbsp; therefore i have the doctype declaration).

          So what do you exactly mean, how can i solve this problem?

          Comment

          • Richard Tobin

            #6
            Re: XML &amp; MSIE: Use of default namespace declaration attribute inDTD not supported.

            In article <41b5e4bc$0$307 06$18b6e80@news .wanadoo.nl>,
            Tjerk Wolterink <tjerk@wolterin kwebdesign.com> wrote:
            [color=blue]
            >Because the <xc:content xml file can contain xhtml entities, if i do not
            >add this doctype declaration
            >then my xsl parser will complain (the xslt processor does not now &nbsp;
            >therefore i have the doctype declaration).[/color]

            You can just include the entity definition part of the DTD instead:

            <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
            "xhtml-lat1.ent">
            %HTMLlat1;

            <!ENTITY % HTMLsymbol PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
            "xhtml-symbol.ent">
            %HTMLsymbol;

            <!ENTITY % HTMLspecial PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
            "xhtml-special.ent">
            %HTMLspecial;

            -- Richard

            Comment

            • David Carlisle

              #7
              Re: XML &amp; MSIE: Use of default namespace declaration attribute in DTD not supported.

              [color=blue]
              >My top level element has xmlns="http://www.w3.org/1999/xhtml"[/color]

              so it has. Sorry.



              Because the <xc:content xml file can contain xhtml entities, if i do not add this doctype declaration
              then my xsl parser will complain (the xslt processor does not now &nbsp; therefore i have the doctype declaration).


              If you only need the entity definitions then you can just include those,
              you don't need the full XHTML dtd

              eg:

              <!DOCTYPE xc:content [
              <!ENTITY % HTMLlat1 PUBLIC
              "-//W3C//ENTITIES Latin 1 for XHTML//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
              %HTMLlat1;

              <!ENTITY % HTMLsymbol PUBLIC
              "-//W3C//ENTITIES Symbols for XHTML//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
              %HTMLsymbol;

              <!ENTITY % HTMLspecial PUBLIC
              "-//W3C//ENTITIES Special for XHTML//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
              %HTMLspecial;
              ]>
              <xc:content.. .

              possibly replacing http://www.w3.org/TR/xhtml1/DTD/ by a URI to a local
              copy on your file system, to save hitting a remote server every time.

              Or as I say you can use a version of teh XHTMl DTD that works with IE, eg


              <!DOCTYPE xc:content SYSTEM "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">"
              <xc:content.. .

              but that's a rather big DTD to download every time if you just want the
              HTMl entities.

              David

              Comment

              Working...