qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] Re: TreeList implementation


From: Joseph Coffland
Subject: Re: [Qexo-general] Re: TreeList implementation
Date: Thu, 26 Feb 2004 12:08:49 -0500

Per Bothner,

> $ cat /tmp/prop.xql
> declare variable $x { java.lang.System:getProperty("x", "unknown") };
> declare variable $y { java.lang.System:getProperty("y", "unknown") };
> "The value of x is ",$x, " while y is ",$y,"
> "
> 
> $ java -Dx='X-value' -jar kawa-1.7.90.jar -f /tmp/prop.xql
> The value of x is X-value while y is unknown
Wow, thanks.

> let $a := doc("a.xml")/a return
> let $b := doc("b.xml") return
> element a {$a/@*, $a/node(), $b}
This helps, but after this I still need to traverse the resulting
document and add in a lot of new elements which depend on the
contents of the document.  I believe it comes down to this.  If
I know all the elements and attributes in the document ahead
of time it is possible, but messy.  I don't want to have to rewrite
my XQuery scripts every time a add something to my XML format.

I'm trying to implement an algorithm which first takes two documents
and appends them like above.  Then using information from a third
document it connects parts of the two documents with 'link' elements.
The algorithm requires that I recur down into the append documents
as directed by the third document.  Then upon encountering a 'mapping'
I must add 'link's back up to the top and connect them.  To do this
in XQuery with out append you must know all the elements you want
to add to the root before you move to the children.  There may be a
way to do this, but it is much more complicated than if I could used
append.

I hate spending a lot of time on the 'wrong' solution.  Maybe I should
try to implement the movable gap in TreeList.  The other option is
to just implement this in C.


> Not sure what you mean by a string "matching" a data type.  A string
> can be *cast* to a data type, and XQuery (but not Qexo) has a "castable"
> operation.
For example in the XQuery documentation this construction is listed:

  xs:unsignedInt("12")

How do you know "12" is an unsignedInt?  What I mean by matching is
taking
a string and checking if it fits a given type.  In general any
constructor
can take a string.  I'm just not sure how to do this with Xerces.  Of
course
we could just write this code, but Xerces must do it somewhere.

Joseph
-- 
  Joseph Coffland
  address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]