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

DTD Any vs. XML Schema anyType

Hi

After playing with XML Spy I saw that in DTDs the element of type
"any" could contain text and any element that was declared in the DTD.
In XML Schema an element of type anyType can contain *any* kind of
tags, even tags that were not previously defined in the XML Schema.

I am reading the book "Professional XML" that claims the 2
declarations are completely identical. Where is the truth ?

Regards,
Razvan

Jul 20 '05 #1
3 3271
Razvan wrote:
Hi

After playing with XML Spy I saw that in DTDs the element of type
"any" could contain text and any element that was declared in the DTD.
In XML Schema an element of type anyType can contain *any* kind of
tags, even tags that were not previously defined in the XML Schema.

I am reading the book "Professional XML" that claims the 2
declarations are completely identical. Where is the truth ?


In the XML Specification, under section 3 Logical Structures, production 39,
validity constraint 4:

4. The declaration matches ANY, and the content (after replacing any
entity references with their replacement text) consists of character
data and child elements whose types have been declared.

Do W3C Schemas not necessarily have to describe valid documents?

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
Jul 20 '05 #2
In XML Spy 2005 I tried the above. When DTDs are used for validation
only elements are that are declared are allowed inside the "ANY"
element. However, if I try the same with an associated XML Schema
anything is permitted inside an element of type "anyType". Is XML Spy
broken ?

Thanks,
Razvan

Jul 20 '05 #3
Razvan wrote:
In XML Spy 2005 I tried the above. When DTDs are used for validation
only elements are that are declared are allowed inside the "ANY"
element.
That is correct.
However, if I try the same with an associated XML Schema
anything is permitted inside an element of type "anyType". Is XML Spy
broken ?


It sounds like it, but I don't know if W3C Schemas follow the same rule
as DTDs on this point. My $0.02 is that they should, but doubtless
someone can come up with a convincing reason why they shouldn't.

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
Jul 20 '05 #4

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

Similar topics

3
by: Y.S. | last post by:
Hello All, I have the following schema: .... <xs:element name="data_type_id" type="xs:unsignedShort" /> <xs:element name="data_value" type="xs:anyType" /> .... What I want to do is to...
1
by: ruthless | last post by:
hello. i've got a question can i in XML Schema define tag that works as lists knows from e.g. C,C++ - recurrent tags? i'm talking about e.g. genealogical tree every level of this tree is...
2
by: Peter Theill | last post by:
Hi, I'm trying to build an element which will allow Xml such as: <location type="home"> <AddressLine1>xyz</AddressLine1> </location> <location type="work url"> <Url>http://xyz/</Url>
6
by: Soren Kuula | last post by:
Hi, if I do: <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tg = "http://dongfang.dk/testdata" targetNamespace="http://dongfang.dk/testdata" elementFormDefault="qualified"> ...
3
by: AtariPete | last post by:
Hey all, I want to return an xml structure without .net trying to inject any of its xml schema? Can this be done? Here is the scenario: I'm running into an issue with the return string of my...
1
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i...
5
by: Grant Robertson | last post by:
I am only just learning about schema basics. I am trying to understand some fundamental principles about what can be specified within a schema. If I define an enumerated list of values for an...
3
by: dantohester | last post by:
Hi there, I have the following situation: I want to create an XML document that contains 2 parts: a) a XHTML part (it can be either version 1.0 or 1.1 ) b) a non XHTML part that contains some...
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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
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...
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...

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.