@ashutoshanshu wrote:
...and by the way, what is your input String and what is your expected output?
I have a lot of properties, containing xml parts (with linebreaks) and I want to linearize them for using in a *.csv file.And save csv with aditionally linebreaks are ... :smileymad:
And because all of my tries with xpath and xqerry were unsucsessfully, I trieed it now with a grovy script.
","body@stringLength":"471","rawBody":"
@ashutoshanshu wrote:...and by the way, what is your input String and what is your expected output?
I have a lot of properties, containing xml parts (with linebreaks) and I want to linearize them for using in a *.csv file.And save csv with aditionally linebreaks are ... :smileymad:
And because all of my tries with xpath and xqerry were unsucsessfully, I trieed it now with a grovy script.
","author":{"__ref":"User:user:7535"},"isEscalated":null,"postTime":"2018-02-20T07:28:58.339-08:00","solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"kudosSumWeight":0,"repliesCount":3,"images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:159134_1"},"latestVersion":null,"metrics":{"__typename":"MessageMetrics","views":42340},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"Revision:revision:159140_1":{"__typename":"Revision","id":"revision:159140_1","lastEditTime":"2018-02-20T08:00:48.051-08:00"},"QueryVariables:ReplyList:message:159140:1":{"__typename":"QueryVariables","id":"ReplyList:message:159140:1","value":{"id":"message:159140","first":10,"sorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"repliesFirst":3,"repliesFirstDepthThree":1,"repliesSorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":true,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1741125846000","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1741125846000","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1741125846000","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved","topicAlreadySolvedErrorTitle":"Solution Already Exists","topicAlreadySolvedErrorDesc":"Refresh the browser to view the existing solution"},"localOverride":false},"CachedAsset:text:en_US-components/messages/ThreadedReplyList-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/ThreadedReplyList-1741125846000","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false},"Revision:revision:159052_4":{"__typename":"Revision","id":"revision:159052_4","lastEditTime":"2018-02-19T09:04:36.220-08:00"},"Revision:revision:159134_1":{"__typename":"Revision","id":"revision:159134_1","lastEditTime":"2018-02-20T07:28:58.339-08:00"},"ModerationData:moderation_data:159153":{"__typename":"ModerationData","id":"moderation_data:159153","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:159153":{"__typename":"ForumReplyMessage","uid":159153,"id":"message:159153","revisionNum":1,"author":{"__ref":"User:user:7535"},"readOnly":false,"repliesCount":1,"depth":6,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumReplyMessage:message:159140"},"conversation":{"__ref":"Conversation:conversation:159049"},"subject":"Re: Groovy operations trim() and replace() seems to doesn't work in Soapui","moderationData":{"__ref":"ModerationData:moderation_data:159153"},"body":"
for example:
<node>\n test1\n <subnode>\n test2\n </subnode>\n test3\n</node>
what I want is:
<node>test1<subnode>test2</subnode>test3</node>
Thanks in advance,
Shamane2000
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"228","kudosSumWeight":0,"postTime":"2018-02-20T09:37:00.671-08:00","lastPublishTime":"2018-02-20T09:37:00.671-08:00","metrics":{"__typename":"MessageMetrics","views":42418},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:159049/message:159153","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuMnwyLjF8b3wzfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:159155"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"editFrozen":false,"body@stringLength":"266","rawBody":"for example:
<node>\n test1\n <subnode>\n test2\n </subnode>\n test3\n</node>
what I want is:
<node>test1<subnode>test2</subnode>test3</node>
Thanks in advance,
Shamane2000
","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:159153_1"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"ModerationData:moderation_data:159155":{"__typename":"ModerationData","id":"moderation_data:159155","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:159155":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:77053"},"id":"message:159155","revisionNum":1,"uid":159155,"depth":7,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumReplyMessage:message:159153"},"conversation":{"__ref":"Conversation:conversation:159049"},"subject":"Re: Groovy operations trim() and replace() seems to doesn't work in Soapui","moderationData":{"__ref":"ModerationData:moderation_data:159155"},"body":"Oh, for this kind of stuff. You need to think for another approach. Please go through this code:-
BufferedReader br = new BufferedReader(new FileReader(new File(\"C:\\\\Users\\\\ASHUTOSH\\\\Desktop\\\\newXml.xml\")));\nString line;\nStringBuilder sb = new StringBuilder();\n\nwhile((line=br.readLine())!= null){\n sb.append(line.trim());\n}\n\nlog.info sb
Here, newXml.xml file contains your xml data. And once you run it. You will get this result:-
Tue Feb 20 23:18:58 IST 2018:INFO:<node>test1<subnode>test2</subnode>test3</node>
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"208","kudosSumWeight":0,"repliesCount":0,"postTime":"2018-02-20T09:51:18.916-08:00","lastPublishTime":"2018-02-20T09:51:18.916-08:00","metrics":{"__typename":"MessageMetrics","views":42378},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:159049/message:159155","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"readOnly":false,"editFrozen":false,"body@stringLength":"595","rawBody":"Oh, for this kind of stuff. You need to think for another approach. Please go through this code:-
BufferedReader br = new BufferedReader(new FileReader(new File(\"C:\\\\Users\\\\ASHUTOSH\\\\Desktop\\\\newXml.xml\")));\nString line;\nStringBuilder sb = new StringBuilder();\n\nwhile((line=br.readLine())!= null){\n sb.append(line.trim());\n}\n\nlog.info sb
Here, newXml.xml file contains your xml data. And once you run it. You will get this result:-
Tue Feb 20 23:18:58 IST 2018:INFO:<node>test1<subnode>test2</subnode>test3</node>
","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:159155_1"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"Revision:revision:159153_1":{"__typename":"Revision","id":"revision:159153_1","lastEditTime":"2018-02-20T09:37:00.671-08:00"},"Revision:revision:159155_1":{"__typename":"Revision","id":"revision:159155_1","lastEditTime":"2018-02-20T09:51:18.916-08:00"}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"readyapi-questions","messageSubject":"groovy-operations-trim-and-replace-seems-to-doesnt-work-in-soapui","messageId":"159049","replyId":"159140"},"buildId":"G6LFdF6Y8sb5g8rZyM3sC","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"25.2.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false,"inboxMuteWipFeatureEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","./components/customComponent/CustomComponentContent/TemplateContent.tsx"],"appGip":true,"scriptLoader":[]}