[xquery-talk] A Couple of Questions - OOXML and SQL

Pete williep_t3 at yahoo.com
Thu Apr 3 10:04:30 PST 2008

  I'd just add that the degree of difficulty in
getting meaningful information out of OOXML docs is
probably dependant on what you're searching for and
which format you're working with.  I'm able to query,
markup, and reuse parts of Word 2007 documents
(WordprocessingML) quite effectively. 

  There are 2 elements you can use in WordprocessingML
for adding semantic concepts/markup to your documents,
<w:customXml> and <w:sdt>. They both have restrictions
on use, so check part 4 of the ECMA specs for all the
details. ( It's a short section, just search on the
tag names.)  But in a nutshell, <w:customXml> allows
you to  markup within the main body of content in the
Word package (the document.xml file).  The latter
allows you to reference custom XML pieces ( stored in
the Word document package (.docx, etc.)) from the main
body through XPath.   For both elements, the name for
the element you define is actually an attribute.

<w:customXml w:element="Foo">

Hope this helps,

--- Michael Kay <mike at saxonica.com> wrote:

> 1. It's certainly possible to get meaningful
> information out of Microsoft
> Office XML formats - but it's not easy! I haven't
> used XQuery on this, but
> I've done it using XSLT 2.0, making fairly heavy use
> of the positional
> grouping facilities which have no direct equivalent
> in XQuery 1.0; I think
> that for this kind of data structure XSLT's template
> rules are also very
> useful. So my first choice would have been XSLT
> rather than XQuery. However,
> the degree of difficulty depends very much on what
> information you are
> hoping to extract, and on the degree of regularity
> present in the input
> documents.
> 2. XQuery doesn't currently have update support
> (though it's coming soon and
> is available in some products). But you'll find
> equivalents to most of SQL's
> set operators in XQuery. It's a different data model
> (sequences rather than
> sets, hierarchies rather than tables, nodes with
> identity rather than only
> values), so the details are obviously rather
> different. But one could argue
> that the SQL operators (with some exceptions such as
> "group by") drop out as
> a subset of the XQuery operators.
> Michael Kay
> http://www.saxonica.com/
>   _____  
> From: talk-bounces at x-query.com
> [mailto:talk-bounces at x-query.com] On Behalf
> Of Tsao, Scott
> Sent: 03 April 2008 13:30
> To: talk at x-query.com
> Subject: [xquery-talk] A Couple of Questions - OOXML
> and SQL
> During a recent XQuery Overview presentation, there
> were a couple of
> questions raised which I am searching for answers:
>    1. Office Open XML (OOXML) is a file format used
> by the Microsoft Office
> 2007 applications. Can XQuery be used to get
> meaningful information from an
> OOXML document, or would it only return items based
> on formatting aspects
> (all heading 1s, or all list items).
>    2. SQL is based in part on Set theory from
> Mathematics, and Set algebra.
> It allows set operations "update all red projects to
> green." Does XQuery
> support set algebra? For example, SQL join is a set
> operation that has
> inner, outer, Cartesian forms.
> http://en.wikipedia.org/wiki/Algebra_of_sets
> Do you have answers to those questions? If you do,
> please do share!
> Thanks,
> Scott Tsao 
> Associate Technical Fellow 
> The Boeing Company 
> > _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk

More information about the talk mailing list