Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

XML mit Hilfe von XSD validieren unter Java 1.4.2

Thread view: 
f.mayer@web.de - 06 Nov 2006 13:14 GMT
Hallo,

ich möchte ein XML-File mit Hilfe des zugehörigen XSD-Files
validieren lassen. Dies alles soll noch unter Java 1.4.2_xx laufen.

Ich habe mir nun Xerces 1.4.4 heruntergeladen, und versuchte die
Validierung wie folgt:

SAXParser parser = new SAXParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
InputSource is = new InputSource();
Reader charStream = new InputStreamReader(new
StringBufferInputStream(xmlFile), "ISO-8859-1");
is.setCharacterStream(charStream);
parser.parse(is);

Er wirft jedoch einen Fehler bei parser.parse(is):
org.xml.sax.SAXParseException: The markup in the document preceding the
root element must be well-formed.

Beide Dateien (XML und XSD) sind korrekt (habe sie durch ein anderes
Programm validieren lassen).

Wie kann ich das XML in Java 1.4.2 validieren?

Vielen Dank bereits im Voraus.
Gruß Franz
Andrew Thompson - 06 Nov 2006 14:40 GMT
> Hallo,

Please do not multi-post.  Also, please do
not post German (only) when posting to
predominantly English groups.  Thankyou.

Bitte nicht Multipfosten. Auch Deutschen bitte
nicht bekanntgeben (nur) bei der Eintragung zu
den überwiegend englischen Gruppen. Danke.

(X-post to c.l.j.p./d.c.l.j.)

Andrew T.
f.mayer@web.de - 06 Nov 2006 15:02 GMT
Andrew Thompson schrieb:
> Please do not multi-post.  Also, please do
> not post German (only) when posting to
> predominantly English groups.  Thankyou.

Hi, I accidentally posted my question in an Englisch-spoken forum. When
I saw my mistake, I posted it in a German-spoken forum. Sorry for
posting in the wrong group!

Best regards,
Franz


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.