Spaces in names

View: New views
2 Messages — Rating Filter:   Alert me  

Spaces in names

by DSosnoski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

JAXB RI's schema model checks for invalid non-whitespace characters in
names, but does not check for leading or trailing whitespace. This means
that if a schema contains names like "book "or " book" they are happily
accepted and converted into annotations, then used at runtime (meaning
the output is generated with the extra whitespace, but they're never
matched on input because the whitespace is discarded by the parser).

Seems to me to be clearly an error. The schema model should check for
whitespace along with other characters not allowed by NCName, and this
should also be checked when processing the annotations.

JAXB is not alone in this handling, by the way. I saw a report by an
Axis2 user that this was happening with Axis2's ADB binding as well as
JAXB, and verified the JAXB issue myself. My own JiBX binding also
allows the spaces at present, though I'll change that for the next release.

  - Dennis

--
Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Spaces in names

by Wolfgang Laun-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just submitted issue 713, requesting that names violating the NCName syntax
be flagged as an error.

Checking of the name field of annotations is less important since a space
being there has the same quality as a typo resulting in a syntactically
correct name: it doesn't match with the name in the XML data file.

Thanks for reporting, Dennis!
-W

On Mon, Nov 9, 2009 at 11:04 PM, Dennis Sosnoski <dms@...> wrote:

> JAXB RI's schema model checks for invalid non-whitespace characters in
> names, but does not check for leading or trailing whitespace. This means
> that if a schema contains names like "book "or " book" they are happily
> accepted and converted into annotations, then used at runtime (meaning the
> output is generated with the extra whitespace, but they're never matched on
> input because the whitespace is discarded by the parser).
>
> Seems to me to be clearly an error. The schema model should check for
> whitespace along with other characters not allowed by NCName, and this
> should also be checked when processing the annotations.
>
> JAXB is not alone in this handling, by the way. I saw a report by an Axis2
> user that this was happening with Axis2's ADB binding as well as JAXB, and
> verified the JAXB issue myself. My own JiBX binding also allows the spaces
> at present, though I'll change that for the next release.
>
>  - Dennis
>
> --
> Dennis M. Sosnoski
> XML and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...