You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by wallzs <wa...@hotmail.com> on 2006/06/30 13:40:32 UTC
I have a problem with schema properties
Hi!,
It's the first time I use xerces and I know a little about it, but not
sufficient to solve my problem:
I've tried to parse an xml file with an external schema and I had no
problem, but the problem began when I tried to do it with a schema INSIDE
the xml file I wanted to proccess.
I have been looking for my problem in official page and I haven?t seen
anything about it.
I show the part of the code:
" try
{
DOMParser parse = new DOMParser();
parse.setFeature("http://xml.org/sax/features/validation",
true);
parse.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
"cabecera.xsd");
ErrorChecker errors = new ErrorChecker();
parse.setErrorHandler(errors);
parse.parse(docFile.toString());
}
catch (Exception ex)
{
System.err.print("Problem parsing the file.");
throw new Exception("Error en el formato: " + ex.getMessage());
}"
I think the problem is in the line in which I set the property with
".setProperty" with "external-noNamespaceSchemaLocation".
Could anyone give me any clue?
Thanks very much in advance.
--
View this message in context: http://www.nabble.com/I-have-a-problem-with-schema-properties-tf1872747.html#a5118923
Sent from the Xerces - J - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org
Re: I have a problem with schema properties
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
wallzs <wa...@hotmail.com> wrote on 06/30/2006 07:40:32 AM:
> Hi!,
>
> It's the first time I use xerces and I know a little about it, but not
> sufficient to solve my problem:
> I've tried to parse an xml file with an external schema and I had no
> problem, but the problem began when I tried to do it with a schema
INSIDE
> the xml file I wanted to proccess.
You need to turn on the schema validation [1] feature.
> I have been looking for my problem in official page and I haven?t seen
> anything about it.
> I show the part of the code:
>
> " try
> {
> DOMParser parse = new DOMParser();
> parse.setFeature("http://xml.org/sax/features/validation",
> true);
> parse.setProperty(
>
>
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
> "cabecera.xsd");
> ErrorChecker errors = new ErrorChecker();
> parse.setErrorHandler(errors);
> parse.parse(docFile.toString());
> }
> catch (Exception ex)
> {
> System.err.print("Problem parsing the file.");
> throw new Exception("Error en el formato: " +
ex.getMessage());
> }"
>
> I think the problem is in the line in which I set the property with
> ".setProperty" with "external-noNamespaceSchemaLocation".
>
> Could anyone give me any clue?
> Thanks very much in advance.
[1] http://xerces.apache.org/xerces2-j/features.html#validation.schema
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org