473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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?

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

;; So, before proceeding with definitive screwing, choose the
;; position most congenital.
-- instructions for fitting bicycle handlebars

Mar 19 '07 #1
5 1577
In article <1t************@gododdin.internal.jasmine.org.uk >,
Simon Brooke <si***@jasmine.org.ukwrote:
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.
Mar 19 '07 #2
in message <et***********@pc-news.cogsci.ed.ac.uk>, Richard Tobin
('r******@cogsci.ed.ac.uk') wrote:
In article <1t************@gododdin.internal.jasmine.org.uk >,
Simon Brooke <si***@jasmine.org.ukwrote:
> 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?

--
si***@jasmine.org.uk (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.
Mar 19 '07 #3
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
Mar 19 '07 #4
In article <45fefcc0$1@kcnews01>,
Joseph Kesselman <ke************@comcast.netwrote:
>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 <pas 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.
Mar 19 '07 #5
in message <45fefcc0$1@kcnews01>, Joseph Kesselman
('k*************@comcast.net') 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.

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

;; I'll have a proper rant later, when I get the time.
Mar 20 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Bengt Richter | last post by:
ISTM that @limited_expression_producing_function @another def func(): pass is syntactic sugar for creating a hidden list of functions. (Using '|' in place of '@' doesn't change the picture...
5
by: Steve Jorgensen | last post by:
I was having a bear of a time today trying to figure out some inconsistent behavior selecting nodes from and MSXML DOM document, so I distilled the issue down to a trivial test demonstrating the...
6
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
0
by: Ali | last post by:
Hello, I have written a utility in C# using ODBC.NET. It can fetch information from a ODBC supported database table and copy it to the other ODBC supported DB table; provided the tables exist on...
10
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
5
by: daz_oldham | last post by:
Hi everyone I am a new poster to this group, so hello to you all! Having just started a new job I have been thrown in the deep end with some heavy XML work so I am finding my feet and I am...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
12
by: hyderabadblues | last post by:
using namespace std; typedef struct { tU16 u16AppID; tU16 u16RegisterID; tU16 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 ...
2
by: winkerbean | last post by:
Given the following: class A { class B { A::B( A::B const & ); }; };
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.