• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Feature not recognized: - schema validation

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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

 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!