GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  XML
Go To First  |  Previous Question  |  Next Question 
 XML  |  Question 24 of 40    Print  
Where is Schemas specified in XML?

  
Total Answers and Comments: 1 Last Update: March 27, 2007     Asked by: norman 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 27, 2007 20:12:22   #1  
navneet_kaur Member Since: February 2007   Contribution: 5    

RE: Where is Schemas specified in XML?
static final String JAXP_SCHEMA_LANGUAGE 
"http://java.sun.com/xml/jaxp/properties/schemaLanguage";

static final String W3C_XML_SCHEMA
"http://www.w3.org/2001/XMLSchema";

Next you configure DocumentBuilderFactory to generate a namespace-aware validating parser that uses XML Schema:

...
DocumentBuilderFactory factory
DocumentBuilderFactory.newInstance()
factory.setNamespaceAware(true);
factory.setValidating(true);
try {
factory.setAttribute(JAXP_SCHEMA_LANGUAGE W3C_XML_SCHEMA);
}
catch (IllegalArgumentException x) {
// Happens if the parser does not support JAXP 1.2
...
}

Because JAXP-compliant parsers are not namespace-aware by default it is necessary to set the property for schema validation to work. You also set a factory attribute to specify the parser language to use. (For SAX parsing on the other hand you set a property on the parser generated by the factory.)


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : static final String JAXP_SCHEMA_LANGUAGE =    "http://java.sun.com/xml/jaxp/properties/schemaLanguage";static final String W3C_XML_SCHEMA =    "http://www.w3.org/2001/XMLSchema"; Next, you ...
Read Answers (1) | Asked by : norman


 Sponsored Links

 
Related Articles

Using XML Schemas

Using XML Schemas The simplest way to create an XMLType storage structure in Oracle XML DB is by registering an appropriate XML schema against the database As a part of the registration process Oracle automatically creates the storage for a particular set of XML documents based on the information pr
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

WinRunner Programming Concepts

If you want to create WinRunner scripts that are highly efficient, there are important programming concepts that you will want to become familiar with. Understanding these concepts will provide you with a large number of key benefits. In addition to understanding these concepts, you must also learn
 

Programming Languages Certification

IT Certification programs have several options that will offer you the best knowledge.  By learning everything that you need to know about information technology you will be able to open new doors to your career and personal business desires.  IT Certification offers several vari
 

Neuro-linguistic Programming Methods

Neuro linguistic Programming Methods There are several methods used for performing Neuro linguistic Programming on an individual for obtaining insights into the psyche of the person in order to correct to modify certain patterns of behavior These techniques are also used for Neuro linguistic trainin
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

The Difficult Past of Neuro-linguistic programming

The Difficult Past of Neuro linguistic programming Neuro linguistic programming has had a rocky past with a number of lawsuits rivalry unsystematic development and intermittent progress During the 1980s the two founders separated after the lawsuit filed by Bandler Bandler went on to file several law
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape