Skip to content

Instantly share code, notes, and snippets.

@HoussemNasri
Created June 7, 2023 11:51
Show Gist options
  • Save HoussemNasri/cedd28e2041dcd52013927813350c905 to your computer and use it in GitHub Desktop.
Save HoussemNasri/cedd28e2041dcd52013927813350c905 to your computer and use it in GitHub Desktop.
nav_order parent
1
Decision Records

Use JAXB to Parse OVAL files

Context and Problem Statement

We need an XML parsing library that can parse OVAL files. Particularly, it should be capable of parsing large XML files efficiently, and have tools to auto-generate java classes from XML schemas.

Considered Options

  • Jackson
  • JAXB
  • StAX

Decision Outcome

Chosen option: JAXB, because it provides the xjc tool to auto-generate JAXB-compatible java classes from XML schemas, and is a battle-tested java standard API.

Pros and Cons of the Options

Jackson

  • Good, because Uyuni already depends on it
  • Bad, because it doesn't provide a tool to auto-generate java classes from xsd schema
  • Bad, because it was designed primarily to parse JSON (tradeoffs over XML support might have been made by the developers)

JAXB

  • Good, because Uyuni already depends on it
  • Good, because it is a standard java API
  • Good, becasue it provides a tool xjc to auto-generate java classes from xsd schema
  • Bad, because it consumes a lot of memory

StAX

  • Good, because Uyuni already depends on it
  • Good, because it is a standard java API
  • Good, because it's consumes less memory
  • Bad, because it doesn't map XML elements to java objects automatically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment