|
-
Nov 7th, 2005, 02:31 AM
#1
Thread Starter
Hyperactive Member
Another XML Problem...
Okay this time I'm having problems with XSL. I'm writing a little practice script so that I can get familiar with the concepts. I have an XML document that looks like this:
HTML Code:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="DictionaryDisp.xsl"?>
<!DOCTYPE book [
<!ELEMENT book (term+, type_of_speech+, definition+, root+)>
<!ATTLIST book
title CDATA #REQUIRED
isbn CDATA #REQUIRED
publisher CDATA #REQUIRED
type (paperback | hardback) #REQUIRED
>
<!ELEMENT term (#PCDATA)>
<!ELEMENT type_of_speech (#PCDATA)>
<!ELEMENT definition (#PCDATA)>
<!ELEMENT root (#PCDATA)>
]>
<book title="The American Heritage School Dictionary" isbn="0-395-24739-4" publisher="Houghton Mifflin" type="hardback">
<term>a, A</term>
<type_of_speech>noun, plural</type_of_speech>
<definition>The first letter of the English alphabet; The best of highest of a grade, as in school; In music, the sixth tone in the scale of C-major.</definition>
<root>N/A</root>
</book>
I'm still not sure if it's legal, or well-formedness, to have attributes in your root elements (if this is the case, please correct me) but my problem is that I want to display the attributes of the root element in my XSL file and I can't figure out how to get a hold of those peices of information in the XSL file. Any help would be appreciated. 
EDIT: Also, is it better to have, in tems of the XML document in question, an internal or external DTD?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|