No, sorry. The Saxon SQL extension was designed as a demonstration of how to use XSLT extension instructions in Saxon, and there's no directly comparable facility in XQuery (it would have to be done using custom syntax in a pragma, which is a lot more complex to implement).
At some stage I intend to allow XQuery to invoke functions written in XSLT (Saxon already offers the reverse) which would allow such limitations to be removed.
Michael Kay

From: [] On Behalf Of Jochen Rebhan
Sent: 17 March 2006 11:46
Subject: RE: [saxon] Getting XML-data using SQL extension / XQuery


Btw: Is there a way to use the SQL extensions from XQuery ? Can't find nothing about that in the documentation nor examples.





Gesendet: 16.03.06 17:22:08
Betreff: RE: [saxon] Getting XML-data using SQL extension

Try replacing

<xsl:copy-of select="col[7]"/>


<xsl:copy-of select="saxon:parse(col[7])"/>

To convert lexical XML into tree form, you need to parse it, which is what
saxon:parse() does.
The other alternative is

<xsl:value-of select="col[7]" disable-output-escaping="yes"/>

which is more suitable if the data isn't well-formed, for example if it's
dirty HTML: but then you need to make sure that the transformation is
serializing its output.

Michael Kay

> -----Original Message-----
> From:
> [] On Behalf Of
> Mathias Payer
> Sent: 16 March 2006 15:54
> To:
> Subject: [saxon] Getting XML-data using SQL extension
> Hi list,
> I'm tying to use saxon and the saxon sql extension to transform data
> from different db's.
> A field in the database contains part of an xml document. I
> now want to
> use this document inside a xsl.
> The problem I have is t! hat all < and > are escaped (&lt; and &gt;) and
> that I only get a "string". But I want an xml tree.
> To demonstrate what I'm doing I'll post a little bit of code:
> ...
> <xsl:variable name="connection" as="java:java.lang.Object"
> xmlns:java="">
> <sql:connect driver="{$driver}" database="{$datasource}"
> user="{$username}" password="{$password}"/>
> </xsl:variable>
> ...
> <xsl:variable name="rs">
> <sql:query connection="$connection" table="aenderungen"
> column="src_nr,src_zusatz,dst_artpos,typ,inkraftdatum,gueltig_
> bis,aenderung"
> where="{concat('dst_nr=',$singlequote,$lgblnr,$singlequote,'
> AND dst_zusatz=',$singlequote,$lgblzusatz,$singlequote)}"/>
> </xsl:variable>
> <GMGBuch>
> <xsl:for-each select="$rs//row">
> <aenderung typ="{col[4]}" dst_artpos="{col[3]}">
> <source nr="{col[1]}! " zusatz="{col[2]}"/>
> <zeitraum inkraftdatum="{col[5]}" gueltig_bis="{col[6]}"/>
> <daten>
> <xsl:copy-of select="col[7]"/>
> </daten>
> </aenderung>
> </xsl:for-each>
> </GMGBuch>
> The "xml"-data is in col[7]. How can I use this data as a normal xml
> document and not as string?
> Any help is appreciated.
> Regards,
> Mathias
> --
> Information about me, my projects and contact details:

This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!! dat=121642
saxon -help mailing list

Verschicken Sie romantische, coole und witzige Bilder per SMS!   
Jetzt bei WEB.DE FreeMail: