[http://creativecommons.org/licenses/by/3.0/]
This work is licensed under a CC
Attribution 3.0 Unported License [http://creativecommons.org/licenses/by/3.0/]
While XML databases are a good solution for managing XML content, frequently it is necessary to uses non-XML databases for managing XML content. In most cases, these databases will be relational databases. There a two major approaches of how to manage XML content in a relational database. The first approach is to define a mapping between XML and relational structures and work with this mapping. The second approach is to use the XML-specific functionality, which is increasingly provided by relational databases, turning them into XML-aware databases.
self-describing)
File Systems as XML Databases
XML-find/grep
)
![]() |
|
hide the XML, why not work on XML directly?
query the XHTML snippet
persistent DOM)
flavors
XML
)XML
typeSELECT e.EmpId, e.FirstName, e.LastName, e.StartDate, e.EndDate FROM Employees e WHERE e.EmpId = 12
SELECT XMLELEMENT(NAME "employee", XMLATTRIBUTES(e.EmpId as "id"), XMLELEMENT(NAME "names", XMLELEMENT(NAME "first", e.FirstName), XMLELEMENT(NAME "last", e.LastName)), XMLELEMENT(NAME "hire-dates", XMLATTRIBUTES(e.StartDate as "start", e.EndDate as "end"))) FROM Employees e WHERE e.EmpId = 12
no tables
typed Infosets) as their document model
<addresses version="1.0"> <address id="1"> <fullname>Andreas Laux</fullname> <born day='1' month='12' year='1978'/> </address> </addresses>
<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/xupdate"> <xupdate:insert-after select="/addresses/address[1]" > <xupdate:element name="address"> <xupdate:attribute name="id">2</xupdate:attribute> <fullname>Lars Martin</fullname> <born day='2' month='12' year='1974'/> </xupdate:element> </xupdate:insert-after> </xupdate:modifications>
do insert <year>2005</year> after fn:doc("bib.xml")/books/book[1]/publisher
do delete fn:doc("bib.xml")/books/book[1]/author[last()]
do replace fn:doc("bib.xml")/books/book[1]/publisher with fn:doc("bib.xml")/books/book[2]/publisher