473,320 Members | 1,979 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,320 software developers and data experts.

Beginner XML DTD Help.

Hi there, I've been learning xml for a while but I now have to write an external dtd for a large xml file but I'm a bit stuck on something and was hoping someone could help. Below is an example of the code from the xml file

<abstract>
<para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</para>
<acknowledgements>
<para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</para>
</acknowledgements>

My question is how do I define the para element in the dtd, I'm just a bit confused as its used more than once and in different elements, would it be something like:

<!ELEMENT project (abstract,acknowledgements)>
<!ELEMENT abstract (para)+>
<!ELEMENT para (#PCDATA)>

also within the para's there are thigs like images, code listing and lists, would they just be defined in the <!ELEMENT para (#PCDATA)>?

Any help would be greatly appreciated.
Mar 5 '08 #1
2 1431
jkmyoung
2,057 Expert 2GB
I don't think you need the 2nd <!ELEMENT para (#PCDATA)>, as you've already defined it once.

2nd question:yes
Mar 5 '08 #2
thanks for your reply i got the problem sorted but i was wondering if you could help me with something else? Im trying to create and display a table the code below shows how im doing it:

<table>
<item>
<title>Lorem ipsum</title>
<info>dolor sit</info>
</item>
</table>

and in the dtd:

<!ELEMENT table (item)+>
<!ELEMENT item (title*, info*,detail*,stuff*)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT info (#PCDATA)>
<!ELEMENT detail (#PCDATA)>
<!ELEMENT stuff (#PCDATA)>

when i try to validate it i get errors like:
error (1102): tag uses GI for an undeclared element: item
error (1150): enclosing tag undefined or lacks content model; can't check child: title

the probel appears to be that the elements are undefined however I have clearly defined them in the dtd, any suggestions?

thanks
Mar 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
3
by: jvax | last post by:
Hi all, I hope I'm posting in the right NG... I have a data text file I want to read from a c++ program. the data file goes like this: 90 # number of balls 33 42 13
8
by: Grrrbau | last post by:
I'm a beginner. I'm looking for a good C++ book. Someone told me about Lafore's "Object-Oriented Programming in C++". What do you think? Grrrbau
1
by: LRW | last post by:
I was wondering if anyone could recommend some good beginner sites and tutorial sites for writting ASP.Net pages in C#. Things that especially help with datagrids!! And, are there additional...
14
by: z_learning_tester | last post by:
But I can't seem to find the answer. The question is how do you reverse the words in a string? Or how do you reverse the numbers listed in a string? The example is usually something like: Turn...
3
by: William Foster | last post by:
Good evening all, Microsoft is really starting to annoy me as a new user. I am trying to convert my code from VBA (A very user friendly laguage with generally good help files) to Visual Studio...
10
by: See_Red_Run | last post by:
Hi, I am trying to figure out how to get started with PHP/MySQL. Everything I've read so far says to start with PHP first. I was expecting something like Visual Basic Express or some other type...
1
by: Blue_hatter | last post by:
Hey Guys, I'm a newbie to the whole C++ Programming thing as I think I said before in a post. The thing is, I have this idea that might help me to learn at a better pace than I am doing currently....
10
by: hamza612 | last post by:
I want to start learning how to program. But I dont know where to start. From what I've heard so far c++ is not a good lang. to learn as a beginner because its very complicated compared to others...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.