Re: [xml] Whitespace problem with external DTD validation

Date view Thread view Subject view Author view

From: Bill Kendrick (William.Kendrick@wcom.com)
Date: Mon Oct 09 2000 - 19:47:08 EDT


On Mon, 09 Oct 2000 16:35:23 Joe McAlerney wrote:
>
> Actually, this is the way it is supposed to work according to W3c XML
> 1.0 spec. See http://www.w3.org/TR/REC-xml#sec-white-space
>
> My guess is that if whitespace is significant in your documents, then
> you need to state so in your DTD.

They aren't significant... We were assuming they would be ingored
by the validator. Realize I'm talking about the whitespace BETWEEN
tags, not within tags.

In other words, the difference between:

  <tag1>foo</tag1>
  <tag2>bar</tag2>

and:

  <tag1>foo</tag1><tag2>bar</tag2>

The validator accepts the latter (no whitespace between tags),
but complains about the former (whitespace between tags).

I have an example XML document (Shakespear's "The Tragedy of
Antony and Cleopatra") which has a DTD at the top.

I've moved the DTD into it's own file (cleo.dtd) and tried
running the XML through libxml's validator using that
external DTD and it just barfs...

  Element PLAY content doesn't follow the Dtd
  Expecting (TITLE , PERSONAE , SCNDESCR , PLAYSUBT , INDUCT? , PROLOGUE? ,
  ACT+ , EPILOGUE?), got (CDATA TITLE CDATA PERSONAE CDATA SCNDESCR CDATA
  PLAYSUBT CDATA ACT CDATA ACT CDATA ACT CDATA ACT CDATA ACT CDATA)
  ...

I assume if I were to write something that had libxml parse the
original XML document (which has the DTD internally at the top),
that it wouldn't complain.

Having a 9044 line Shakespearean play all on one line seems kind of lame. ;)

> I have never had to do this, so I
> can't offer any advise on how to do so. I'm sure the spec will help you
> out. Here are some relevant threads that may help you out too:
>
> http://www.xmlsoft.org/messages/0830.html

This one has to do with saving XML. ;)

> http://www.xmlsoft.org/messages/0716.html

... as does this one.

At this point (I just started working with XML and DTD's last
Friday ;) ), I don't know much, but I ASSUME either the problem
is a bug, or there's some "ignore whitespace between tags" flag
to set somewhere, or something...

Thanks, though...

-bill!
William.Kendrick@wcom.com
ext 6218

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Oct 09 2000 - 20:43:23 EDT