Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking DTD and XSLT help needed!

Status
Not open for further replies.

GullyUK

Programmer
Mar 5, 2004
3
GB
I need some help with a project that I am currently working on. I have to create a DTD for a fairly basic bibliography, and then implement an xslt sheet for presentation.

I have to cater for the repeating fields within the bibliography, such as publisher and author details. what is the best way to link these together? I am guessing that I should be using external entities to modularize the publisher/author data, but do i have to use the ID fields to link them together? Can I easily link the entities with the formatting of the XSLT sheet?

If possible, please could you explain well as I am very new to this :)

Many thanks
 
You don't seem to understand the concept yourself. Your question doesn't make any sense.

Not sure exactly what you require.
 
yeah, sorry if it seemed a little confused:
Basically, what I am doing is:

Designing a data model (and represent that as an XML DTD) which could describe a bibliographic and publisher database.
I have to cater for repeating groups - such as representing a publishers address without repeating the details on each book. What is the best way to do this?

I later have to design an XSLT stylesheet which transforms a sample instance document of the DTD into an HTML document.

Please, any help on the first section (esp repeating groups) would be appreciated.
 
for example:

the bibliography can contain any number of books, journals, newspaper articles, webpages. Obviously for books (and perhaps other articles), there may be more than one reference to books with the same author.

currently, i am using external entities but i think i have done this wrong:

DTD
---

<!ENTITY author_id01 SYSTEM "auth01_fitzpatrickmichael.ent">
<!ENTITY author_id02 SYSTEM "auth02_shellyjohn.ent">

<!ENTITY publisher_id01 SYSTEM "pub01_oreilly.ent">
<!ENTITY publisher_id02 SYSTEM "pub02_penguin.ent">

<!ELEMENT bibliography (book*, journal_article*, newspaper_article*, webpage*)>

<!ELEMENT book (book_year?, book_title)>
<!ATTLIST book ISBN ID #REQUIRED>
<!ELEMENT book_year (#PCDATA)>
<!ELEMENT book_title (#PCDATA)>

... other articles etc...

XML
--

<?xml version="1.0"?>

<!DOCTYPE bibliography SYSTEM "bibliography.dtd">

<bibliography>

<book ISBN="0-596-00327-7">
&author_id01;
<book_year>2004</book_year>
<book_title>Learning XLST</book_title>
&publisher_id01;
</book>

...other books...

as you can see i am referencing the entities in the XML.

the entities look like this (the publisher one for example):

<?xml version="1.0"?>
<publisher_id01>

<book_pub_name>O'Reilly UK</book_pub_name>

<book_pub_address>4 Castle Street</book_pub_address>

<book_pub_town>Farnham</book_pub_town>

<book_pub_county>Surrey</book_pub_county>

<book_pub_postcode>GU9 7HS</book_pub_postcode>

<book_pub_telephone>01252 711776</book_pub_telephone>

</publisher_id01>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top