CINXE.COM

Welcome to Apache XMLBeans™

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta content="Apache Forrest" name="Generator"> <meta name="Forrest-version" content="0.9"> <meta name="Forrest-skin-name" content="pelt"> <title>Welcome to Apache XMLBeans&trade;</title> <link type="text/css" href="skin/basic.css" rel="stylesheet"> <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet"> <link media="print" type="text/css" href="skin/print.css" rel="stylesheet"> <link type="text/css" href="skin/profile.css" rel="stylesheet"> <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script> <link rel="shortcut icon" href="images/favicon.ico"> </head> <body onload="init()"> <script type="text/javascript">ndeSetTextSize();</script> <div id="top"> <!--+ |breadtrail +--> <div class="breadtrail"> <a href="https://www.apache.org/">The Apache Software Foundation</a> &gt; <a href="https://xmlbeans.apache.org">Apache XMLBeans</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> </div> <!--+ |header +--> <div class="header"> <!--+ |start group logo +--> <div class="grouplogo"> <a href="https://www.apache.org/"><img class="logoImage" alt="The Apache Software Foundation" src="images/group-logo.png" title="THE APACHE SOFTWARE FOUNDATION provides support for the Apache Community of Open Source software projects, which provide software products for the public good. "></a> </div> <!--+ |end group logo +--> <!--+ |start Project Logo +--> <div class="projectlogo"> <a href="https://xmlbeans.apache.org"><img class="logoImage" alt="Apache XMLBeans" src="images/project-logo.png" title="XMLBeans is a tool that allows access to the full power of XML in a Java friendly way. The idea is to take advantage of the richness and features of XML and XML Schema and have these features mapped as naturally as possible to the equivalent Java language and typing constructs. "></a> </div> <!--+ |end Project Logo +--> <!--+ |start Search +--> <div class="searchbox"> <form action="https://www.google.com/search" method="get" class="roundtopsmall"> <input value="xmlbeans.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; <input name="Search" value="Search" type="submit"> </form> </div> <!--+ |end search +--> <!--+ |start Tabs +--> <ul id="tabs"> <li class="current"> <a class="selected" href="index.html">Home</a> </li> <li> <a class="unselected" href="download/index.html">Download</a> </li> <li> <a class="unselected" href="documentation/index.html">Documentation</a> </li> <li> <a class="unselected" href="samples/index.html">Samples</a> </li> <li> <a class="unselected" href="community/index.html">Community</a> </li> <li> <a class="unselected" href="resources/index.html">Resources</a> </li> </ul> <!--+ |end Tabs +--> </div> </div> <div id="main"> <div id="publishedStrip"> <!--+ |start Subtabs +--> <div id="level2tabs"></div> <!--+ |end Endtabs +--> <script type="text/javascript"><!-- document.write("Last Published: " + document.lastModified); // --></script> </div> <!--+ |breadtrail +--> <div class="breadtrail"> &nbsp; </div> <!--+ |start Menu, mainarea +--> <!--+ |start Menu +--> <div id="menu"> <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Home</div> <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> <div class="menupage"> <div class="menupagetitle">Welcome</div> </div> <div class="menuitem"> <a href="index.html#What+is+XMLBeans%3F" title="Get the nutshell view.">What is XMLBeans?</a> </div> <div class="menuitem"> <a href="history.html" title="XMLBeans history">History</a> </div> <div class="menuitem"> <a href="status.html" title="Changelog">Changes</a> </div> <div class="menuitem"> <a href="overview.html" title="XMLBeans Overview">Overview</a> </div> <div class="menuitem"> <a href="index.html#Getting+Started" title="Jump in here.">Getting Started</a> </div> <div class="menuitem"> <a href="samples/index.html" title="Download sample code.">Sample Code</a> </div> <div class="menuitem"> <a href="https://cwiki.apache.org/confluence/display/xmlbeans/XmlBeansFaq" title="View Frequently Asked Questions">FAQ</a> </div> <div class="menuitem"> <a href="documentation/tutorial_getstarted.html" title="Write some XMLBeans code.">Tutorial: First Steps</a> </div> <div class="menuitem"> <a href="https://xmlbeans.apache.org/docs/5.0.0/" title="v5.0.0 API">v5.0.0 Javadoc</a> </div> </div> <div id="credit"> <hr> <a href="https://www.apache.org/events/current-event.html"><img border="0" title="Apache Event" alt="Apache Event - logo" src="https://www.apache.org/events/current-event-125x125.png" style="width: 125px;height: 125px;"></a> </div> <div id="roundbottom"> <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> <!--+ |alternative credits +--> <div id="credit2"> <a href="https://donate.apache.org/"><img border="0" title="Support Apache" alt="Support Apache - logo" src="images/support-asf.png" style="width: 125px;height: 125px;"></a><a href="https://www.apache.org/foundation/press/kit/#poweredby"><img border="0" title="powered by POI" alt="powered by POI - logo" src="images/poweredby-xmlbeans-logo.png" style="width: 125px;height: 125px;"></a> </div> </div> <!--+ |end Menu +--> <!--+ |start content +--> <div id="content"> <h1>Welcome to Apache XMLBeans&trade;</h1> <div id="front-matter"></div> <a name="What+is+XMLBeans%3F"></a> <h2 class="boxed">What is XMLBeans?</h2> <div class="section"> <p>XMLBeans is a technology for accessing XML by binding it to Java types. XMLBeans provides several ways to get at the XML, including: </p> <ul> <li>Through XML schema that has been compiled to generate Java types that represent schema types. In this way, you can access instances of the schema through JavaBeans-style accessors after the fashion of "getFoo" and "setFoo". <p>The XMLBeans API also allows you to reflect into the XML schema itself through an XML Schema Object model. </p> </li> <li>A cursor model through which you can traverse the full XML infoset.</li> <li>Support for XML DOM.</li> </ul> <p>For a more complete introduction, see the <a href="overview.html">XMLBeans Overview </a> or <a href="documentation/../guide/GettingStarted.html">Getting Started With XMLBeans</a>. </p> <p>For more details on XMLBeans see the <a href="https://cwiki.apache.org/confluence/display/xmlbeans/">XMLBeans Wiki pages</a> or the XMLBeans documentation (the Documentation tab on this website). </p> </div> <a name="Release%3A+Apache+XMLBeans+5.2.2+%28Nov+5%2C+2024%29"></a> <h2 class="boxed">Release: Apache XMLBeans 5.2.2 (Nov 5, 2024)</h2> <div class="section"> <p> Latest release files <a href="download/index.html">are available</a>. </p> <p>The Apache <a href="https://poi.apache.org">POI</a> project has unretired the XMLBeans codebase since 3.0.0 and is maintaining it as a sub-project. </p> <div class="note"> <div class="label">Note</div> <div class="content">XMLBeans 5.2.2 has a dependency on log4j-api 2.24.1. We have discovered an issue with log4j-api 2.24.1. We strongly recommend that users stick with XMLBeans 5.2.1 or if you must use 5.2.2, avoid using any version of log4j-core other than 2.24.1. Please direct any queries to the Log4j Team. The main issue is <a href="https://github.com/apache/logging-log4j2/issues/3143">Issue 3143</a>. </div> </div> <p> Some bug fixes (for a more complete list of changes see <a href="status.html">CHANGES</a> or <a href="https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=10436&amp;version=12354762">JIRA</a>). </p> </div> <a name="CVE-2021-23926+-+XML+External+Entity+%28XXE%29+Processing+in+Apache+XMLBeans+versions+prior+to+3.0.0%0A++++++++++++++++%28January+13%2C+2021%29"></a> <h2 class="boxed">CVE-2021-23926 - XML External Entity (XXE) Processing in Apache XMLBeans versions prior to 3.0.0 (January 13, 2021) </h2> <div class="section"> <p>Description: <br> When parsing XML files using XMLBeans 2.6.0 or below, the underlying parser created by XMLBeans could be susceptible to XML External Entity (XXE) attacks. </p> <p>This issue was fixed a few years ago but on review, we decided we should have a CVE to raise awareness of the issue. </p> <p>Mitigation: <br> Affected users are advised to update to Apache XMLBeans 3.0.0 or above which fixes this vulnerability. XMLBeans 4.0.0 or above is preferable. </p> <p>References: <a href="https://en.wikipedia.org/wiki/XML_external_entity_attack">XML external entity attack</a> </p> </div> <a name="N1007C"></a> <h2 class="boxed"></h2> <div class="section"> <p> <a href="history.html">Version history</a> </p> </div> <a name="Getting+Started"></a> <h2 class="boxed">Getting Started</h2> <div class="section"> <a name="Start+off+with+your+own+stuff."></a> <h3 class="boxed">Start off with your own stuff.</h3> <p>If you want to get right to it with your own XML schema and instance, follow these basic steps:</p> <ol> <li> <a href="documentation/conInstallGuide.html">Install XMLBeans.</a> </li> <li>Compile your schema. Use <a href="documentation/../guide/Tools.html#scome"> <span class="codefrag">scomp</span> </a> to compile the schema, generating and jarring Java types. For example, to create a employeeschema.jar from an employeesschema.xsd file: <div class="code"> <div class="codeline"> <span class="lineno"></span><span class="codebody">scomp -out employeeschema.jar employeeschema.xsd</span> </div> </div> </li> <li>Write code. With the generated JAR on your classpath, write code to bind an XML instance to the Java types representing your schema. Here's an example that would use types generated from an employees schema: <div class="code"> <div class="codeline"> <span class="lineno"></span><span class="codebody"></span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">File xmlFile = new File("c:\employees.xml");</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody"></span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">// Bind the instance to the generated XMLBeans types.</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">EmployeesDocument empDoc =</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">EmployeesDocument.Factory.parse(xmlFile);</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody"></span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">// Get and print pieces of the XML instance.</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">Employees emps = empDoc.getEmployees();</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">Employee[] empArray = emps.getEmployeeArray();</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">for (int i = 0; i &lt; empArray.length; i++)</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">{</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">System.out.println(empArray[i]);</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody">}</span> </div> <div class="codeline"> <span class="lineno"></span><span class="codebody"></span> </div> </div> </li> </ol> <a name="Read+a+tutorial."></a> <h3 class="boxed">Read a tutorial.</h3> <p>Read our <a href="documentation/tutorial_getstarted.html">tutorial</a> to get a sense of XMLBeans basics. </p> <a name="Read+documentation+and+other+information."></a> <h3 class="boxed">Read documentation and other information.</h3> <p>On our <a href="documentation/index.html">documentation</a> page, you'll find links to several topics that describe XMLBeans features and how to use them. You'll also find links to Javadoc reference on the XMLBeans API. </p> <p>You can also check out the <a href="https://cwiki.apache.org/confluence/display/xmlbeans/XmlBeansFaq">FAQ</a>, which is updated with new answers as they're needed. </p> <p>Don't forget the <a href="https://cwiki.apache.org/confluence/display/xmlbeans/">XMLBeans Wiki</a>, which collects lots of valuable information. </p> <a name="Check+out+the+samples."></a> <h3 class="boxed">Check out the samples.</h3> <p>Many of the XMLBeans features are illustrated in our <a href="samples/index.html">samples</a>. </p> </div> </div> <!--+ |end content +--> <div class="clearboth">&nbsp;</div> </div> <div id="footer"> <!--+ |start bottomstrip +--> <div class="lastmodified"> <script type="text/javascript"><!-- document.write("Last Published: " + document.lastModified); // --></script> </div> <div class="copyright"> Copyright &copy; 2004-2024 <a href="https://www.apache.org/">The Apache Software Foundation</a> <br> Apache, Apache XMLBeans, Apache POI, the Apache feather logo, and the Apache XMLBeans logos are trademarks of The Apache Software Foundation. </div> <div id="logos"> <a href="https://validator.w3.org/check/referer"><img style="height: 31px; width: 88px;" title="Valid HTML 4.01!" alt="Valid HTML 4.01!" src="skin/images/valid-html401.png" class="logoImage"></a><a href="https://jigsaw.w3.org/css-validator/check/referer"><img style="height: 31px; width: 88px;" title="Valid CSS!" alt="Valid CSS!" src="skin/images/vcss.png" class="logoImage"></a> </div> <div id="feedback"> Send feedback about the website to: <a id="feedbackto" href="mailto:dev@poi.apache.org?subject=Feedback%C2%A0index.html">dev@poi.apache.org</a> </div> <!--+ |end bottomstrip +--> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10