RC5 Source Format issue [message #127421] |
Fri, 29 July 2005 10:58  |
Eclipse User |
|
|
|
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 #127506 is a reply to message #127481] |
Fri, 29 July 2005 14:13   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
>
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04865 seconds