You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Anderson, John" <Jo...@Barbadosoft.com> on 2001/08/06 19:09:17 UTC

RE: DTD Reading Urgent

Ho ho!

Found someone who wants this as well!

The XML spec says that resolving is what a validating parser should do, and
neither SAX nor DOM APIs expose this information. I would also like to be
able to access this information, but most people have put it in the too hard
basket. The problem is complicated (to put it mildly) by the various ways in
which PEs can be used, including as element names, content models (or parts
thereof), entire declarations, includes, bits of attribute declarations, etc
etc. Plus some local PEs to override those in the external DTD. I am no kind
of parser expert, but I guess it would be pretty difficult for a parser to
not resolve this and still guarantee validity without doing a double pass.

For example, what would you like reported for this:

<!ENTITY % someOtherFile SYSTEM "aardvark.mod">
<!ENTITY % prefix "foo:">
<!ENTITY % elementName "%prefix;bar">
<!ENTITY % cmBit "a,b,c">
<!ENTITY % fullDecl "<!ELEMENT %elementName; (%cmBit;)>" >
%fullDecl;
%someOtherFile;

Now add in a few general entities just to make it interesting, and perhaps
some attributes and then remember it all when you create and modify a DOM3
AS Model of it.

As far as I know, the only way to do it would be to do some hacking in the
source code after determining which entities you want resolved and which
ones you'd like passed through. Unfortunately I haven't yet had the time to
work out exactly how I might do this. If I do, I'll let you know. 

If anyone else has done it, I'd also be very grateful to know where and how
I should begin.

John

-----Original Message-----
From: chandru [mailto:cudatha@connextive.com]
Sent: 25 July 2001 05:40
To: xerces-j-user@xml.apache.org
Subject: DTD Reading Urgent




Hi friends ,
  while reading the dtd using the DTDReader(using the feature
decl-handler,of parser) .the elements content model is giving the a
normalised definition .The model will be normalized so that all parameter
entities are fully resolved and all whitespace is removed,and will include
the enclosing parentheses. how can i stop this,i want the un normalised
definition of the element .
e.g:
 <!ELEMENT NOE (%_NOE_;)>
<!ENTITY % _NOE_ (Msgfun,getInfo,(Reader))>

what iam expecting is:
  element name : NOE
  content Mode: (%_NOE)

what the parser informs in DeclHandler  is
 element name : NOE
  content Mode: (Msgfun,getInfo,(Reader))

how can i regain the original declarations.i.e with out the normalisation.

Expecting your mail soon....


from
chandra sekhar





---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org