Re: [xml] where is the format of PUBLIC defined?



On Fri, Feb 17, 2006 at 03:19:17PM -0800, Rick Jones wrote:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE netperf SYSTEM "./netperf_docs.dtd" >
<netperf xmlns="http://www.netperf.org/ns/netperf";>

to something that replaces SYSTEM with PUBLIC.  Thus far I've been able to 
learn that after PUBLIC one has a string and a URL (URL?), what has me 
confused is the format of the first string.  Every example I've seen in my 
web searches so far looks more or less like:

PUBLIC "-//OASIS//DTD DocBook XML//EN"

from which I gather there is some sort of "structure" to the string - with 
sections separated by "//" but I'm utterly unable to find anything (so far) 
that describes that structure - or I've seen it and simply not recognized 
it :(

   There is no 'structure' from an XML point of view. It is really an
opaque string used only for comparison and when there is a catalog system.
The history of the public identifier comes from SGML, I honnestly have no
idea how they used to compose them, and this has strictly no role in
the processing itself, I assume the rules they used were mostly to garantee
unicity and versionning without risk of having clash.
   Just make sure to only use the limited set of characters allowed
     http://www.w3.org/TR/REC-xml/#NT-PubidLiteral

Without fully understanding it all, I'm presently guessing I want something 
along the lines of:

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE netperf PUBLIC "-//netperf//Netperf XML//EN"
  "http://www.netperf.org/netperf_docs.dtd/1.0";>
<netperf xmlns="http://www.netperf.org/ns/netperf";>

but without understanding the format of that first string with PUBLIC I've 
no idea if I'm going down the right path.  It appears that the very last 

  The value is again mostly irrelevant from an XML processing viewpoint.
They are not required to use in an XML catalog, the lookup can perfectly be
done based on the SYSTEM part of the identifier (the http://...)
  XML being more web oriented, the system identifier is mandatory while
the public one is optional. XML catalogs can remap both.
    http://www.w3.org/TR/REC-xml/#NT-ExternalID

And then after that I have to create some catalog XML and stash it away 
somewhere on each system that lets libxml2 map from the string(s) in PUBLIC 
to a file in the filesystem on each system yes?

   Yes or you could just do the mapping based on the system identifier,
i.e. the URL to the DTD. If you look at the existing xhtml1-dtds package
present in Fedora/RedHat it build rules to do that lookup based both on
the URL (system identifier) and on the public identifier.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]