Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract all parts of the text #256

Open
tomasbek opened this issue Dec 28, 2022 · 1 comment
Open

Extract all parts of the text #256

tomasbek opened this issue Dec 28, 2022 · 1 comment

Comments

@tomasbek
Copy link

Dear All,

Thanks for this amazing project! I struggle to extract Text Part 2 from the following example.

<Result Identifier="123" Date="2022-12-01 12:00:00">
<Result.Description>
Text Part 1
<a href="xxx">Text Part 3</a>
Text Part 2
</Result.Description>
</Result>

My struct looks like this 👇

struct ResultDescription: Codable, DynamicNodeEncoding {
   let text: String // This extracts Text Part 1
   let reference: String? // This extracts Text Part 3
   enum CodingKeys: String, CodingKey {
      case text = ""
      case reference = "a"
   }
}

Any suggestions on how to extract Text Part 2?

Thanks 🙌

@Joannis
Copy link
Member

Joannis commented Jan 15, 2023

@tomasbek, did you try approaching this as being a [String]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants