Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Aug 31, 2016

This PR adds the support for skipping multiple white spaces around a comment.

This should have been added but missed. As XMLStreamConstants.COMMENT is always skipped here and here but it seems it is possible to have the COMMENT is between white spaces.

In this case, factory.setProperty(XMLInputFactory.IS_COALESCING, true) does not coalesce both white spaces.

In more details,

<a>
  <!-- comment -->
  <b>...</b>
</a>

in this case, <!--comment --> is surrounded with whitespaces.

This produces the events as blow:

XMLStreamConstants.CHARACTERS     # whitespace
XMLStreamConstants.COMMENT        # comment
XMLStreamConstants.CHARACTERS     # whitespace
XMLStreamConstants.START_ELEMENT  # <b>

Current codes always filter XmlEvent.COMMENT so it ends up with

XMLStreamConstants.CHARACTERS     # whitespace
XMLStreamConstants.CHARACTERS     # whitespace
XMLStreamConstants.START_ELEMENT  # <b>

which does not happen in normal cases because we are coalescing multiple XMLStreamConstants.CHARACTERS into single one as below:

XMLStreamConstants.CHARACTERS     # whitespace
XMLStreamConstants.START_ELEMENT  # <b>

@codecov-io
Copy link

codecov-io commented Aug 31, 2016

Current coverage is 90.42% (diff: 100%)

Merging #166 into master will increase coverage by 0.02%

@@             master       #166   diff @@
==========================================
  Files            14         14          
  Lines           677        679     +2   
  Methods         614        619     +5   
  Messages          0          0          
  Branches         63         60     -3   
==========================================
+ Hits            612        614     +2   
  Misses           65         65          
  Partials          0          0          

Powered by Codecov. Last update 617a31e...074200f

@HyukjinKwon
Copy link
Member Author

I am going to merge this.

HyukjinKwon added a commit that referenced this pull request Sep 10, 2016
This PR prepares the release for 0.3.4.

This will include the changes below:

- Produces correct order of columns for nested rows when user specifies a schema 527b976
- No value in nested struct causes arrayIndexOutOfBounds (19eb277)
- `compression` aslias for `codec` option #145
- Remove dead codes, #144
- Fix nested element with name of parent bug, #161
- Minor documentation changes - #159 and #143
- Ignore comments even when it is surrounded white spaces #166

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #146 from HyukjinKwon/version-0.3.4.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants