RoccoPwner 0 Posted May 7, 2012 Report Share Posted May 7, 2012 Hello all,I have a slight problem with validating my XML file with XML DOM validator on this website. Basically I'm trying to use an entity as the value of attribute. Line that causes the problem is:<tvl:category cat="&W;" />Entity is of course listed in .dtd file as follows:<!ENTITY W "Weather"> How come such trivial thing could give me the following error? XML Parsing Error: not well-formedLocation: http://www.w3schools.com/dom/dom_validate.aspLine Number 11, Column 25: <tvl:category cat="&W;" />---------------------------------------------^ I tried using both internal or external .dtd file as well as getting rid of quotation marks, etc. and nothing seems to help :Sad: I'd very much appreciate any help! Thanks Quote Link to post Share on other sites
Ingolme 1,020 Posted May 7, 2012 Report Share Posted May 7, 2012 Unfortunately, Firefox doesn't work with custom entities. It's not just inside attributes but anywhere in the document. Quote Link to post Share on other sites
RoccoPwner 0 Posted May 8, 2012 Author Report Share Posted May 8, 2012 Does IE support it? If yes, could you tell me which of the two is the proper format of using entities inside the attributes?<tvl:category cat="&N" />OR<tvl:category cat="&N;" /> Quote Link to post Share on other sites
Ingolme 1,020 Posted May 8, 2012 Report Share Posted May 8, 2012 Entities always end with a semi-colon. It is incorrect not to do that, whether or not they're inside attributes. I don't know about Internet Explorer's support for entities but I can't remember seeing any complaints about it before. Quote Link to post Share on other sites
RoccoPwner 0 Posted May 8, 2012 Author Report Share Posted May 8, 2012 Entities always end with a semi-colon. It is incorrect not to do that, whether or not they're inside attributes. I don't know about Internet Explorer's support for entities but I can't remember seeing any complaints about it before.Last question: Is it correct to include them within quotation marks? Thanks for your answers so far! Quote Link to post Share on other sites
Ingolme 1,020 Posted May 8, 2012 Report Share Posted May 8, 2012 The quotation marks will be considered ordinary character data, unless they're the delimiters for an attribute. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.