Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > HTML child elements - how to define

Reply
Thread Tools

HTML child elements - how to define

 
 
A Amitkashaw
Guest
Posts: n/a
 
      11-06-2003
Hello,

As a new guy to XML I'm stuck on (what I perceive as) a trickey problem. I'm
defining the element as so:

<!ELEMENT brains (#PCDATA)>

Within this element I have to be able to use HTML tags. XML being XML I can
either define every single HTML tag as a child or try and find a quick way
of doing it. I'd rather not have to define every single HTML tag that I
would like to use. From what I've defined I can have only text within the
tags BRAINS. I know there's a CDATA tag and <code> tags that can be used,
but can I use these within the ELEMENT tag to define *all* following HTML
tags?

Thanks for your time.

- S


 
Reply With Quote
 
 
 
 
Patrick TJ McPhee
Guest
Posts: n/a
 
      11-06-2003
In article <k9rqb.5873$(E-Mail Removed)>,
A Amitkashaw <(E-Mail Removed)> wrote:

% As a new guy to XML I'm stuck on (what I perceive as) a trickey problem. I'm
% defining the element as so:
%
% <!ELEMENT brains (#PCDATA)>
%
% Within this element I have to be able to use HTML tags.

If you want to validate against your DTD, you need to define all the
tags you're going to use. You can do this by including the XHTML
DTD, something like this:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;

You can then define the content depending on what bits of xhtml you
need to use. For instance

<!ELEMENT brains (html)>

would allow (and require!) brains to include an entire html document.

<!ELEMENT brains (#PCDATA|html|%Block*>

would allow arbitrary text, an entire html document, or the content
model of the HTML body element.

--

Patrick TJ McPhee
East York Canada
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT: iterating all child elements and accessing homonymous childrenin sibling elements Gerald Aichholzer XML 2 06-27-2006 03:46 PM
About typedef -- define the function pointer or define function model? robin liu C Programming 3 04-21-2006 03:26 PM
#define _ and #define __ Brian Takita Ruby 0 01-23-2006 04:34 AM
How to define a define that defines some defines ? theotyflos C Programming 3 02-19-2004 05:07 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments