Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Entity Declaration Clarification

Reply
Thread Tools

Entity Declaration Clarification

 
 
Ian Rutgers
Guest
Posts: n/a
 
      01-22-2005
If I am using an DTD in an xml file I know to declare an entity I would
enter;

<!DOCTYPE letter
[
<!ENTITY boilerplate1 = "Thank you for your letter.">
]>

How and where would I declare the entity? (Sorry for the silly
question)

Thank you,

Ian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-23-2005


Ian Rutgers wrote:

> If I am using an DTD in an xml file I know to declare an entity I would
> enter;
>
> <!DOCTYPE letter
> [
> <!ENTITY boilerplate1 = "Thank you for your letter.">


That should be
<!ENTITY boilerplate1 "Thank you for your letter.">

> ]>
>
> How and where would I declare the entity?


But the above is the declaration, I am not sure what the question is about.
Do you want to declare an external entity e.g.
<!ENTITY boilerplate SYSTEM "http://example.com/2005/01/boilerplate.xml">
?

Spec is here:
<http://www.w3.org/TR/2004/REC-xml-20040204/#sec-external-ent>


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Ian Rutgers
Guest
Posts: n/a
 
      01-23-2005
I am sorry for not being clear. Can you declare an entity if you are
not using a DTD (using a schema instead)? (From what I have read you
must me using a DTD in order to declare an internal entity). If you can
declare internal entities and not have to use a dtd, please advise.

Thank you,

Ian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      01-23-2005


Ian Rutgers wrote:

> I am sorry for not being clear. Can you declare an entity if you are
> not using a DTD (using a schema instead)? (From what I have read you
> must me using a DTD in order to declare an internal entity). If you can
> declare internal entities and not have to use a dtd, please advise.


No, you need to have a DOCTYPE declaration and then you can declare an
entity in the internal subset (the way you had it in your post) or in
the external subset (e.g. any DTD file referred to by SYSTEM
"whatever.dtd").
There is no way to declare an entity without having a DOCTYPE
declaration in the XML.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
Ian Rutgers
Guest
Posts: n/a
 
      01-23-2005
Thank you. Would the general practice be not to use internal entities
or rather to use some generic dtd along with a schema?

Thank you,

Ian

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entity, problem with entity key ThatsIT.net.au ASP .Net 1 09-07-2009 02:20 AM
Entity Framework - Reassigning child entity's parent Norm ASP .Net 3 07-06-2009 07:28 PM
How to relate a SQL based entity with an Object based entity in Entity Framework markla ASP .Net 1 10-06-2008 09:42 AM
Entity Name or Entity Number? Samuel van Laere HTML 4 02-24-2007 10:11 PM
CLARIFICATION - Variable Declaration & Memory Anoop C++ 3 07-21-2003 10:28 AM



Advertisments