Validate XML files after modifying schema [message #172024] |
Thu, 22 June 2006 06:45  |
Eclipse User |
|
|
|
Originally posted by: william.fulton.ubs.com
If I have a .dtd file with a directory full of xmls using this dtd file.
How do I easily validate all the xml files from within Eclipse?
The project's Properties -> Validation has a check box for validating when
saving resources, but this only works when I save an xml file, not the
xsd file. There is another check box for running the validation when
building the project, but when I build the project, the validation is not
run. What am I doing wrong? I have managed to get it to validate files,
but only after doing a clean and ticking the "Start a build immediately"
box, but then it seems to stop after the first validation failure.
I'm using Eclipse 3.1.2 and WST v1.0.2v200604280000.
Thanks
|
|
|
|
Re: Validate XML files after modifying schema [message #172228 is a reply to message #172089] |
Fri, 23 June 2006 06:13   |
Eclipse User |
|
|
|
Originally posted by: william.fulton.ubs.com
lmandel@ca.ibm.com wrote:
>>If I have a .dtd file with a directory full of xmls using this dtd file.
>>How do I easily validate all the xml files from within Eclipse?
> Depending on your project type you may need to enable validation.
> (Validation is enabled by default for Web projects.) After that the files
> should be validated automatically on save and on a rebuild of the project.
I had the same problems with the example that came with WST. I can't raise
the bug report right now, but this is what would put in it:
I'm using Eclipse 3.1.2 and WST v1.0.2v200604280000.
Open the XML Example shipped with WST.
Select Project -> Build Automatically (so it is ticked)
Goto project properties -> Validation
Tick "Override Validation Properties"
Tick "Run Validation when you manually build XMLExamples"
Tick "Run validation automatically when you save changes to XMLExamples
resources"
Press OK
Open invoice.dtd.
Remove the line:
custNumber ID #REQUIRED
Save the dtd file
I'd expect the Invoice.xml file to show as not valid, but this has to be
done manually by right clicking on the invoice.xml file and choosing
"Validate XML File"
Similar problem occurs with schemas, eg remove the BookType, publisher
element in Catalogue.xsd. The Catalogue.xml file does not show as not
valid.
Manual build also does not validate the file...
Project -> Automatic Build (make sure unticked)
Project -> Build All
Validation is not run
>>The project's Properties -> Validation has a check box for validating
> when
>>saving resources, but this only works when I save an xml file, not the
>>xsd file.
> This should work for both XML and XSD files. So you're finding that XSD
> files are not validated on save? Is the XML Schema validator enabled?
Ah, I think I didn't make myself clear enough. Validation occurs on the
dtd file when I save the dtd file and also on the xml file when I save the
xml file. However, when I save the dtd file, the xml files are not
validated.
William
|
|
|
Re: Validate XML files after modifying schema [message #172236 is a reply to message #172089] |
Fri, 23 June 2006 06:42  |
Eclipse User |
|
|
|
Originally posted by: william.fulton.ubs.com
lmandel@ca.ibm.com wrote:
>>There is another check box for running the validation when
>>building the project, but when I build the project, the validation is not
>>run. What am I doing wrong? I have managed to get it to validate files,
>>but only after doing a clean and ticking the "Start a build immediately"
>>box, but then it seems to stop after the first validation failure.
> I seem to recall that there was a bug in the enable validation checkbox
> but can't remember the exact nature. Can you move up to WTP 1.5, which
> will be released in 8 days? I've tested a similar scenario that works fine
> on the current prerelease version. You can also open a bug with your
> specific problem (one bug per problem please :) ) and the appropriate
> developer will investigate.
I have now tried WTP 1.5. This version is better because:
1) Project wide validation can be done (right click project and select
Validate) - this wasn't available in 1.0.
2) When validating, all the xml files are validating even if one of them
does not validate, ie it doesn't stop validating on the first failure.
However, a few more problems persist for me. For the following I'm using
the XML Example shipped with WST:
Problem 1
Modify the Invoice.dtd file and save.
The dtd file is not validated, despite having Project -> Build
Automatically selected.
It seems to requires the Project -> Properties -> Validation -> Add
validation builder to project to be selected, can't this be the default.
Problem 2
Undo does not work in the xsd editor Design tab. It only works in the
Source tab. WST 1.0 used to have an Undo in the xsd editor.
Problem 3
Open Invoice.xml.
Expand nodes and right click on Header. 'Remove' is greyed out. Why can't
I delete this node? In fact most of the nodes have a greyed out 'Remove'.
Problem 4
Project -> Properties -> Validation. Select Add Validation Builder to
Project.
Go back to Project -> Properties -> Validation. The Add Validation Builder
to Project has disappeared!!
Problem 5
With the Project -> Properties -> Validation, Validation Builder to
Project selected, open Invoice.dtd
Remove this line:
custNumber ID #REQUIRED
Save the file.
The invoice.xml file is not validated.
Should I raise a separate bug for each of these?
William
|
|
|
Powered by
FUDForum. Page generated in 0.46562 seconds