Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » RC5 Source Format issue
RC5 Source Format issue [message #127421] Fri, 29 July 2005 10:58 Go to next message
Eclipse UserFriend
Originally posted by: michael.giroux.objectweb.org

I have a wsdl that was created by RC3. The file contained <soap:operation
....></soap:operation> entry. This caused validation errors because
soap:operation must be an empty element. I used source->format to reformat
the wsdl, but this only moved the end tag to a new line.

I corrected the problem manually -- <soap:operation .../>

It would be nice if source->format removed the extra end tag in this case.
This might require that source->format has visibility to the schema.

If this has not been suggested before, I'll post an enhancement request.

Michael Giroux
Re: RC5 Source Format issue [message #127469 is a reply to message #127421] Fri, 29 July 2005 12:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

It's a bug if <foo></foo> produces a validation error but <foo/> does
not. XML parsers are not supposed to distinguish between these two cases
in any way. Instead of an enhancement request, this needs a bug report.

Bob Foster
http://xmlbuddy.com/

Michael Giroux wrote:
> I have a wsdl that was created by RC3. The file contained <soap:operation
> ...></soap:operation> entry. This caused validation errors because
> soap:operation must be an empty element. I used source->format to reformat
> the wsdl, but this only moved the end tag to a new line.
>
> I corrected the problem manually -- <soap:operation .../>
>
> It would be nice if source->format removed the extra end tag in this case.
> This might require that source->format has visibility to the schema.
>
> If this has not been suggested before, I'll post an enhancement request.
>
> Michael Giroux
>
>
Re: RC5 Source Format issue [message #127481 is a reply to message #127469] Fri, 29 July 2005 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.giroux.objectweb.org

Well, based on this additional information, I still think there is an issue
w/ source->format.

Bob is correct in that <tag></tag> is same as <tag/>. There is no
validation error in either case.

However, following source->format, the end tag is moved to a separate line
which apparently is no longer an empty element. The element now contains a
text child element that probably contains crlf and possibly some spaces for
the indent on the end tag.

So this brings up another question. Is
<tag>
</tag>

the same as <tag/> for validation purposes. If no, then source->format
should not split elements across lines if the schema requres the element to
be empty.

Michael Giroux


"Bob Foster" <bob@objfac.com> wrote in message
news:dcdmqr$b9b$2@news.eclipse.org...
> It's a bug if <foo></foo> produces a validation error but <foo/> does not.
> XML parsers are not supposed to distinguish between these two cases in any
> way. Instead of an enhancement request, this needs a bug report.
>
> Bob Foster
> http://xmlbuddy.com/
>
> Michael Giroux wrote:
>> I have a wsdl that was created by RC3. The file contained
>> <soap:operation ...></soap:operation> entry. This caused validation
>> errors because soap:operation must be an empty element. I used
>> source->format to reformat the wsdl, but this only moved the end tag to a
>> new line.
>>
>> I corrected the problem manually -- <soap:operation .../>
>>
>> It would be nice if source->format removed the extra end tag in this
>> case. This might require that source->format has visibility to the
>> schema.
>>
>> If this has not been suggested before, I'll post an enhancement request.
>>
>> Michael Giroux
Re: RC5 Source Format issue [message #127506 is a reply to message #127481] Fri, 29 July 2005 14:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

No, it is not the same. Format is creating an error.

In general, it's not nice to inject significant whitespace into an XML
document where there was no whitespace before. Sometimes you need to
inject non-significant whitespace (between tags in element content), or
format won't do anything at all, and most formatters will change
whitespace, e.g., to add or remove newline characters. Then there's
xml:space="preserve". Plenty of end cases. ;)

Bob

Michael Giroux wrote:
> Well, based on this additional information, I still think there is an issue
> w/ source->format.
>
> Bob is correct in that <tag></tag> is same as <tag/>. There is no
> validation error in either case.
>
> However, following source->format, the end tag is moved to a separate line
> which apparently is no longer an empty element. The element now contains a
> text child element that probably contains crlf and possibly some spaces for
> the indent on the end tag.
>
> So this brings up another question. Is
> <tag>
> </tag>
>
> the same as <tag/> for validation purposes. If no, then source->format
> should not split elements across lines if the schema requres the element to
> be empty.
>
> Michael Giroux
>
>
> "Bob Foster" <bob@objfac.com> wrote in message
> news:dcdmqr$b9b$2@news.eclipse.org...
>
>>It's a bug if <foo></foo> produces a validation error but <foo/> does not.
>>XML parsers are not supposed to distinguish between these two cases in any
>>way. Instead of an enhancement request, this needs a bug report.
>>
>>Bob Foster
>>http://xmlbuddy.com/
>>
>>Michael Giroux wrote:
>>
>>>I have a wsdl that was created by RC3. The file contained
>>><soap:operation ...></soap:operation> entry. This caused validation
>>>errors because soap:operation must be an empty element. I used
>>>source->format to reformat the wsdl, but this only moved the end tag to a
>>>new line.
>>>
>>>I corrected the problem manually -- <soap:operation .../>
>>>
>>>It would be nice if source->format removed the extra end tag in this
>>>case. This might require that source->format has visibility to the
>>>schema.
>>>
>>>If this has not been suggested before, I'll post an enhancement request.
>>>
>>>Michael Giroux
>
>
>
Re: RC5 Source Format issue [message #127531 is a reply to message #127481] Fri, 29 July 2005 14:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erickson_d.yahoo.removethis.com

<tag>
</tag>
is definitely not the same as <tag></tag> Source->Format is broken if
it is introducing non-ignoreable whitespace ANYWHERE. It should never
add whitespace inside any element that has #PCDATA content, even if it
means that a line is too long.

XML is for machines to read. In an ideal world, people would never read
it, but use tools like the "design" view. Some concessions have to be
made in the face of reality, like line breaks and even indentation of
nested elements. But altering the semantics of a document by changing
parsed character data for the sake of 80 character lines is a severe bug.

Michael Giroux wrote:

> Well, based on this additional information, I still think there is an issue
> w/ source->format.
>
> Bob is correct in that <tag></tag> is same as <tag/>. There is no
> validation error in either case.
>
> However, following source->format, the end tag is moved to a separate line
> which apparently is no longer an empty element. The element now contains a
> text child element that probably contains crlf and possibly some spaces for
> the indent on the end tag.
>
> So this brings up another question. Is
> <tag>
> </tag>
>
> the same as <tag/> for validation purposes. If no, then source->format
> should not split elements across lines if the schema requres the element to
> be empty.
>
> Michael Giroux
>
>
> "Bob Foster" <bob@objfac.com> wrote in message
> news:dcdmqr$b9b$2@news.eclipse.org...
>
>>It's a bug if <foo></foo> produces a validation error but <foo/> does not.
>>XML parsers are not supposed to distinguish between these two cases in any
>>way. Instead of an enhancement request, this needs a bug report.
>>
>>Bob Foster
>>http://xmlbuddy.com/
>>
>>Michael Giroux wrote:
>>
>>>I have a wsdl that was created by RC3. The file contained
>>><soap:operation ...></soap:operation> entry. This caused validation
>>>errors because soap:operation must be an empty element. I used
>>>source->format to reformat the wsdl, but this only moved the end tag to a
>>>new line.
>>>
>>>I corrected the problem manually -- <soap:operation .../>
>>>
>>>It would be nice if source->format removed the extra end tag in this
>>>case. This might require that source->format has visibility to the
>>>schema.
>>>
>>>If this has not been suggested before, I'll post an enhancement request.
>>>
>>>Michael Giroux
>
>
>
Re: RC5 Source Format issue [message #127557 is a reply to message #127469] Fri, 29 July 2005 15:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amywu.us.DELETETHISPART.ibm.com

I reproduced the problem you were seeing and the error you get is
cvc-complex-type.2.1: Element 'soap:operation' must have no character or
element information item [children], because the type's content type is
empty.

So I guess the spaces and newline that format inserted are considered
characters. A bug is open on the formatter:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=102082
As for automatically turning all empty tags from <foo></foo> to <foo /> this
is actually taken care of through the Cleanup document action. You can find
it in the context menu of the source editor. The option you want is
Compress empty element tags.


"Bob Foster" <bob@objfac.com> wrote in message
news:dcdmqr$b9b$2@news.eclipse.org...
> It's a bug if <foo></foo> produces a validation error but <foo/> does
> not. XML parsers are not supposed to distinguish between these two cases
> in any way. Instead of an enhancement request, this needs a bug report.
>
> Bob Foster
> http://xmlbuddy.com/
>
> Michael Giroux wrote:
> > I have a wsdl that was created by RC3. The file contained
<soap:operation
> > ...></soap:operation> entry. This caused validation errors because
> > soap:operation must be an empty element. I used source->format to
reformat
> > the wsdl, but this only moved the end tag to a new line.
> >
> > I corrected the problem manually -- <soap:operation .../>
> >
> > It would be nice if source->format removed the extra end tag in this
case.
> > This might require that source->format has visibility to the schema.
> >
> > If this has not been suggested before, I'll post an enhancement request.
> >
> > Michael Giroux
> >
> >
Re: RC5 Source Format issue [message #127583 is a reply to message #127557] Fri, 29 July 2005 16:11 Go to previous message
Eclipse UserFriend
Originally posted by: michael.giroux.objectweb.org

Amy,
Thanks for checking this, and thanks for submitting the bug.
Michael
Previous Topic:Using XML Editor in my plugin - is there some clean way ?
Next Topic:Web tools release schedule
Goto Forum:
  


Current Time: Tue Jul 22 19:50:49 EDT 2025

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

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

Back to the top