473,398 Members | 2,812 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,398 software developers and data experts.

Text OR Fixed structure in an ELEMENT

Hello,

I try to make a DTD for a structure like this:

<notelist>
<note><to>john</to><subj>i have a question</subj></note>
<note>my pin code is 1111</note>
</notelist>

I tried:

<!DOCTYPE notelist[
<!ELEMENT notelist (note*)>
<!ELEMENT note (#PCDATA|(to, subj)) >
<!ELEMENT to (#PCDATA)>
<!ELEMENT subj (#PCDATA)>
]>

but it does not validate (iE6.0)

Any ideas?
LR

Nov 23 '05 #1
3 1077
In article <11**********************@z14g2000cwz.googlegroups .com>,
<lu**********@yahoo.com> wrote:
I try to make a DTD for a structure like this:

<notelist>
<note><to>john</to><subj>i have a question</subj></note>
<note>my pin code is 1111</note>
</notelist>


You can't do that in a DTD. The best you can do is allow any mixture
of <to>, <subj>, and text.

See http://www.w3.org/TR/REC-xml/#sec-mixed-content

-- Richard
Nov 23 '05 #2
> In article <11**********************@z14g2000cwz.googlegroups .com>,
<lu**********@yahoo.com> wrote:
I try to make a DTD for a structure like this:

<notelist>
<note><to>john</to><subj>i have a question</subj></note>
<note>my pin code is 1111</note>
</notelist>

Richard Tobin wrote: You can't do that in a DTD. The best you can do is allow any mixture
of <to>, <subj>, and text.


Or use two different elements:
<structuredNote><to>john</to><subj>i have a question</subj></structuredNote>
<note>my pin code is 1111</note>
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Nov 23 '05 #3
Johannes Koch said the following on 11/22/2005 14:08 +0200:
In article <11**********************@z14g2000cwz.googlegroups .com>,
<lu**********@yahoo.com> wrote:
I try to make a DTD for a structure like this:

<notelist>
<note><to>john</to><subj>i have a question</subj></note>
<note>my pin code is 1111</note>
</notelist>


Richard Tobin wrote:
You can't do that in a DTD. The best you can do is allow any mixture
of <to>, <subj>, and text.


Or use two different elements:
<structuredNote><to>john</to><subj>i have a
question</subj></structuredNote>
<note>my pin code is 1111</note>


Or eliminate one "note" element (I renamed some elements, it made more
sence to me that way, YMMV).

<note>
<to>john</to>
<subj>i have a question</subj>
<text>my pin code is 1111</text>
</note>

--
Regards
Harrie
Nov 23 '05 #4

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

Similar topics

7
by: Santah | last post by:
hi I'm new to C++ and I'm currently working on Visual C++ 6.0 I'm trying to open a text file, and read some data from it part of the text file looks like this: --------
2
by: Martin | last post by:
Hallo, can you help me writing a generic xslt transformation (useable with xsql from oracle)? The problem is how to get the escaping characters .... === INPUT-File in.xml <?xml version =...
8
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor...
0
by: NancyASAP | last post by:
In case anyone hasn't seen this problem, just sharing the info.... I created a dotnet 1.1 page with a literal control. I used a streamreader to open a text file to fill the control. I filled the...
6
by: Eric | last post by:
.... my eternal gratitude!!! :p Here is the problem. A sample of my original VB6 code : '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public...
29
by: Michael Bulatovich | last post by:
Is there a way to use CSS to format "plain" text in an html document. By plain I mean text which is not contained by <por <h#tags. Is there no way to control how this stuff is rendered? tia
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
7
prn
by: prn | last post by:
Hi folks, Sometime in the last few days, I must have accidentally done something that changed some kind of switch in Access, but I can't seem to find what it was. This is Access 2003 under XP,...
26
by: Swifty | last post by:
I'm sending an HTML email to Lotus Notes and I'd like to hide some text from casual observation. There is nothing sinister in this; the text to be hidden is simply a 12-digit number that I use to...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.