XML Forte The Xerces Parser and Schemas

After just recieving the new XML module, I thought I would give some of my XML files a play, and started to use the validation functions etc. The problem is that my XML files utilise Schema (XSD) documents which the Xerces parser included as part of the JAXP can not handle unlike the older DTD's.

Does anybody know of a way to 'upgrade' the parser to the new Xerces2 parser or the like?

BTW: I've not had Forte for long but think it's awesome, though somethings take a bit of time to get the hang of :)

[534 byte] By [djwhyte] at [2007-11-25 16:52:03]
# 1

What iof you copy the upgraded xerces.jar to <forte_home>/lib/ext

> djwhyte wrote:

> After just recieving the new XML module, I thought I would give some of my XML files a play, and started to use the validation functions etc. The problem is that my XML files utilise Schema (XSD) documents which the Xerces parser included as part of the JAXP can not handle unlike the older DTD's.

>

> Does anybody know of a way to 'upgrade' the parser to the new Xerces2

> parser or the like?

>

> BTW: I've not had Forte for long but think it's awesome, though

> somethings take a bit of time to get the hang of :)

>

McNichols,Matthew at 2007-7-2 23:52:09 > top of Java-index,Archived Forums,Sun ONE Studio 4...
# 2
Do you know where to get the upgraded xerces.jar file from?Or do you suggest I create my own?
djwhyte at 2007-7-2 23:52:09 > top of Java-index,Archived Forums,Sun ONE Studio 4...
# 3

What I have done is removed the old xerces.jar file from the <forte_home>/lib/ext directory and placed into it the xerces2.jar (which I found in <forte_home>/modules/ext) and now when I validate the XML it gives me some meaningful erros, and it states that it is using the xerces2 jar file. I dont know how it realised it was to use the new one or anything, and I am going to now check this validation against one performed by an external program to ensure that it is similar.

Hope this can help other too,

Dave

djwhyte at 2007-7-2 23:52:09 > top of Java-index,Archived Forums,Sun ONE Studio 4...
# 4

Damn!!!

It seems to be using the Xerces2.jar file for validation, however, it still seems to be checking for a DTD definition rather than XSD.

The error message that it is returning is Document root element "purchaseOrder", must match DOCTYPE root "null". [5]

Document is invalid: no grammar found. [5]

This is apparently due to the parser NOT finding a DTD definition.

Anybody got any good ideas?

Cheers, Dave

djwhyte at 2007-7-2 23:52:09 > top of Java-index,Archived Forums,Sun ONE Studio 4...
# 5
Get Xerces from http://xml.apache.org/dist/xerces-j/
McNichols,Matthew at 2007-7-2 23:52:09 > top of Java-index,Archived Forums,Sun ONE Studio 4...