Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > xml101 question

xml101 question
Thread Tools
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Apr 8, 2005, 02:40 AM
 
I'm learning DTD external from here....

http://www.w3schools.com/dtd/default.asp

.....but the CDATA #PCDATA thing has got me confused.

Here's the example from the end of the article...

Code:
<!DOCTYPE NEWSPAPER [ <!ELEMENT NEWSPAPER (ARTICLE+)> <!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)> <!ELEMENT HEADLINE (#PCDATA)> <!ELEMENT BYLINE (#PCDATA)> <!ELEMENT LEAD (#PCDATA)> <!ELEMENT BODY (#PCDATA)> <!ELEMENT NOTES (#PCDATA)> <!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED> <!ATTLIST ARTICLE EDITOR CDATA #IMPLIED> <!ATTLIST ARTICLE DATE CDATA #IMPLIED> <!ATTLIST ARTICLE EDITION CDATA #IMPLIED> <!ENTITY NEWSPAPER "Vervet Logic Times"> <!ENTITY PUBLISHER "Vervet Logic Press"> <!ENTITY COPYRIGHT "Copyright 1998 Vervet Logic Press">]>
Why is the "HEADLINE" first declared as #PCDATA and then CDATA?

I was wanting to use CDATA in case someone inputs a "<" into a form.

Thanks in advance.
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Apr 8, 2005, 04:38 AM
 
EDIT: found out what this one was, the dtd wasn't valid so was being ignored

And, er, while I'm here.

I have this line in my DTD

Code:
<!ATTLIST module ID label CDATA "ID" #REQUIRED>
Yet the xml validates, even when the ID tag has been removed.

(Last edited by skalie; Apr 8, 2005 at 05:02 AM. )
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 07:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2