This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar" Watch "Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar" New topic
Author

Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar

aravind yarram
Greenhorn

Joined: Mar 28, 2003
Posts: 12
Hi,

I have authored one schema containing any element and anyAttribute. Following is the schema

--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns penContent="http://www.ibm.com">
<xsd:element name="opencontent">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="one" type="xsd:string"/>
<xsd:any minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--------------------------------------------------------------------------

The following is the XML

--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<OpenContentpencontent xmlnspenContent= "http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com OpenContent.xsd ">
<one>Hi</one>
<new namespace="##any">I am new element </new>
<flower/>
</OpenContentpencontent>
--------------------------------------------------------------------------

When I am trying to validate it using the Xerces 2.5.x I am getting the followign error. It is able to capture the element content for the "<one>" element but it is throwing the following error at the "new" element

org.xml. sax. SAXParseException : cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration can be found for element 'new'.


Following is the java code snippet



ANY HELP IS HIGLY APPRECIATED.

Thx in advance.

Edit Comment: Disabled smiles in this post.

- m
[ May 02, 2005: Message edited by: Madhav Lakkapragada ]

SCJP2<br />BEA Certified J2EE Developer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar
 
Similar Threads
XML Schema validation from java using Xercer 1.4.4 and DOM
validation question od XML schemas
Problem with parsing xml against schema using SAX2Parser
How to use DomParser.parse() to parse an XML String instead of the XML location?
Validating XML against Schema.