What, exactly, is the 'qualified name' in a DTD declaration?

Discussion in 'XML' started by Simon Brooke, Mar 19, 2007.

  1. Simon Brooke

    Simon Brooke Guest

    The documentation for org.w3c.dom.DOMImplementation.createDocumentType says
    helpfully:

    public DocumentType createDocumentType(java.lang.String qualifiedName,
    java.lang.String publicId,
    java.lang.String systemId)
    throws DOMException

    and goes on to explain:

    Parameters:
    qualifiedNameThe - qualified name of the document type to be created.

    On a 'monkey see, monkey do' basis I've been supplying the string 'html'
    for XHTML documents, and since I've not generated DTD declarations when
    generating other kinds of documents not thought any more about it. But
    what does the 'qualified name' mean, and in what way is it 'qualified'? In
    particular, how does one establish what the correct qualified name is for
    a particular public id, private id pair - or doesn't it matter? Could I
    just use 'froboz' and have it all still work?

    If it does matter, is 'html' actually right?

    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/

    ;; So, before proceeding with definitive screwing, choose the
    ;; position most congenital.
    -- instructions for fitting bicycle handlebars
     
    Simon Brooke, Mar 19, 2007
    #1
    1. Advertising

  2. In article <>,
    Simon Brooke <> wrote:

    > Parameters:
    > qualifiedNameThe - qualified name of the document type to be created.


    Presumably it's the name of the top-level element; as in

    <!DOCTYPE name [...]>

    "Qualified" means that it's a QName - it can have a namespace prefix -
    though namespaces are not well-supported by DTDs.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Mar 19, 2007
    #2
    1. Advertising

  3. Simon Brooke

    Simon Brooke Guest

    in message <etmgfr$2mv2$>, Richard Tobin
    ('') wrote:

    > In article <>,
    > Simon Brooke <> wrote:
    >
    >> Parameters:
    >> qualifiedNameThe - qualified name of the document type to be
    >> created.

    >
    > Presumably it's the name of the top-level element; as in
    >
    > <!DOCTYPE name [...]>


    That's my guess too. Can I rely on that? If so, would it be reasonable to
    have a hashmap that mapped from top-level elements to public/system ids,
    and cache them as seen?

    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/
    ;; Drivers in the UK kill more people every single year than
    ;; Al Qaeda have ever killed worldwide in any single year.
     
    Simon Brooke, Mar 19, 2007
    #3
  4. The only usage of "qualified name" that I know of in the XML world is
    indeed the one defined by the XML Namespaces spec.

    > If so, would it be reasonable to
    > have a hashmap that mapped from top-level elements to public/system ids,
    > and cache them as seen?


    I'm not sure what you're asking. If you're asking whether the
    public/system ID can be stored along with a particular cached document
    -- sure, that's a legitimate part of the XML Infoset. If you're asking
    whether a given top-level element name will always have the same
    public/system IDs, emphatically not, since that depends on how the
    individual document was retrieved and what its contents are... and, if
    you're going to do namespace-aware processing, on which namespace the
    prefix part of that URI was bound to.

    But I suspect I've misunderstood your question.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Mar 19, 2007
    #4
  5. In article <45fefcc0$1@kcnews01>,
    Joseph Kesselman <> wrote:

    >I'm not sure what you're asking. If you're asking whether the
    >public/system ID can be stored along with a particular cached document
    >-- sure, that's a legitimate part of the XML Infoset. If you're asking
    >whether a given top-level element name will always have the same
    >public/system IDs, emphatically not


    Nor is the reverse true: many DTDs are written with a particular
    top-level element in mind, but there is no way to require it - you can
    write a perfectly DTD-valid document using the XHTML public and system
    IDs that has <p> as its top-level element:

    <!DOCTYPE p PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <p>a simple paragraph</p>

    - which only goes to show that validation isn't everything.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Mar 19, 2007
    #5
  6. Simon Brooke

    Simon Brooke Guest

    in message <45fefcc0$1@kcnews01>, Joseph Kesselman
    ('') wrote:

    > The only usage of "qualified name" that I know of in the XML world is
    > indeed the one defined by the XML Namespaces spec.
    >
    >> If so, would it be reasonable to
    >> have a hashmap that mapped from top-level elements to public/system ids,
    >> and cache them as seen?

    >
    > I'm not sure what you're asking. If you're asking whether the
    > public/system ID can be stored along with a particular cached document
    > -- sure, that's a legitimate part of the XML Infoset. If you're asking
    > whether a given top-level element name will always have the same
    > public/system IDs, emphatically not, since that depends on how the
    > individual document was retrieved and what its contents are... and, if
    > you're going to do namespace-aware processing, on which namespace the
    > prefix part of that URI was bound to.
    >
    > But I suspect I've misunderstood your question.


    No, I regret to confess you did not.

    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/

    ;; I'll have a proper rant later, when I get the time.
     
    Simon Brooke, Mar 20, 2007
    #6
    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. Joseph Tilian
    Replies:
    0
    Views:
    362
    Joseph Tilian
    Dec 21, 2004
  2. Ronald Fischer
    Replies:
    4
    Views:
    1,772
    Ronald Fischer
    Mar 17, 2005
  3. Wayne Shu
    Replies:
    4
    Views:
    775
  4. George2

    qualified name and unqualified name

    George2, Mar 7, 2008, in forum: C Programming
    Replies:
    0
    Views:
    390
    George2
    Mar 7, 2008
  5. Szabolcs Borsanyi

    Pointer to qualified poitner to qualified object

    Szabolcs Borsanyi, May 30, 2008, in forum: C Programming
    Replies:
    13
    Views:
    573
    Keith Thompson
    Jun 8, 2008
Loading...

Share This Page