[xquery-talk] QName in content

Florent Georges lists at fgeorges.org
Thu Nov 25 10:07:43 PST 2010


Daniela Florescu wrote:

  Hi,

> >  What would you like a QName to be serialized to when cast to
> > a string?

> I really don't have any particular personal preferences.

> But I'd like something that, once I serialize a QName, and
> schema- validating it as a Qname, I get my (full) QName back,
> please.

  The lexical representation of a QName is "prefix:local-name",
and is dependent on the context (the bindings in scope).  I think
that's consistent with the original definition of QNames.  That's
a bit of work to ensure the QName is consistent with the context
when you have to generate them, but when you read them, you can
just use resolve-QName($qname,$element) (I personally think this
could be eased with a resolve-QName($qname) in case $qname is a
node itself).

  I guess my question is more: "how would you like to deal with
QNames from within XQuery?"  For now you have e.g. to use
resolve-QName() when you read one, or ensure the prefix is
correctly bound in the context when you write one.  How would you
like to ease those? (for the writing part, that's easy, you just
need the equivalent of xsl:namespace ;-))

  Regards

-- 
Florent Georges
http://fgeorges.org/




      



More information about the talk mailing list