You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2022/11/25 13:09:00 UTC

[jira] [Commented] (MSHARED-953) trimming can remove all whitespace

    [ https://issues.apache.org/jira/browse/MSHARED-953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638654#comment-17638654 ] 

Elliotte Rusty Harold commented on MSHARED-953:
-----------------------------------------------

There's a related bug here if we try to preserve trimming: xml:space is set in startElement but not unset in the corresponding endElement. Furthermore xml:space=default is not recognized to unset xml:space=preserve

> trimming can remove all whitespace
> ----------------------------------
>
>                 Key: MSHARED-953
>                 URL: https://issues.apache.org/jira/browse/MSHARED-953
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-shared-utils
>            Reporter: Elliotte Rusty Harold
>            Assignee: Elliotte Rusty Harold
>            Priority: Critical
>
> The trim parameter in buildDom methods in Xpp3DomBuilder is based on a serious misunderstanding of how the characters method in SAX works. As currently written, trim can potentially remove all whitespace in text content from a document. A little more commonly, it will randomly remove or not remove whitespace depending on how the SAX parser chooses to split text nodes when it reports them.
> It might be possible to implement this correctly at the cost of a lot of code complexity if anyone is using this. More easily, we could make the parameter a no-op and never trim. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)