I want to write a Eclipse plugin that validates a specific XML file. The
identified problems in the XML file should be displayed using markers.
I have not got a clue about how to get the start and end point for a
Marker when I find a problem in the parsed XML. How could I make the
connection between the nodes in the parsed DOM tree and the location in
the XML file?
I want to use the XML editor of WTP as a base for my plugin ... but I
could not identify where to start.
> I want to write a Eclipse plugin that validates a specific XML file. The
> identified problems in the XML file should be displayed using markers.
> I have not got a clue about how to get the start and end point for a
> Marker when I find a problem in the parsed XML. How could I make the
> connection between the nodes in the parsed DOM tree and the location in
> the XML file?
> I want to use the XML editor of WTP as a base for my plugin ... but I
> could not identify where to start.
> I would be thankful for any help!
> cheers
> tOM
You probably want to start by looking at the xml validator that lives in
the xml.core plugin under the 'validation' src folder. If you want an
example of how you can recover locations from DOM nodes look at the wsdl
validator.
If you want your validator to have 'very' accurate error locations
(accurate enough for red squiggles) then there's an extra step you'll need
to do. We do this extra step in the XML editor to 'fix up' the error
locations to make them suitable for squiggling.