Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get the schemalocation

843834Sep 8 2010 — edited Sep 8 2010
I have the below xml header, then would like to get the xsi:schemaLocation value..
<?xml version="1.0" encoding="UTF-8"?>
<ksj:Dataset gml:id="C33Dataset" xmlns:abc="http://abc.com/abc/schemas/abc-app" 
     xmlns:gml="http://www.opengis.net/gml/3.2" 
     xmlns:xlink="http://www.w3.org/1999/xlink" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://abc.com/abc/schemas/abc-app AbcAppSchema-C33.xsd">
I am thinking of 2 options:
1) use SAX, XMLReader.parse and implement ContentHandler, then obtain it via startElement().
2) use FileReader and Regex to search the string.

please guide me on how to obtain it in a fastest way..
thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2010
Added on Sep 8 2010
2 comments
257 views