Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15938 > unrolled thread

how to make Eclipse ignore errors in certain .xml files?

Started byAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
First post2012-07-11 14:06 +0000
Last post2012-07-13 21:55 +0000
Articles 9 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  how to make Eclipse ignore errors in certain .xml files? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-07-11 14:06 +0000
    Re: how to make Eclipse ignore errors in certain .xml files? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-11 10:15 -0400
      Solved (was: Re: how to make Eclipse ignore errors in certain .xml files?) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-07-11 15:32 +0000
    Re: how to make Eclipse ignore errors in certain .xml files? eric@invalid.com (EricF) - 2012-07-12 03:28 +0000
      Re: how to make Eclipse ignore errors in certain .xml files? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-07-12 08:00 +0000
        Re: how to make Eclipse ignore errors in certain .xml files? Jason Bailey <Jason.Bailey@sas.com> - 2012-07-12 13:41 -0400
          Re: how to make Eclipse ignore errors in certain .xml files? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-07-13 16:41 +0000
    Re: how to make Eclipse ignore errors in certain .xml files? Roedy Green <see_website@mindprod.com.invalid> - 2012-07-13 12:11 -0700
      Re: how to make Eclipse ignore errors in certain .xml files? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-07-13 21:55 +0000

#15938 — how to make Eclipse ignore errors in certain .xml files?

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-07-11 14:06 +0000
Subjecthow to make Eclipse ignore errors in certain .xml files?
Message-ID<slrnjvr23s.u9l.avl@gamma.logic.tuwien.ac.at>
Some project developed in Eclipse needs certain "*.xml"-files 
for running/testing.  Some of these files are (and really have
to be) invalid XML and eclipse flags them red.

I'd like to tell eclipse to treat certain handpicked xml-files
as opaque files and to not even attempt to validate them any way.
There are also *other* xml-files in the project that I still want
to have validated and eventually red-flagged. These however are
in different folders than the "bad" ones, in case it matters...

I've tried googling for: eclipse xml errors ignore validate
(and subsets thereof) but couldn't find a relevant one among
the results, yet.

[toc] | [next] | [standalone]


#15939

FromEric Sosman <esosman@ieee-dot-org.invalid>
Date2012-07-11 10:15 -0400
Message-ID<jtk1qs$4md$1@dont-email.me>
In reply to#15938
On 7/11/2012 10:06 AM, Andreas Leitgeb wrote:
> Some project developed in Eclipse needs certain "*.xml"-files
> for running/testing.  Some of these files are (and really have
> to be) invalid XML and eclipse flags them red.
>
> I'd like to tell eclipse to treat certain handpicked xml-files
> as opaque files and to not even attempt to validate them any way.
> There are also *other* xml-files in the project that I still want
> to have validated and eventually red-flagged. These however are
> in different folders than the "bad" ones, in case it matters...
>
> I've tried googling for: eclipse xml errors ignore validate
> (and subsets thereof) but couldn't find a relevant one among
> the results, yet.

     Have you tried giving the bad files a different extension,
like "foo.bad" instead of "foo.xml"?

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

[toc] | [prev] | [next] | [standalone]


#15941 — Solved (was: Re: how to make Eclipse ignore errors in certain .xml files?)

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-07-11 15:32 +0000
SubjectSolved (was: Re: how to make Eclipse ignore errors in certain .xml files?)
Message-ID<slrnjvr74s.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#15939
Eric Sosman <esosman@ieee-dot-org.invalid> wrote:
> On 7/11/2012 10:06 AM, Andreas Leitgeb wrote:
>> Some project developed in Eclipse needs certain "*.xml"-files
>> for running/testing.  Some of these files are (and really have
>> to be) invalid XML and eclipse flags them red.
>> I'd like to tell eclipse to treat certain handpicked xml-files
>> as opaque files and to not even attempt to validate them any way.
>> There are also *other* xml-files in the project that I still want
>> to have validated and eventually red-flagged. These however are
>> in different folders than the "bad" ones, in case it matters...
>> I've tried googling for: eclipse xml errors ignore validate
>> (and subsets thereof) but couldn't find a relevant one among
>> the results, yet.
>      Have you tried giving the bad files a different extension,
> like "foo.bad" instead of "foo.xml"?

Thanks for the response!
No I haven't. I actually thought of it, but it wasn't an option... 
(it would have implied some complication on the build process, that
the coworkers wouldn't have agreed on - they preferred to just
ignore those red flags)

I really just came back to post that I did find a solution
myself.  (well, it was behind one of those google-hits, that I
had previously discarded as irrelevant by the abstract :-} )


For the record: In the Window->Preferences dialog, I pick Validation,
and in the line "XML Validator" I click the triple-dot-button. In the 
Window that pops up, I then click on "Exclude Group", then button "Add
Rule".

I then selected the folder that contained those purposefully bad
xml-files, but I could just as well have selected each file indi-
vidually, or (probably) specified a pattern like "testcase-42.*.xml"
for the files to ignore.

It didn't immediately show any effect, though (even after "OK"ing
all the dialogs up to and including "Preferences"). I then right-
clicked on the folder in the "Project Explorer" pane of eclipse,
and from the context menu I picked Validate.  Only then, the red
flags disappeared.

Nice thing is that (unlike renaming the files) these preferences
only affect me, so the coworkers still see the red flags on those
xml-files in their eclipse...

[toc] | [prev] | [next] | [standalone]


#15971

Fromeric@invalid.com (EricF)
Date2012-07-12 03:28 +0000
Message-ID<jtlg95$iak$1@dont-email.me>
In reply to#15938
In article <slrnjvr23s.u9l.avl@gamma.logic.tuwien.ac.at>, avl@logic.at wrote:
>Some project developed in Eclipse needs certain "*.xml"-files 
>for running/testing.  Some of these files are (and really have
>to be) invalid XML and eclipse flags them red.
>
>I'd like to tell eclipse to treat certain handpicked xml-files
>as opaque files and to not even attempt to validate them any way.
>There are also *other* xml-files in the project that I still want
>to have validated and eventually red-flagged. These however are
>in different folders than the "bad" ones, in case it matters...
>
>I've tried googling for: eclipse xml errors ignore validate
>(and subsets thereof) but couldn't find a relevant one among
>the results, yet.
>
I see that you figured out how to get past this but it has a bad smell to it. 
If the files are bad xml and have to be bad xml, then they should not be 
xml.Or the bad part should be cdata. Someone doesn't know what they are doing.

Eric

[toc] | [prev] | [next] | [standalone]


#15977

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-07-12 08:00 +0000
Message-ID<slrnjvt11e.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#15971
EricF <eric@invalid.com> wrote:
> In article <slrnjvr23s.u9l.avl@gamma.logic.tuwien.ac.at>, avl@logic.at wrote:
>> Some project developed in Eclipse needs certain "*.xml"-files 
>> for running/testing.  Some of these files are (and really have
>> to be) invalid XML and eclipse flags them red.
> I see that you figured out how to get past this but it has a bad smell to it. 

I do agree on the bad smell, but natural fertilizer typically has it, too... ;-)

> If the files are bad xml and have to be bad xml, then they should not be xml.

The tool, to which these files are fed, woudn't accept anything but files
with an .xml extension. That means, we would have to rename the files to
.xml during production. Specifically silencing eclipse for them really looks
like the easier (less intrusive) solution.  What I didn't write so far is,
that the maintenance of the valid and the invalid xmls is some coworker's job
and he probably appreciates seeing the red flags where he actively expects
to see them. It's an indication to them that the right part is wrong ;-)

> Or the bad part should be cdata.

Making the bad part cdata, however, misses the point, as the files would be
correct xml, then. 

Thanks, anyway, for caring that far.  I don't ask anyone to waste more 
thoughts into this thread. There are too many unanswered questions (two
old ones by myself, one about sharing code between a library-project and
a plugin-project in eclipse <slrnjr7m5n.kvi.avl@gamma.logic.tuwien.ac.at>,
and one about Corba and ssliop <slrnjpac40.kvi.avl@gamma.logic.tuwien.ac.at>)
whose answering would be so much more appreciated...

[toc] | [prev] | [next] | [standalone]


#15991

FromJason Bailey <Jason.Bailey@sas.com>
Date2012-07-12 13:41 -0400
Message-ID<jtn287$ssj$1@foggy.unx.sas.com>
In reply to#15977
On 7/12/2012 4:00 AM, Andreas Leitgeb wrote:
> EricF<eric@invalid.com>  wrote:
>> In article<slrnjvr23s.u9l.avl@gamma.logic.tuwien.ac.at>, avl@logic.at wrote:
>>> Some project developed in Eclipse needs certain "*.xml"-files
>>> for running/testing.  Some of these files are (and really have
>>> to be) invalid XML and eclipse flags them red.
>> I see that you figured out how to get past this but it has a bad smell to it.
>
<snip>
> Thanks, anyway, for caring that far.  I don't ask anyone to waste more
> thoughts into this thread. There are too many unanswered questions (two
> old ones by myself, one about sharing code between a library-project and
> a plugin-project in eclipse<slrnjr7m5n.kvi.avl@gamma.logic.tuwien.ac.at>,
> and one about Corba and ssliop<slrnjpac40.kvi.avl@gamma.logic.tuwien.ac.at>)
> whose answering would be so much more appreciated...
>

Another thought, would it be acceptable to change the error message to a 
warning? This is done through the configuration properties > Validation 
 > XML

-jason

[toc] | [prev] | [next] | [standalone]


#16001

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-07-13 16:41 +0000
Message-ID<slrnk00jtj.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#15991
Jason Bailey <Jason.Bailey@sas.com> wrote:
> On 7/12/2012 4:00 AM, Andreas Leitgeb wrote:
>> EricF<eric@invalid.com>  wrote:
>>> In article<slrnjvr23s.u9l.avl@gamma.logic.tuwien.ac.at>, avl@logic.at wrote:
>>>> Some project developed in Eclipse needs certain "*.xml"-files
>>>> for running/testing.  Some of these files are (and really have
>>>> to be) invalid XML and eclipse flags them red.
>>> I see that you figured out how to get past this but it has a bad smell to it.
><snip>
>> Thanks, anyway, for caring that far.  I don't ask anyone to waste more
>> thoughts into this thread. There are too many unanswered questions (two
>> old ones by myself, one about sharing code between a library-project and
>> a plugin-project in eclipse<slrnjr7m5n.kvi.avl@gamma.logic.tuwien.ac.at>,
>> and one about Corba and ssliop<slrnjpac40.kvi.avl@gamma.logic.tuwien.ac.at>)
>> whose answering would be so much more appreciated...
> Another thought, would it be acceptable to change the error message to a 
> warning? This is done through the configuration properties > Validation 
> > XML

I vaguely remember having tried to configure all XML-Validation errors
to warnings already before posting here.  

I just retried it: removed the exclude-rule, validated manually (red
flags re-appeared, as expected), set all the "Errors/Warnings"-items
to "warning", validated manually (red flags still there, as not wanted).

Then I re-instated the exclude rule for the folder, validated manually
and the red flags are once again gone. 

[toc] | [prev] | [next] | [standalone]


#16004

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-07-13 12:11 -0700
Message-ID<ols008dc9me315d1cisgsa9o753h3tngvk@4ax.com>
In reply to#15938
On Wed, 11 Jul 2012 14:06:52 +0000 (UTC), Andreas Leitgeb
<avl@gamma.logic.tuwien.ac.at> wrote, quoted or indirectly quoted
someone who said :

>Some project developed in Eclipse needs certain "*.xml"-files 
>for running/testing.  Some of these files are (and really have
>to be) invalid XML and eclipse flags them red.

Would changing the extension be an option?
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The greatest shortcoming of the human race is our inability to understand the exponential function. 
 ~ Dr. Albert A. Bartlett (born: 1923-03-21 age: 89)
http://www.youtube.com/watch?v=F-QA2rkpBSY

[toc] | [prev] | [next] | [standalone]


#16012

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-07-13 21:55 +0000
Message-ID<slrnk016b2.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#16004
Roedy Green <see_website@mindprod.com.invalid> wrote:
><avl@gamma.logic.tuwien.ac.at> wrote, ... :
>> Some project developed in Eclipse needs certain "*.xml"-files 
>> for running/testing.  Some of these files are (and really have
>> to be) invalid XML and eclipse flags them red.
> Would changing the extension be an option?

Short answer: no, wouldn't. This suggestion and a (slghtly)
longer answer already appeared on this thread.

Btw., as you apparently see my posts, I wonder if you
also saw my followup on your request for translation of
that german poem by guenther grass. 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web