Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"?>
<OpenContent:opencontent xmlns:openContent= "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/>
</OpenContent:opencontent>
--------------------------------------------------------------------------

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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic