Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] Problem with XMLSchema validation

Geoff Rimmer

2004-04-03

Replies:

On Friday 02 April 2004 21:24, Arindam Gupta wrote:
> Hi,
> I tried the following code based on Kevin Jones posting in the FAQ. I am
> using the latest Xerces2.6.2 parser and JDOM-B10.
>
> ......
> SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",
> true);
> builder.setFeature("http://apache.org/xml/features/validation/schema",
> true);
> builder.setProperty("http://apache.org/xml/properties/schema/external-noNam
>espaceSchemaLocation", "D://Temp//dstjobreq.xsd");

Surely there's got to be something wrong with this string:

  "D://Temp//dstjobreq.xsd"

For a start, what's with the double forward slashes? If this is Windows, they
should be double *backslashes* (when in a Java string).

But even if this works, I would have expected that the string should be a URI
not a filename. In Linux, I would write something like:

  "file:/tmp/dstjobreq.xsd"

but where you have a Windows drive letter, you will need:

  "file:///D:/Temp/dstjobreq.xsd"

(note there are *3* slashes after "file:")

Geoff
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.