• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Feature not recognized: - schema validation

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using the sample code provided by a link that was suggested in another posting:

HowToValidateXmlAgainstAnySchema that is in the javaRanch wiki.

but I am getting the error:

Feature not recognized: http: //xml.org/sax/features/validation

which was obviously in response to the line of code:

parser.setFeature("http: //xml.org/sax/features/validation", true);

Can someone help?

Also, does anyone know how to reference a schema that is just on the local development machine - i.e. the line of code:

parser.setProperty("http: //apache.org/xml/properties/schema/external-schemaLocation",
"http://domain.com/mynamespace mySchema.xsd");

How do I point to my schema if it is only on my local development machine at say c:\myFolder\myXsd.xsd?

Many Thanks!
 
Clarence Schabe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - me again.

Please ignore the first part of my question regarding feature not recognized - that was just a silly white space issue.

But the second part of my question is still unanswered - how do I point to and .xsd that is just on my local machine - I tried to run the example with this code:

parser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", "_tst01.xsd");

where _txt01.xsd is at the level where the program is executing and not surprisingly I get the warning:

[Warning] :-1:-1: SchemaLocation: schemaLocation value = '_tst01.xsd' must have even number of URI's.

So again, how can I point to an .xsd on my local system?
 
Clarence Schabe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answered my own question again - just had to use:

parser.setProperty( "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "_my.xsd"); instead
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Clarence,

Thanks for your post that i managed to resolve the xml.org/sax... issue.

But my code ...



Now gives me other error ...


Feature not recognized: <a href="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</b rel="nofollow">" target="_blank">http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation[/B]

Can u tell me what might be the issue ? I am using Xerces Impl 2.6.2 if the version matters ...

Thanks in advance ...

Shailendra

Originally posted by Clarence Schabe:
Answered my own question again - just had to use:

parser.setProperty( "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "_my.xsd"); instead

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic