ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <>
Subject Re: Roles (was: antlib)
Date Thu, 08 May 2003 19:20:12 GMT
Jose Alberto Fernandez wrote:
> Is there a DTD for XSLT? Can I validate an XSLT template against a DTD?

Not in general. This is a restriction of DTDs, which can't cope with
XML namespaces. DTDs are a SGML heritage and predate XML namespaces.
You can always construct a DTD which a certain class of (useful)
XSL style sheets validates against.
You can partially validate arbitrary style sheets against an XSD or
a RNG schema.

> I thought that was not possible given that most of the elements in the 
> template wil be the things I am trying to generate. In the case of XSLT
> the the URI is really for the XSLT processor, but not XML as such.

Well, the p and div element names are for the browser (HTML renderer,
to be more precise), not for (X)HTML as such. After all, any XML
document is most useful if it is ultimately processed by some software,
which necessarily has to have some knowledge on how to handle the
information embedded in the pointy brackets.

> Java packages are global. NS spaces are hyerarchical I can change the 
> meaning of "ANT:" twenty times inside the same buildfile depending
> on where I make the xmlns declaration.

You confuse the namespace, which is fix and (hopefully) unique
which the qname prefix. Don't do this. Read the spec or a good
book about this topic.

> actually I think it is quite complicated in general.
The XML namespace syntax is a compromise between providing unique
long names to the processor and reasonably short names to human
readers. Yes, you can use this to obfuscate XML documents. You
don't *have* to obfuscate XML documents though.
Many people complained about the potential problems ill written
but valid XML documents can pose to unexperienced users as well as
for q&d hackers (for example, you can't use simple perl regex
matching to grab some tuff from the middle of a big XML document,
you'll have to parse the whole doc in order resolve prefixes to
namespaces). Interestingly, when namespaces were introduced to C++
there weren't much bitch&moan, while it posed exactly the same


View raw message