Jump to content

XML - Problem with using entities in attributes


RoccoPwner

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...