RoccoPwner Posted May 7, 2012 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 Link to comment Share on other sites More sharing options...
Ingolme Posted May 7, 2012 Share Posted May 7, 2012 Unfortunately, Firefox doesn't work with custom entities. It's not just inside attributes but anywhere in the document. Link to comment Share on other sites More sharing options...
RoccoPwner Posted May 8, 2012 Author 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;" /> Link to comment Share on other sites More sharing options...
Ingolme Posted May 8, 2012 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. Link to comment Share on other sites More sharing options...
RoccoPwner Posted May 8, 2012 Author 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! Link to comment Share on other sites More sharing options...
Ingolme Posted May 8, 2012 Share Posted May 8, 2012 The quotation marks will be considered ordinary character data, unless they're the delimiters for an attribute. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now