Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-20-2012, 05:09 AM   PM User | #1
TheAliveWinner
New Coder

 
Join Date: Feb 2012
Location: Bokaro Steel City, India
Posts: 18
Thanks: 11
Thanked 1 Time in 1 Post
TheAliveWinner is an unknown quantity at this point
Exclamation Referencing external entity!

Hello friends,
I am trying to reference entity from an external dtd.
But the XML code is not being parsed due to error.

"I am really stuck and I don't know what to do."

XML file (note.xml):
Code:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE message SYSTEM "note.dtd">
<message>
    <to>Love</to>
    <from>&author; Lover</from>
    <body>I love you very much! &lt;3</body>
</message>
DTD file (note.dtd):
Code:
<!ELEMENT message (to, from, body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT body (#PCDATA)>
<!ENTITY author "Anonymous">
Thank you!
__________________
Quote:
"It will never rain roses: when we want to have more roses, we must plant more roses."
- George Eliot
TheAliveWinner is offline   Reply With Quote
Old 11-20-2012, 04:34 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,364
Thanks: 18
Thanked 347 Times in 346 Posts
sunfighter is on a distinguished road
The & sign in front of author; should be &amp;

You can display this xml in a browser then, but if you want to parse it you might want to remove the <!DOCTYPE message SYSTEM "note.dtd">.
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:39 PM.


Advertisement
Log in to turn off these ads.