--- In [email protected], James Clark <j...@...> wrote:
>
> On Sun, Jan 25, 2009 at 2:08 AM, Syd Bauman <syd_bau...@...> wrote:
> 
> > > <div id="1">A<a href="X"/></div>
> >
> > Not sure what bits of it you want to validate in there, but the chunk
> > of RELAX NG (XML syntax) you posted is not well-formed...
> 
> 
> 
> > I leave it to wiser voices on this list to explain why.
> >
> 
> One reason is white space.  If RELAX NG didn't limit how schemas can
> constrain mixed content, then you would get similar problems that
you got
> with SGML and pernicious mixed content.  For example, you would have the
> issue of whether in
> 
> <div id="1">
> <a href="X"/></div>
> 
> the newline before <a> was significant or not.
> 
> James
>

It is one of the reason I never saw a good use of text nodes. I saw a
lot of times configuration files like web.xml :

 <servlet>
   <servlet-name>YourServlet</servlet-name>
   <servlet-class>YourServletClass</servlet-class>
 </servlet>

It is always a problem : you have to trim the text, test if it is
empty, it is a lot verbose... I think that when you expect a value in
a XML file, it should always be inside an attribute.
If that is a text content of a web page, an article, I understand
that, but for the rest, I think the main problem of XML specifications
in general is that they use too many text nodes.
For tomcat configuration of users, it is better done :

<user name="admin" password="pwd" roles="admin"/>

Some of the XML expert people should publish a guide of good habits in
order to specify XML, I did not find any when I was trying to make
schemas.

What do you think about that ?

Nico
http://debeissat.nicolas.free.fr/

Reply via email to