I am trying to put ENTITY in externaL DTD file but its not showing values of ENTITY in XML when it is parsed.
But its working when I combine the XML and DTD in one file below is my code for XML and DTD
info.xml
<!DOCTYPE info SYSTEM "./Note.dtd"> <info>
<info>
<company>&company_info;</company>
<privacy_policy>&privacy_policy;</privacy_policy> </info>
</info>
Note.dtd
<!ENTITY company_info "<name>Test Company</name><location>Berlin</location><phone>1800-000-000</phone>">
<!ENTITY privacy_policy "Lorem ipsum dolor sit amet, consectetur adipisicing elit, .">
info.xml and Note.dtd is in same folder
I'm not sure what you're using to parse the XML, but I know Xerces will throw errors about
<info>
not being declared if you use the file extension ".dtd".Try changing "Note.dtd" to "Note.ent".
I did this with your sample files and the errors went away. Also, I was able to do an identity transform using Saxon on your original info.xml and the entity references were resolved without error.