<HTML>
When I try to reference an entity within an attribute value, the parser
(I am using msxml) complains.
<BR>The message that I am getting is 'Invalid element in context of
'APP'. <TT>Expected [ADDURL,EDITURL] in line 3 and column 18. </TT>This
message makes no sense to me.
<P>Here is my XML:
<BR>
<P><TT><?XML version="1.0"?></TT>
<BR><TT><!DOCTYPE TREE [</TT>
<BR><TT><!ENTITY TEST "myapp"></TT>
<BR><TT><!ELEMENT TREE (CATEGORY)*></TT>
<BR><TT><!ELEMENT CATEGORY (ADDURL?,EDITURL?,(CATEGORY|APP)*)></TT>
<BR><TT> <!ATTLIST CATEGORY</TT>
<BR><TT> name CDATA #REQUIRED></TT>
<BR><TT><!ELEMENT APP (ADDURL?,EDITURL?)></TT>
<BR><TT> <!ATTLIST APP</TT>
<BR><TT> name CDATA #REQUIRED</TT>
<BR><TT> thing CDATA #IMPLIED></TT>
<BR><TT><!ELEMENT ADDURL (#PCDATA)*></TT>
<BR><TT><!ELEMENT EDITURL (#PCDATA)*></TT>
<BR><TT>]></TT>
<BR><TT><TREE></TT>
<BR><TT> <CATEGORY name="mycategory"></TT>
<BR><TT> </TT>
<BR><TT> <APP name="&TEST;"></TT>
<BR><TT> <ADDURL> someurl </ADDURL></TT>
<BR><TT> <EDITURL> anotherurl </EDITURL></TT>
<BR><TT> </APP></TT>
<BR><TT> </CATEGORY></TT>
<BR><TT></TREE></TT>
<BR>
<P>How do we use entities within attributes?
<P>I find the whole concept of entities to be a bit confusing (internal
vs. external; general vs. parameter; parsed vs. unparsed etc.). Is there
a site where one could find some good examples describing how the various
types of entities are used?
<BR>
<P>Eve L. Maler wrote:
<BLOCKQUOTE TYPE=CITE>It's legal to reference a parsed entity from an attribute
value, and every
<BR>XML processor should be able to handle it. To do this properly,
the
<BR>reference would have to look like this:
<P><aTag xml-link="simple" href="&aRef;">content</aTag>
<P>(Using an ENTITY-type attribute wouldn't automatically expand it in
place,
<BR>and anyway, has to be used exclusively with unparsed entities -- those
with
<BR>an NDATA notation.)
<P> Eve
<BR> </BLOCKQUOTE>
</HTML>