• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Entity names and hex values

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have declared some entity references in my XML (may be external or internal). Say

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="sample.xsl"?>

<!DOCTYPE titlepackage [
<!ENTITY rdquo "”" >
<!ENTITY rdquor "“" >
]>


<package>
<ID id="e"/>
<title> ”Know thyself.”</title>
</package>

Here I am using the entity names in XML and there hex values are mentioned in the DOCTYPE declaration.
I want to know is there any difference between using entity names (where entity values are specified in DOCTYPE) and directly using the hex values in the XML, as in the example below

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="sample.xsl"?>

<package>
<ID id="e"/>
<title> ”Know thyself.“</title>
</package>

Is there any advantage of using one over the other?
[ March 01, 2007: Message edited by: Thomas Greene ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the obvious advantage of putting the entities directly in the XML, as opposed to having an internal DTD, is that you don't have to go to the trouble of ensuring the internal DTD is in every single XML document that needs those characters.
 
reply
    Bookmark Topic Watch Topic
  • New Topic