• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

internal parameter entity ?

 
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.
 
Ranch Hand
Posts: 498
Eclipse IDE Firefox Browser Fedora
  • 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
 
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
 
Do not set lab on fire. Or this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic