Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » XML Catalog and validation
XML Catalog and validation [message #557240] Mon, 06 September 2010 08:49 Go to next message
Michal Borek is currently offline Michal BorekFriend
Messages: 25
Registered: August 2010
Junior Member
Hello
I've got problem with validation of file, that doesn't have any namespace or schema definition.
Is it possible to attach validator to xml file based on name of this file?

I've got: config.xml and syntax like below:
<config>
<title>...</title>
<description>...</description>
....
</config>


I can't add any xml schema definition or namespace definition.

I've created xsd file to validate this, but I don't know how to add extention to source editor so that it would be validated and I've got contentassist.

I tried to use xml catalog but it works only when schema definition is defined.

I'm sure that it's possible, becasue in Eclipse RCP there is plugin.xml file which is validated that way.

Can you please tell me how to add such validation to source editor in my plugin?

Thank you in advance
Re: XML Catalog and validation [message #558029 is a reply to message #557240] Thu, 09 September 2010 20:51 Go to previous messageGo to next message
Gabriel Indik is currently offline Gabriel IndikFriend
Messages: 16
Registered: July 2009
Junior Member
Without a namespace or schema location there would be no way to tell which schema this particular XML file should be validated against. A new validator would have to be added utilizing a content descriptor that identifies this specific document. Note however that this would only incorporate validation and not content assist.
Re: XML Catalog and validation [message #558573 is a reply to message #557240] Mon, 13 September 2010 14:31 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 9/6/2010 4:49 AM, emPl wrote:
> I've got problem with validation of file, that doesn't have any
> namespace or schema definition.
> Is it possible to attach validator to xml file based on name of this file?
>
> I've got: config.xml and syntax like below:
>
> <config>
> <title>...</title>
> <description>...</description>
> ...
> </config>
>
>
> I can't add any xml schema definition or namespace definition.

Why not? You would otherwise have to write your own validator from
scratch and register it with the Validation Framework.

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: XML Catalog and validation [message #558631 is a reply to message #557240] Mon, 13 September 2010 18:16 Go to previous message
Gabriel Indik is currently offline Gabriel IndikFriend
Messages: 16
Registered: July 2009
Junior Member
As an alternative, a URI resolver that returns the corresponding schema could be contributed. It would have to use content type information to ensure the schema is only returned for this specific XML document.
Previous Topic:What's not working: a list
Next Topic:Extending the Annotation Properties view
Goto Forum:
  


Current Time: Tue Apr 23 15:05:47 GMT 2024

Powered by FUDForum. Page generated in 0.03644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top