Solved

validate schema

Posted on 2002-07-09
2
506 Views
Last Modified: 2013-11-19
I have a few schema files that validate except for the very first line:

<?xml version="1.0"?>

Yet this line is in many of the examples of schema files I see on the net.

The error is:
java.io.IOException: Problems occurred:Error on line 4 of document file:foo.xsd: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.enhydra.validation.SchemaParser.parseSchema(SchemaParser.java:122)
at org.enhydra.validation.SchemaParser.<init>(SchemaParser.java:57)
at org.enhydra.validation.Validator.<init>(Validator.java:40)
at org.enhydra.validation.Validator.getInstance(Validator.java:68)
at ValidatorTest.main(ValidatorTest.java:20)

What is the problem?

0
Comment
Question by:jdaues
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
wbradney earned 50 total points
ID: 7158294
jdaues,

The answer would seem to lie here:

>>>> Error on line 4 of document file:foo.xsd
                  ^^^
The <?xml... ?> declaration is not strictly a Processing Instruction, it's Prolog, and MUST appear before any elements in the document (it should really be the first line/character encountered by the parser). Anywhere else in the document, "[xX][mM][lL]" is not allowed as a PI.

My guess is that the parser is seeing other text or blank lines before encountering the Prolog.

See the spec for more info at:

http://www.w3.org/TR/2000/REC-xml-20001006#sec-prolog-dtd

Regards,
WMB
0
 

Author Comment

by:jdaues
ID: 7160053
The first 4 lines of the file were:

<!-- bla bla bla bla bla bla bla -->
<!-- bla bla bla bla bla bla bla -->
<!-- bla bla bla bla bla bla bla -->
<?xml version="1.0"?>

By simply placing the version line first, this corrects the problem:

<?xml version="1.0"?>
<!-- bla bla bla bla bla bla bla -->
<!-- bla bla bla bla bla bla bla -->
<!-- bla bla bla bla bla bla bla -->

I guess I was thinking the since the first 3 lines were comments, that it didn't matter.  But it does.

Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question