{"id":112200,"date":"2021-12-06T07:00:00","date_gmt":"2021-12-06T05:00:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=112200"},"modified":"2021-11-27T18:49:39","modified_gmt":"2021-11-27T16:49:39","slug":"kivakit-xml-streaming","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html","title":{"rendered":"KivaKit XML Streaming"},"content":{"rendered":"<h3 class=\"wp-block-heading\">KivaKit XML Streaming \u00a0 <\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2021\/11\/2021-11-27_18-47-25.jpg\"><img decoding=\"async\" width=\"38\" height=\"44\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2021\/11\/2021-11-27_18-47-25.jpg\" alt=\"\" class=\"wp-image-112220\"\/><\/a><\/figure>\n<\/div>\n<p>Since Java 1.6 in 2006, Java has had a built-in XML streaming API in the package <em>javax.xml.stream<\/em>. This API is known as StAX (Streaming API for XML), and it is a very efficient \u201cpull parser\u201d, allowing clients to iterate through the sequence of elements in an XML document. Other approaches to working with XML are event-handling \u201cpush parsers\u201d, and full-blown, in-memory DOMs (Document Object Models). Although StAX is convenient and very fast, it can be significantly harder to work with than a DOM, because the hierarchy of the document that\u2019s being streamed is lost. Our code sees just one element at a time.<\/p>\n<h2 class=\"wp-block-heading\">KivaKit\u2019s New XML Mini-framework<\/h2>\n<p>KivaKit 1.1 quietly added a small, but useful mini-framework to the <em>kivakit-extensions<\/em> repository called <em>kivakit-data-formats-xml<\/em>. The project contains just two simple classes: <em>StaxReader<\/em> and <em>StaxPath<\/em>. The <em>StaxReader<\/em> class adds a layer of convenience to the Java StAX API by making it easy to:<\/p>\n<ul class=\"wp-block-list\">\n<li>Open and close XML streams<\/li>\n<li>Get information about the reader\u2019s stream position<\/li>\n<li>Advance through XML elements<\/li>\n<li>Determine the reader\u2019s hierarchical positioning in the stream<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Moving Through an XML Stream<\/h2>\n<p>The static <em>StaxReader.open(Resource)<\/em> method is used to start reading an XML stream. The method either returns a valid <em>StaxReader<\/em> that\u2019s ready to go, or it throws an exception. Since <em>StaxReader<\/em> implements <em>Closeable<\/em>, it can be used within a <em>try-with-resources<\/em> statement:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">try (var reader = StaxReader.read(file))\n{\n    [...]\n}<\/pre>\n<p>Within our <em>try-with-resources<\/em> block, we can advance through the stream with these methods:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>hasNext()<\/em><\/li>\n<li><em>next()<\/em><\/li>\n<li><em>at()<\/em><\/li>\n<li><em>nextAttribute()<\/em><\/li>\n<li><em>nextCharacters()<\/em><\/li>\n<li><em>nextOpenTag()<\/em><\/li>\n<li><em>nextCloseTag()<\/em><\/li>\n<li><em>nextMatching(Matcher)<\/em><\/li>\n<\/ul>\n<p>When we reach the end of the stream, <em>hasNext()<\/em> will return false. So, processing an XML file looks like this:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">try (var reader = StaxReader.read(file))\n{\n    for (; reader.hasNext(); reader.next())\n    {\n        var element = reader.at();\n        \n        [...]\n        \n    }        \n}<\/pre>\n<p>As we stream our way through an XML document, a few simple methods can help us to identify what kind of tag the reader is currently <em>at<\/em>:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>isAtEnd()<\/em><\/li>\n<li><em>isAtCharacters()<\/em><\/li>\n<li><em>isAtOpenTag()<\/em><\/li>\n<li><em>isAtCloseTag()<\/em><\/li>\n<li><em>isAtOpenCloseTag()<\/em><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Streaming Through an XML Hierarchy<\/h2>\n<p>Although the underlying StAX API can only move through a document in sequential order, <em>StaxReader<\/em> adds functionality that allows us to determine where we are in the document hierarchy as we move along. Using the hierarchical path to our current position the stream, we can search for specific elements in the nested document structure, and we can process data when we reach those elements.<\/p>\n<p>Okay. Let\u2019s make this concrete. Here is a simple document:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"wp-block-preformatted brush:java\">&lt;a&gt;   &lt;---- The path here is a\n    &lt;b&gt;   &lt;---- The path here is a\/b\n        &lt;c&gt;   &lt;---- The path here is a\/b\/c\n        &lt;\/c&gt;\n    &lt;\/b&gt;\n&lt;\/a&gt;<\/pre>\n<p>The <em>StaxPath<\/em> class represents hierarchical paths in our XML document. As seen above, the path at &lt;a&gt; is <em>a<\/em>. The path at &lt;b&gt; in our document is <em>a\/b<\/em> and the path at &lt;c&gt; is <em>a\/b\/c<\/em>.<\/p>\n<p>As we read elements from the XML stream, <em>StaxReader<\/em> tracks the current path using a stack of elements. When the reader encounters an open tag, it pushes the name of the tag onto the end of the current path. When it encounters a close tag, it pops the last element off the end of the path. So, the sequence of steps as <em>StaxReader<\/em> streams through our document is:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">Step  Element     Action    StaxPath\n1.    &lt;a&gt;         push a    a\n2.      &lt;b&gt;       push b    a\/b\n3.        &lt;c&gt;     push c    a\/b\/c\n4.        &lt;\/c&gt;    pop       a\/b\n5.      &lt;\/b&gt;      pop       a\n6.    &lt;\/a&gt;        pop<\/pre>\n<p>The current <em>StaxPath<\/em> for a <em>StaxReader<\/em> can be obtained by calling <em>StaxReader.path()<\/em>.<\/p>\n<h2 class=\"wp-block-heading\">Finding Elements in the Document Hierarchy<\/h2>\n<p>The following methods test the current path of our <em>StaxReader<\/em> reader against a given path. The reader is considered <em>at<\/em> a given path if the the reader\u2019s path is equal to the given path. For example, if the reader is at the path a\/b\/c and the given path is a\/b\/c, the reader is <em>at<\/em> the given path. The reader is <em>inside<\/em> the given path if the given path is a prefix of the reader\u2019s current path. For example, if the reader is at a\/b\/c\/d and the path is a\/b\/c, then the reader is <em>inside<\/em> the given path. Finally, the reader is <em>outside<\/em> the given path in the reverse situation, where the reader is at a\/b and the path is a\/b\/c.<\/p>\n<ul class=\"wp-block-list\">\n<li><em>isAt(StaxPath)<\/em> &#8211; Returns true if the reader is at the given path<\/li>\n<li><em>findNext(StaxPath)<\/em> &#8211; Advances until the given path or the end of the document is reached<\/li>\n<li><em>isInside(StaxPath)<\/em> &#8211; Returns true if the reader is <em>inside<\/em> the given path<\/li>\n<li><em>isAtOrInside(StaxPath)<\/em> &#8211; Returns true if the reader is <em>at<\/em> or <em>inside<\/em> the given path<\/li>\n<li><em>isOutside(StaxPath)<\/em> &#8211; Returns true if the reader is <em>outside<\/em> the given path.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Putting it All Together: Fiasco<\/h2>\n<p>And now, the reason for doing all of this. I am working on a build tool for Java projects called <a href=\"https:\/\/github.com\/Telenav\/fiasco\/tree\/develop\">Fiasco<\/a> (named for Stanislaw Lem\u2019s 1986 science fiction novel, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fiasco_(novel)\">Fiasko<\/a>).<\/p>\n<p>Fiasco is in the design stages still. When it is completed, it will be a pure-Java build tool with these design goals, and non-goals:<\/p>\n<h2 class=\"wp-block-heading\">Goals<\/h2>\n<ul class=\"wp-block-list\">\n<li>Intuitive API<\/li>\n<li>Quick learning curve<\/li>\n<li>Easy to understand and debug builds<\/li>\n<li>Modular design<\/li>\n<li>Easy to create new build tools<\/li>\n<li>Reasonably fast<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Non-Goals<\/h2>\n<ul class=\"wp-block-list\">\n<li>Incremental compilation<\/li>\n<li>Build security<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">How Fiasco Reads POM Files with StaxReader<\/h2>\n<p>To build a Java project, Fiasco needs to access artifacts in Maven repositories, like <em>Maven Central<\/em>. To be able to do this, it is necessary to parse Maven pom.xml files, and since Fiasco will be parsing a <em>lot<\/em> of these files, it is desirable to do it fairly efficiently. The <a href=\"https:\/\/github.com\/Telenav\/fiasco\/blob\/feature\/fiasco-resolver\/src\/main\/java\/com\/telenav\/fiasco\/internal\/building\/dependencies\/pom\/PomReader.java\"><em>PomReader<\/em><\/a> class demonstrates how <em>StaxReader<\/em> can be used to parse a complex, hierarchical XML file like a Maven POM file. The relevant details are found in the method <em>read(MavenRepository, Resource)<\/em>, which opens a <em>pom.xml<\/em> resource, parses it and returns a <em>Pom<\/em> model:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">public class PomReader extends BaseComponent\n{\n    StaxPath PROPERTIES_PATH = StaxPath.parseXmlPath(\"project\/properties\");\n    StaxPath DEPENDENCY_PATH = StaxPath.parseXmlPath(\"project\/dependencies\/dependency\");\n\n    [...]\n    \n    Pom read(MavenRepository repository, Resource resource)\n    {\n        [...]\n        \n        try (var reader = StaxReader.open(resource))\n        {\n            var pom = new Pom(resource);\n\n            for (reader.next(); reader.hasNext(); reader.next())\n            {\n                [...]\n                \n                if (reader.isAt(PROPERTIES_PATH))\n                {\n                    pom.properties = readProperties(reader);\n                }\n\n                if (reader.isAt(DEPENDENCY_PATH))\n                {\n                    pom.dependencies.add(readDependency(reader));\n                }\n                \n                [...]\n             }\n         }\n         \n     [...]        \n\n }<\/pre>\n<p>The code here that opens our <em>pom.xml<\/em> resource and moves through the elements of the XML document is essentially the same as we saw earlier. Within the <em>for<\/em> loop, is where we deal with the POM hierarchy. The <em>StaxReader.isAt(StaxPath)<\/em> method is used to determine when the reader lands on the open tag for the given path. When PROPERTIES_PATH (project\/properties) is reached, we call a method that reads the properties nested within the &lt;properties&gt; open tag (see <em>readProperties(StaxReader)<\/em> for the gory details). For each DEPENDENCY_PATH (project\/dependencies\/dependency) we reach (there may be many of them), we read the &lt;dependency&gt; with logic similar to this:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">Dependency readDependency(StaxReader reader)\n{\n    MavenArtifactGroup artifactGroup = null;\n    String artifactIdentifier = null;\n    String version = null;\n    var scope = DEPENDENCY_PATH;\n\n    \/\/ Skip past the &lt;dependency&gt; open tag we landed on,\n    reader.next();\n\n    \/\/ and while we're not outside the &lt;dependency&gt; tag scope,\n    for (; !reader.isOutside(scope); reader.next())\n    {\n        \/\/ populate any group id,\n        if (reader.isAt(scope.withChild(\"groupId\")))\n        {\n            artifactGroup = MavenArtifactGroup.parse(this, reader.enclosedText());\n        }\n\n        \/\/ any artifact id,\n        if (reader.isAt(scope.withChild(\"artifactId\")))\n        {\n            artifactIdentifier = reader.enclosedText();\n        }\n\n        \/\/ and any version.\n        if (reader.isAt(scope.withChild(\"version\")))\n        {\n            version = reader.enclosedText();\n        }\n    }<\/pre>\n<p>So, there we have it. It is true that our code here is not as succinct as it would be with a DOM model. However, we can parse POM files well enough with <em>StaxReader<\/em>, and we save the time and memory required by a full, in-memory DOM model.<\/p>\n<h2 class=\"wp-block-heading\">Code<\/h2>\n<p>The code discussed above is available on GitHub:<\/p>\n<p><a href=\"https:\/\/github.com\/Telenav\/kivakit-extensions\/tree\/0b0389677d3a82cb0378cf9cb5bd8f67852daeda\/kivakit-data\/formats\/xml\">kivakit-data-formats-xml<\/a><br \/><a href=\"https:\/\/github.com\/Telenav\/fiasco\/tree\/develop\">Fiasco (GitHub)<\/a><br \/><a href=\"https:\/\/github.com\/Telenav\/kivakit-extensions\/blob\/0b0389677d3a82cb0378cf9cb5bd8f67852daeda\/kivakit-data\/formats\/xml\/src\/main\/java\/com\/telenav\/kivakit\/data\/formats\/xml\/stax\/StaxReader.java\">PomReader.java<\/a><\/p>\n<p>The KivaKit XML API is available on <em>Maven Central<\/em> at these coordinates:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">&lt;dependency&gt;\n    &lt;groupId&gt;com.telenav.kivakit&lt;\/groupId&gt;\n    &lt;artifactId&gt;kivakit-data-formats-xml&lt;\/artifactId&gt;\n    &lt;version&gt;${kivakit.version}&lt;\/version&gt;\n&lt;\/dependency&gt;<\/pre>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Jonathan Locke, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"https:\/\/state-of-the-art.org\/2021\/11\/12\/xml-streaming.html\" target=\"_blank\" rel=\"noopener\">KivaKit XML Streaming<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>KivaKit XML Streaming \u00a0 Since Java 1.6 in 2006, Java has had a built-in XML streaming API in the package javax.xml.stream. This API is known as StAX (Streaming API for XML), and it is a very efficient \u201cpull parser\u201d, allowing clients to iterate through the sequence of elements in an XML document. Other approaches to &hellip;<\/p>\n","protected":false},"author":124382,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[2056,402],"class_list":["post-112200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-kivakit","tag-open-source"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>KivaKit XML Streaming - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KivaKit XML Streaming - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-06T05:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jonathan Locke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan Locke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html\"},\"author\":{\"name\":\"Jonathan Locke\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ecdd4c91aff7ef0fe05c4fe10c5f6b4d\"},\"headline\":\"KivaKit XML Streaming\",\"datePublished\":\"2021-12-06T05:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html\"},\"wordCount\":1130,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"KivaKit\",\"Open Source\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html\",\"name\":\"KivaKit XML Streaming - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2021-12-06T05:00:00+00:00\",\"description\":\"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/kivakit-xml-streaming.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"KivaKit XML Streaming\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ecdd4c91aff7ef0fe05c4fe10c5f6b4d\",\"name\":\"Jonathan Locke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Jonathan.locke_-96x96.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Jonathan.locke_-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Jonathan.locke_-96x96.jpg\",\"caption\":\"Jonathan Locke\"},\"description\":\"Jonathan has been working with Java since 1996, and he was a member of the Sun Microsystems Java Team. As an open source author, he is originator of the Apache Wicket web framework (https:\\\/\\\/wicket.apache.org), as well as KivaKit (https:\\\/\\\/www.kivakit.org, @OpenKivaKit) and Lexakai (a tool for producing UML diagrams and Markdown indexes from Java source code, available at https:\\\/\\\/www.lexakai.org, @OpenLexakai). Jonathan works as a Principal Software Architect at Telenav (https:\\\/\\\/www.telenav.com), and in the future, Telenav will release further toolkit designed and led by Jonathan called MesaKit, focused on map analysis and navigation.\",\"sameAs\":[\"https:\\\/\\\/state-of-the-art.org\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/jonathan-locke-3892ba\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/jonathan-locke\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KivaKit XML Streaming - Java Code Geeks","description":"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html","og_locale":"en_US","og_type":"article","og_title":"KivaKit XML Streaming - Java Code Geeks","og_description":"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.","og_url":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-12-06T05:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Jonathan Locke","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jonathan Locke","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html"},"author":{"name":"Jonathan Locke","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ecdd4c91aff7ef0fe05c4fe10c5f6b4d"},"headline":"KivaKit XML Streaming","datePublished":"2021-12-06T05:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html"},"wordCount":1130,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["KivaKit","Open Source"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html","url":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html","name":"KivaKit XML Streaming - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2021-12-06T05:00:00+00:00","description":"Interested to learn about XML Streaming? Check our article presenting the KivaKit XML Streaming.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/kivakit-xml-streaming.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"KivaKit XML Streaming"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ecdd4c91aff7ef0fe05c4fe10c5f6b4d","name":"Jonathan Locke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Jonathan.locke_-96x96.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Jonathan.locke_-96x96.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Jonathan.locke_-96x96.jpg","caption":"Jonathan Locke"},"description":"Jonathan has been working with Java since 1996, and he was a member of the Sun Microsystems Java Team. As an open source author, he is originator of the Apache Wicket web framework (https:\/\/wicket.apache.org), as well as KivaKit (https:\/\/www.kivakit.org, @OpenKivaKit) and Lexakai (a tool for producing UML diagrams and Markdown indexes from Java source code, available at https:\/\/www.lexakai.org, @OpenLexakai). Jonathan works as a Principal Software Architect at Telenav (https:\/\/www.telenav.com), and in the future, Telenav will release further toolkit designed and led by Jonathan called MesaKit, focused on map analysis and navigation.","sameAs":["https:\/\/state-of-the-art.org\/","https:\/\/www.linkedin.com\/in\/jonathan-locke-3892ba\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/jonathan-locke"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/124382"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=112200"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112200\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=112200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=112200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=112200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}