473,378 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Entity Declaration Clarification

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!
Jul 20 '05 #1
4 2000


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/
Jul 20 '05 #2
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!
Jul 20 '05 #3


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/
Jul 20 '05 #4
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!
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ronald Fischer | last post by:
Could someone explain to me what is the difference between <!ENTITY % Foo 'Bar' > and <!ENTITY Foo 'Bar' > From my understanding, the "macro" Foo has to be referenced in the first case...
6
by: Vincent Lefevre | last post by:
I would like to know if the base URI considered to resolve an unparsed entity defined by a relative URI should be the URI before or after its rewriting due to a possible catalog. Let's take an...
11
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you...
4
by: Per | last post by:
Hi, I'm struggling with the DocBook XML DTD, which can be found at http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd. But this DTD seems to somehow include some other documents. E.g.: ...
6
by: Phil Jarvis | last post by:
I have an XML Schema with regular expressions. e.g. <xsd:pattern value="{1}*"/> I have other patterns in the same schema document which share regular expression substructure, like the string...
1
by: Razvan | last post by:
Hi What is the difference between an internal and an external entity ? The first one is defined in the internal subset (not in a separate DTD file, but in the XML file itself - in...
3
by: bgeci | last post by:
I have problem with Entity definition. ____________________________________________ my file "test.xml" ---- <?xml version="1.0" ?> <!DOCTYPE message > <message>&Ep;</message> ---- IE6 Error...
6
by: Tuomas Rannikko | last post by:
Hello, I'm currently writing a XML processor for the fun of it. There is something I don't understand in the spec though. I'm obviously missing something important. The spec states that both...
4
by: keith | last post by:
Hi, I'm new to DTDs and trying to get a DTD file to define an entity for me, but the entity never gets defined. Looking for some insight. Here are the files I'm working with: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.