473,756 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xml SYSTEM vs PUBLIC

Hi !

In an XML DOCTYPE declaration you can use either PUBLIC or
SYSTEM attributes:

<!DOCTYPE RootElement SYSTEM "SomeDTD.dt d">
<!DOCTYPE RootElement PUBLIC "SomeDTD.dt d">

When should I use SYSTEM and when should I use PUBLIC ?


Regards,
Razvan
Jul 20 '05 #1
5 6570
mi*****@mailcit y.com (Razvan) writes:
Hi !

In an XML DOCTYPE declaration you can use either PUBLIC or
SYSTEM attributes:

<!DOCTYPE RootElement SYSTEM "SomeDTD.dt d">
<!DOCTYPE RootElement PUBLIC "SomeDTD.dt d">

When should I use SYSTEM and when should I use PUBLIC ?


Regards,
Razvan

No, you could do that in SGML but in XML you _Always_ have to have a
SYSTEM identifier. If you use PUBLIC you gave to give _both_ a public ID
and the SYSTEM.

Although XML doesn't enforce this PUBLIC identifiers usually follow the
Formal Public Identifier syntax which has a bunch of fields separated by
/ that encode the author and identity of the dtd file but not (usually0
its location. eg MathML uses:

<!DOCTYPE math
PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"


The PUBLIC Identifier "-//W3C//DTD MathML 2.0//EN shows it's (not from
ISO, the -) is from W3C is called DTD MathML 2.0 and uses English as
its documentaion, (one possible) URI where you might actually find the
thing is given by the SYSTEM ID
"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"

David
Jul 20 '05 #2
Hi David,


Thanks for your answer.
No, you could do that in SGML but in XML you _Always_ have to have a
SYSTEM identifier.
If that is true then why have a PUBLIC identifier at all ? What is
their purpose ?

Is there some limitation to the type of data that you can put in
SYSTEM vs. PUBLIC identifiers ? For example: SYSTEM only supports URLs
(like http://www.w3c.org/ ) while PUBLIC only supports local paths ?
(this is just an example)

Regards,
Razvan
Jul 20 '05 #3


If that is true then why have a PUBLIC identifier at all ? What is
their purpose

beware that you are skirting on the edge of a very deep "debate":-)
Basically the public identifier gives a unique canonical name for the
dtd that you can recognise; whereas the SYSTEM identifier may well point
at a local path on the original author's system that doesn't make sense
on yours. An XML parser may use either (or both) identifiers to find the
file.

So if you have an xml parser that has an xml catalogue of some sort that
recognises say XHTML or Docbokk PUBLIC identifier, the file will work
even if the system ID points at a file not accessable to you as your
parser can use the catalogue to map the public ID to a local
copy. Conversely if you don't have that public id in your catalogue (or
if there is no public id) then you can perhaps find the file directly by
using the system id.

When the syntax was invented, for sgml, this last step would most
likely fail as it would be a local file name so it would assume that you
had local files in the same position. In XML when the SYSTEM is supposed
to be a URI and so perhaps usable from anywhere in the world there is an
argument (that I don't personally hold, but which is not unreasonable,
and comes up often) that the SYSTEM ID is all you need and PUBLIC IDs no
longer serve a purpose.

David
Jul 20 '05 #4
Hi !

Look what I've found on a web site:
(http://www.adp-gmbh.ch/xml/dtd.html)
SYSTEM
<!DOCTYPE root-element SYSTEM "http://xyz.qq/abc/def.dtd">

SYSTEM means that a validating parser needs the dtd when it validates
an XML document.
PUBLIC
<!DOCTYPE root-element PUBLIC "path/abc/def.dtd">

PUBLIC means that a validating parser might use a 'cached' ????
version of the DTD.
Mixing
<!DOCTYPE root-element PUBLIC "path/abc/def.dtd"
"http://xyz.qq/abc/def.dtd">

This form uses http://xyz.qq.abc.def.dtd only if path/abc/def.dtd is
not available.

Regards,
Razvan
Jul 20 '05 #5
Look what I've found on a web site:


Don't believe everything you read:-)

if in doubt go back to teh definition:

http://www.w3.org/TR/2004/REC-xml11-...#NT-ExternalID

[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
which says that an ExternalID is either SYSTEM followed by a literal or
PUBLIC followed by two literals separated by white space. there is not
an option of having PUBLIC followed by just one literal. (except for the
declarations of notations which also include a special PUBLIC-only
production 83).

David
Jul 20 '05 #6

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

Similar topics

3
9143
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in system.windows.forms.dll
2
2744
by: Scott Reynolds | last post by:
I am having a problem exposing a class inherited from the collection base class as a webservice. If I expose the collection on a web page all works well and I am very happy. However when I try and expose this via a web service I get a weird error saying that the dll could not be found. The specific error is: I can't figure it out. I thought it was to do with reflection but I am able to load and view the webservice definition which...
5
6543
by: Lance | last post by:
I want to expose properties of a class to a user via a PropertyGrid class. Some of the properties are of type System.IO.FileInfo. Ideally, an OpenFileDialog window would appear when the user attempted to edit the value of the System.IO.FileInfo properties. Is there an existing UITypeEditor that will do this type of thing, or will I need to create my own Thanks Lance
1
5987
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I am executing the find.exe program. The application works perfectly in the development environment. As soon as I execute the compiled program and start the find process I get an "Application Error". The error states that the instruction...
3
2765
by: Stacey Levine | last post by:
I have a webservice that has the below procedure. Basically a procedure to called a stored procedure and return the results. When I try to call the webservice from my program I get the error. Both my calling code and the webservice code are below. Thanks for your help. D:\Projects .NET\StoreBO\frmVoids.vb(182): Value of type '1-dimensional array of System.Data.SqlClient.SqlParameter' cannot be converted to '1-dimensional array of...
3
5006
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
6
7217
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
2
17487
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to the bare minimum: System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("<my mail server IP>", 25); smtp.Send("<one of my email addresses>", "<another of my email addresses>", "Hello", "World");
2
4502
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message boxes (please see associated source code below): 1) Win32 API with context ("btnWin32WithContext_Click") 2) .NET Framework with context ("btnFrameworkWithContext_Click") 3) Win32 API withOUT context ("btnWin32WithOUTContext_Click")
22
6430
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
0
9462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9287
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10046
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.