问题
The podcast howto on the Apple website shows a sample XML file, which refers to a podcast DTD: podcast-1.0.dtd
. The DTD is not available at this address, unfortunately. I heard you can validate a feed using feedvalidator.org, but it's only a service. Is there any other location where the official podcast DTD is available?
The DTD is given as xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
. This URL does not actually resolve to a DTD.
回答1:
no dtd is referenced by the xml attribute you are quoting. instead it is but a (abstract) namespace declaration - syntactically it could be any valid uri as the local name (itunes
) could be any id (see here for a formal definition). semantically it represents a particular markup vocabulary. no concrete resource needs to be accessible through the uri.
a dtd reference would have to come as part of a doctype declaration at the beginning of your xml doc, see the formal spec or a gentler explanation.
note that though the examples' discussion limits itself on (x)html-related documents, any xml doc may have a dtd defined.
regards
来源:https://stackoverflow.com/questions/8389872/where-is-the-official-podcast-dtd