XSD and XHTML entity sets.

Discussion in 'XML' started by Theo, Jul 31, 2003.

  1. Theo

    Theo Guest

    Hi,

    On my desktop, I have a copy of both xhtml1-strict.dtd and
    xhtml1-strict.xsd. Using XML Spy, when I try to validate the
    following xhtml code, it works fine with the dtd but not with the xsd:

    <?xml version="1.0"?>
    <html>
    <head>
    <title>A title.</title>
    </head>

    <body>
    <p>&nbsp;</p>
    </body>
    </html>

    I keep getting the error: DTD error - entity 'nbsp' is undefined.
    Does XSD not support the entity sets? (I was reading somewhere that
    XML discourages entity sets other than the built-in 5.) Is there a
    way around this so that I can make the XSD file validate this xml?

    Thanks for any help!
     
    Theo, Jul 31, 2003
    #1
    1. Advertising

  2. > <p>&nbsp;</p>
    [...]
    > I keep getting the error: DTD error - entity 'nbsp' is undefined.
    > Does XSD not support the entity sets?
    >

    You can only define named entities in a DTD (that can be included in the xml
    file).
    If you write   instead of &nbsp; you won't need any named entity
    declaration.

    Jesper

    --
    Jesper Zedlitz eMail :
    Homepage : http://www.zedlitz.de
    ICQ# : 23890711
    PGP-Key : http://zedlitz.de/pub_key.asc
     
    Jesper Zedlitz, Jul 31, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tjerk Wolterink

    [XSL XHTML] &nbsp; entity problem

    Tjerk Wolterink, Mar 18, 2005, in forum: XML
    Replies:
    12
    Views:
    21,773
    Peter Flynn
    Mar 22, 2005
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,741
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    580
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,877
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,244
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page