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

XSchema Problem with xs:any

I've a element definition like this:

--
<xs:element name="content">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="http://www.w3.org/1999/xhtml"/>
<xs:element ref="message"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
--

But when i validate the following xml:

--
<content>
<p xmlns="http://www.w3.org/1999/xhtml">
Welkom bij <b>Wolterink</b> Webdesign<br/>
</p>
</content>
--
I get the following error:

--
[Xerces-J 2.7.1] Validating "index.xml" against
"file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd" ...
Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declaration can be found for element 'p'.
1 Errors
--

Ln 8 Col 43 is the following line:
<p xmlns="http://www.w3.org/1999/xhtml">

How can this be??
p is a element in the xhtml namespace so it is
valid for:
<xs:any namespace="http://www.w3.org/1999/xhtml"/>

What am i doing wrong?
Oct 27 '05 #1
2 3719
Tjerk Wolterink writes:
<xs:any namespace="http://www.w3.org/1999/xhtml"/>

But when i validate the following xml:

--
<content>
<p xmlns="http://www.w3.org/1999/xhtml">
Welkom bij <b>Wolterink</b> Webdesign<br/>
</p>
</content>
--
I get the following error:

--
[Xerces-J 2.7.1] Validating "index.xml" against
"file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd"
...
Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declaration can be found for element 'p'.
1 Errors


The error message tells you what you need to know --- "The matching
wildcard is strict".

If you don't want strict processing, you have to say

<xs:any namespace="http://www.w3.org/1999/xhtml"
processContents="lax"/>

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Oct 27 '05 #2
Henry S. Thompson wrote:
Tjerk Wolterink writes:

<xs:any namespace="http://www.w3.org/1999/xhtml"/>

But when i validate the following xml:

--
<content>
<p xmlns="http://www.w3.org/1999/xhtml">
Welkom bij <b>Wolterink</b> Webdesign<br/>
</p>
</content>
--
I get the following error:

--
[Xerces-J 2.7.1] Validating "index.xml" against
"file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd"
...
Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declaration can be found for element 'p'.
1 Errors

The error message tells you what you need to know --- "The matching
wildcard is strict".

If you don't want strict processing, you have to say

<xs:any namespace="http://www.w3.org/1999/xhtml"
processContents="lax"/>

ht

Hmm okay, i did not know what strict meant,
i will look into it further, anyway thanks!
Oct 27 '05 #3

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

Similar topics

0
by: Erik | last post by:
Hi I'm writing a schema for a particular soap message. In the soap schema any content is allowed in the header and body elements. Is it possible to define the elements allowed in the header and...
2
by: Clarence | last post by:
Hi, here is an XML schema excerpt for an employees details. <xs:element name="ADDRESS"> <xs:complexType> <xs:sequence> <xs:element name="ADDRESSLINE" type="xs:string" maxOccurs="6"/>...
1
by: Cat | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm getting a validation error when I try to restrict the content of nested groups with xs:redefine whereas the same restriction on xs:element's...
2
by: Matthew | last post by:
I have implemented the xmlSchemaCollection object to cache commonly used schemas, as follows: =============================================================================== public void...
0
by: Chris Kelly | last post by:
I am trying to specify an xsd schema for a dataset (using dataset.readxmlschema), before filling the dataset from an xml document (using dataset.readxml), in order to define relationships between...
4
by: Sergey Poberezovskiy | last post by:
Hi, As part of my schema I need to ensure that at least one of two fields have values. I defined my schema as follows: .... <xs:choice> <xs:element ref="el1"/> <xs:element ref="el2"/>...
6
by: TPI | last post by:
I wrote application wich i working on IntPtr. Whole thing is using Marshal.ReadInt32 and Marshal.WriteInt32. And sometimes the application shuts down with out any wornings and exceptions. With...
0
by: Zuhaib Hyder | last post by:
TreeView node selection not working with PopulateOnDemand, any idea?? i want to select each node on click... even when any file opens in right frame in response of click on Treeview node on left...
1
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
sXML - has XML string //This dies on ReadXML - something about invalid character MemoryStream stream = new MemoryStream(sXML.Length);...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.