XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
alain colletSubject: 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

Some reflexion on this topic ?
Tks
Alain Collet

Posttop
Ivan PedruzziSubject: 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.

Hope this helps
Ivan


 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.