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
Phillip AnkersonSubject: convert text to xml from more than one source?
Author: Phillip Ankerson
Date: 21 Aug 2008 12:12 PM
I have watched the video tutorial on how to create a customer xml converter for a text file, and have done that with a relatively simple text file. I need to read from more than one source (perhaps two text files - one for customers and one for addresses) or a database file, and create and xml file according to a spec I was given. Is this something that must be done with XQuery, or can it be done at all? We are creating an interface with Websphere...is there a pre-defined connector for this?

source 1 - customer

source 2 - address

logonId = email; notice there could be more than one address per user

Minollo I.Subject: convert text to xml from more than one source?
Author: Minollo I.
Date: 21 Aug 2008 12:47 PM
You can do that with XQuery, yes; joining data across multiple XML and/or non-XML files and/or database tables. In your case, something similar to this (using the built-in CSV converter; if the format is CSV, you don't need to create a custom one):
<root> {
for $row1 in doc("converter:CSV?c:/file1.csv")//row,
$row2 in doc("converter:CSV?c:/file2.csv")//row
where $row1/column.2 = $row2/column.3
} </root>

If the first row of the CSV contains "field names", then it's even easier, and you can get better element names in the output using "converter:CSV:first=yes?...". If you want to share some real example, we can create a sample XQuery for you.

You can integrate DataDirect XQuery/XML Converters in any Java application; so, you can surely integrate that in your WebSphere application. We do have an XQuery based servlet implementation (with sources available) that can expose virtually any XQuery as a Web service without any additional code; and it's compatible with WebSphere (see http://www.xquery.com/examples/web-service-example/xquerywebservice/).

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!  

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.