Subject:String to XML conversion in a Xquery programm Author:alain collet Date:10 Jan 2005 02:52 AM
I collect some Data from an DataBase (SQL server) and now the format is a "XML formatted string" (with < and >).
In an XQUERY code, I would like to do a parsing of such string to obtain a pure XQUERY "XML object".
1) It seems easy to build such code (a parser function) in Xquery. Perhaps some people have already such codes ?
2) from a Stylus environnement I think that we must have possibilities around the "Doc()" instruction but ... I have the string in a variable and not in an external file.
how can we in Xquery use an external Parser module ?
The Java capability of STYLUS could be of some help ... to do that
Subject:String to XML conversion in a Xquery programm Author:Ivan Pedruzzi Date:11 Jan 2005 02:14 PM
Hi Alan
>I collect some Data from an
>DataBase (SQL server) and now
>the format is a "XML formatted
>string" (with < and >).
Which API/tool are using to collect data from SQLServer?
Is your query plain SQL?
Are you using Microsoft SQLXML?
How the query result looks like? posting a sample would help
>In an XQUERY code, I would
>like to do a parsing of such
>string to obtain a pure XQUERY
>"XML object".
XQuery let you manipulate an XML document to produce another
XML doucment or some text representation.
I am not sure what you mean by "XML Object"
>
>1) It seems easy to build such
>code (a parser function) in
>Xquery. Perhaps some people
>have already such codes ?
>
>2) from a Stylus environnement
>I think that we must have
>possibilities around the
>"Doc()" instruction but ... I
>have the string in a variable
>and not in an external file.
Which language you are using to develop the program that runs the
the query?
You should be able to save the variable content to file
and then use any XQuery processor.
You can use Stylus Studio to do most of the desaign work
Start createing a new DB to XML Data source connect to your database
write the SQL (or SQL/XML) query you need and save it as myconnection.rdbxml
- Create a new XQuery,
- Click on "Create Scenario"
- Click on ... near to Main input
- After the open dialog pops up click on the Relation DB icon on the left
and choose myconnection.rdbxml
- Click Open
- Click OK
Now you should see on the right of the XQuery editor the structure
of your input document and you can start to drag & drop node to the
editor and design the XQuery.