Groovy says my Unicode string is too long

前端 未结 2 1205
青春惊慌失措
青春惊慌失措 2021-01-12 15:12

As part of my probably wrong and cumbersome solution to print out a form I have taken a MS-Word document, saved as XML and I\'m trying to store that XML as a groovy string s

2条回答
  •  [愿得一人]
    2021-01-12 15:56

    What exception are you getting? I don't believe Groovy String is limited to 65536, as it is basically a Java string.

    Sounds to me like you are trying to recurse somewhere and hitting the 65536 call stack limit.

    That being said however, loading a 100K+ char into memory in one go does seem like overkill..

    Why not parse the XML using a SAX parser or similar to get the results out?

    Or why not save just the data you need to start with rather than relying on hunderds of thousands of chars of xml (which I assume you only want a small section of)

提交回复
热议问题