Entity Declaration Clarification

Discussion in 'XML' started by Ian Rutgers, Jan 22, 2005.

  1. Ian Rutgers

    Ian Rutgers Guest

    If I am using an DTD in an xml file I know to declare an entity I would
    enter;

    <!DOCTYPE letter
    [
    <!ENTITY boilerplate1 = "Thank you for your letter.">
    ]>

    How and where would I declare the entity? (Sorry for the silly
    question)

    Thank you,

    Ian

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ian Rutgers, Jan 22, 2005
    #1
    1. Advertising

  2. Ian Rutgers wrote:

    > If I am using an DTD in an xml file I know to declare an entity I would
    > enter;
    >
    > <!DOCTYPE letter
    > [
    > <!ENTITY boilerplate1 = "Thank you for your letter.">


    That should be
    <!ENTITY boilerplate1 "Thank you for your letter.">

    > ]>
    >
    > How and where would I declare the entity?


    But the above is the declaration, I am not sure what the question is about.
    Do you want to declare an external entity e.g.
    <!ENTITY boilerplate SYSTEM "http://example.com/2005/01/boilerplate.xml">
    ?

    Spec is here:
    <http://www.w3.org/TR/2004/REC-xml-20040204/#sec-external-ent>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 23, 2005
    #2
    1. Advertising

  3. Ian Rutgers

    Ian Rutgers Guest

    I am sorry for not being clear. Can you declare an entity if you are
    not using a DTD (using a schema instead)? (From what I have read you
    must me using a DTD in order to declare an internal entity). If you can
    declare internal entities and not have to use a dtd, please advise.

    Thank you,

    Ian

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ian Rutgers, Jan 23, 2005
    #3
  4. Ian Rutgers wrote:

    > I am sorry for not being clear. Can you declare an entity if you are
    > not using a DTD (using a schema instead)? (From what I have read you
    > must me using a DTD in order to declare an internal entity). If you can
    > declare internal entities and not have to use a dtd, please advise.


    No, you need to have a DOCTYPE declaration and then you can declare an
    entity in the internal subset (the way you had it in your post) or in
    the external subset (e.g. any DTD file referred to by SYSTEM
    "whatever.dtd").
    There is no way to declare an entity without having a DOCTYPE
    declaration in the XML.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 23, 2005
    #4
  5. Ian Rutgers

    Ian Rutgers Guest

    Thank you. Would the general practice be not to use internal entities
    or rather to use some generic dtd along with a schema?

    Thank you,

    Ian

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Ian Rutgers, Jan 23, 2005
    #5
    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. Anoop
    Replies:
    3
    Views:
    461
    Anoop
    Jul 21, 2003
  2. Samuel van Laere

    Entity Name or Entity Number?

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

    Entity, problem with entity key

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

Share This Page