ke**@cpttm.org.mo (Kent Tong) wrote in message news:<c9**************************@posting.google. com>...
di******@eurosport.com (Dimitre Novatchev) wrote in message news:<5f**************************@posting.google. com>... ke**@cpttm.org.mo (Kent Tong) wrote in message news:<c9**************************@posting.google. com>...
If I understand well, you don't want to do validation here at all.
Just suppress validation -- the parser will still read the DTD and
will correctly substitute the value of the entity for every occurence
of its entity reference.
No, I am not trying to surpress validation. I want validation.
What I am trying to do is:
1. to introduce an entity to represent a long sentence that
would be used in many places.
2. to let different people work on different XML files and
then include the files into the main XML file.
Then you have to write the DTD to describe the structure of this
document type and the real names of the elements.
Unfortunately, DTD's are not namespace aware, therefore namespaces are
defined as attributes.
Here's the correct DTD for your document:
<!DOCTYPE library [
<!ENTITY foo "Some sentence...">
<!ELEMENT library (#PCDATA)>
<!ATTLIST library xmlns CDATA #FIXED
"http://foo.com" >
]>
<library xmlns="http://foo.com">
&foo;
</library>
You can check that now the validation is successful.
I'd greatly recommend a good book on XML -- the one that I have
recently read is:
"Effective XML, 50 Specific Ways to Improve Your XML", by Elliotte
Rusty Harold.
This is a great book that goes deep into many advanced topics of XML.
Hope this helped.
Cheers,
Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,
http://fxsl.sourceforge.net/ -- the home of FXSL
Resume:
http://fxsl.sf.net/DNovatchev/Resume/Res.html