the user is able to open an (WST) XML editor which gets its contents
from a custom IEditorInput. It only returns the relevant part of the
"backing" XML document. Is it possible to tell the editor to validate
this snippet against the schema specified in the document?

>Hi,
>
>the user is able to open an (WST) XML editor which gets its contents
>from a custom IEditorInput. It only returns the relevant part of the
>"backing" XML document. Is it possible to tell the editor to validate
>this snippet against the schema specified in the document?
>
>Best regards,
>Ömer

Hi Ömer,

Can you clarify your scenario? Do you mean you've got a custom editor from
which you want to invoke validation, that the WST XML editor isn't
validating your document, something else? The more details the better.

the editor I'm opening is the WST XML Editor, but not with a custom
IEditorInput, which only returns a specific snippet of an XML document.
So the editor doesn't know anything about that, therefore it does not
see the schema declaration in the backing XML file. If there were a
schema declaration the editor would automatically do schema validation
on user input. My question was whether it is possible to tell the editor
programmatically against which schema to validate... because it only
sees the XML snippet, and no schema declaration at all.

I hope i could clarify my scenario :-)

Best regards,
Ömer

lmandel@ca.ibm.com schrieb:
>> Hi,
>>
>> the user is able to open an (WST) XML editor which gets its contents
>>from a custom IEditorInput. It only returns the relevant part of the
>> "backing" XML document. Is it possible to tell the editor to validate
>> this snippet against the schema specified in the document?
>>
>> Best regards,
>> Ömer
>
> Hi Ömer,
>
> Can you clarify your scenario? Do you mean you've got a custom editor from
> which you want to invoke validation, that the WST XML editor isn't
> validating your document, something else? The more details the better.
>
> Lawrence

Sorry, there's an error in my first sentence.
I meant that, the WST XML editor is opened *with* a custom IEditorInput,
which returns a specific snippet of an XML document.

Best regards

Ömer Yildiz schrieb:
> Hi Lawrence,
>
> the editor I'm opening is the WST XML Editor, but not with a custom
> IEditorInput, which only returns a specific snippet of an XML document.
> So the editor doesn't know anything about that, therefore it does not
> see the schema declaration in the backing XML file. If there were a
> schema declaration the editor would automatically do schema validation
> on user input. My question was whether it is possible to tell the editor
> programmatically against which schema to validate... because it only
> sees the XML snippet, and no schema declaration at all.
>
> I hope i could clarify my scenario :-)
>
> Best regards,
> Ömer
>
> lmandel@ca.ibm.com schrieb:
>>> Hi,
>>>
>>> the user is able to open an (WST) XML editor which gets its contents
>>> from a custom IEditorInput. It only returns the relevant part of the
>>> "backing" XML document. Is it possible to tell the editor to validate
>>> this snippet against the schema specified in the document?
>>>
>>> Best regards,
>>> Ömer
>>
>> Hi Ömer,
>>
>> Can you clarify your scenario? Do you mean you've got a custom editor
>> from which you want to invoke validation, that the WST XML editor
>> isn't validating your document, something else? The more details the
>> better.
>>
>> Lawrence

The XML editor delegates to the XML validator for validation. As you've
said, the validator needs to be able to find a schema for the XML document
- in your case fragment. Does your fragment use namespaces? If so, have
you tried registering schemas for your namespaces in the XML catalog?
(Window->Preferences->Web and XML->XML Catalog) This can be done
programmatically or manually.