Skip to content

Conversation

@JemDay
Copy link
Contributor

@JemDay JemDay commented Mar 11, 2022

  • I believe this is "spec compliant - I was wring this at the same time I was writing the spec.
  • We may want to consider a streaming parsing implementation at some point, but I'm not sure that's needed now.
  • Contains +ve and -ve tests along with some round-trip verifications.
  • Implementation is contained and not visible outside the package/module.
  • Comments welcome :-)

Closes #446

@pierDipi pierDipi self-requested a review March 17, 2022 15:33
JemDay and others added 11 commits January 3, 2023 08:51
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Day, Jeremy(jday) <[email protected]>
Signed-off-by: Jem Day <[email protected]>
Signed-off-by: Jem Day <[email protected]>
class XMLUtils {

private static final Pattern XML_PATTERN = Pattern.compile("^(application|text)\\/([a-zA-Z]+\\+)?xml(;.*)*$");
private static final Pattern TEXT_PATTERN = Pattern.compile("^application\\/([a-zA-Z]+\\+)?(xml|json)(;.*)*$");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're adding json too because it's a common / well known "text-based format", right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ... any text/* content-types are caught in the utility function without using the regex (to keep it simpler!).

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

LGTM

@pierDipi pierDipi merged commit 433ec5b into cloudevents:master Jan 10, 2023
@JemDay JemDay deleted the jd-xml branch January 24, 2023 19:40
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

Successfully merging this pull request may close these issues.

XML Format Support

2 participants