Tuesday, August 12, 2008

XQuery Tips and Tricks - Kurt Cagle - Nocturne

Discussion on oXygen vs. Stylus Studio. Appears to come down to price and responsiveness. Kurt also mentioned that if you are comfortable with the Stylus Studio interface then you are fine, but he likes the oXygen interface.

He's using eXist as the database. Reminds people that images and binaries are accessible from the database as well.

<Pizza Break - Thank You Anonymous Donor>

One of the coolest features: "You can store the XQueries themselves within the database."

GEEK OUT! He is using creation of characters for a D&D like game as the example....Chaotic Neutral Cleric for me!

Tip: declare function local:randchoose($ctermset as node()) as xs:string{
Defining the function as local allows you to keep that namespace private and have another namespace for the public output.

Tip: {$gender}
Embed Xquery in XML by using the {} operator.

Tip: string{$character/gender}
Remember that XPath returns element() and attribute() (and others) not text, unless specifically requested. Could easily cause problems that aren't immediately clear in a browser.

conf.xml in eXist:
setup - serielizer, scheduler, automatic XSL generation, indentation, XSLT transformer, validation mode, Xquery modules section...optional modules (turn them on -uncomment them)
then run the build routine.

Tip: in eXist -
  • util, and request modules are good to get to know.
  • transform allows the use of XSLT on XML in the XQuery. So use XQuery to collect the data and XSLT to transform it...easier recursion.
  • sql module allows you to get connections from just about anywhere with a URI
I'm not sure there was a lot of information for people using a dbase other than eXist or people who are pretty knowledgeable about XQuery. But it was pretty cool to watch him code in front of us. I like seeing people who do their jobs well, do their jobs well.

No comments: