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

HTML child elements - how to define

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
Jul 20 '05 #1
1 2583
In article <k9*****************@news-binary.blueyonder.co.uk>,
A Amitkashaw <mu****@blueyonder.co.uk> 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
pt**@interlog.com
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Doug Estep | last post by:
Below is a sample of my XML… <MetaData> <Table name="mytable"> <PrimaryKey name="pk"><Column name="mycolumn"/></PrimaryKey> </Table> </MetaData> <Sequencer> <Table name="mytable">
3
by: Ankit | last post by:
Hi This is what I beleive. Please tell whether this is true. Is it true that in xml we can have no text belonging to an element that has sub elements too? While in HTML this can be. for eg....
10
by: Peter Kirk | last post by:
Hi there can someone please help me with creating dynamic content in a table? For example, see the below javascript and html - why is a new row not created in the table when I click the button?...
1
by: jrmsmo | last post by:
Hi there, I have an interesting problem that maybe you pros can suggest how I solve. I'm working with a third party program that serializes an XML document (it was obviously not designed with schema...
3
by: Chris Kennedy | last post by:
I am fine designing .net apps by myself. For my company to start utilising ..net properly we need systems and approaches in place where we can integrate web designers designing the frontend and web...
4
by: Sathyaish | last post by:
I am no JavaScript progammer, and unfortunately am having to babysit an old code base that has a lot of JavaScript in it. I have two questions: (1) Can two HTML controls have the same name? It...
2
by: Johnny | last post by:
Hi, Could you please tell me what's the meaning of the following element definition? I have tried to find the meaning myself, but can't get anything more besides the basic explanation of the dtd...
3
by: SMH | last post by:
Normally an SVG document is loaded/parsed/interpreted inside an HTML document using an 'object' (or 'embed') element, although there are supposedly other ways too. The problem is, the SVG document...
8
by: thatcollegeguy | last post by:
http://smarterfootball.com/exits/theHTML.html I am not sure what is wrong w/ this code. The main issue is that the table that is in the initial html will empty its td but the table that I load...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.