Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

internal parameter entity ?

 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is needed to get the entity reference expanded on line 7

1.<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2.<!DOCTYPE myElement [
3.<!ELEMENT myElement (#PCDATA)>
4.<!ENTITY % myEntity "Hey!">
5.]>
6.<myElement>
7.%myEntity; How are you guys?
8.</myElement>
=
The document is both well formed and valid but the entity reference at line 7 will not be expanded.
 
Marcelo Sousa Ancelmo
Ranch Hand
Posts: 498
Eclipse IDE Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erase the % from DTD and in document, switch it for an &, like this
 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcelo,
Ah, yes, that did it thanks
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
% sign is used to refer to only Parameter Entities. PEs can be used only inside a DTD.
The exacple you provided was attempting to declare and use a Parsed general entity which must use & sign and not %.
That said, I am not sure why you think

The document is both well formed and valid but the entity reference at line 7 will not be expanded.

The above rules I mentioned are both Well-Formedness and Validity Constraints acc. to the Spec. p 32-33, Section 4.
So IMO, the original document is not be well-formed.
regds.
- madhav
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic