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
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
chris miszturSubject: Using adapter URL in pipeline.
Author: chris misztur
Date: 11 Jun 2013 02:55 PM
Hello.

I have created an xquery document by using the mapper and it looks like so:

declare namespace a = "http://x/vendor";

<b:AriadneNormalized>
<b:AddressEntries>
{
for $AddressEntry in /a:AriadneRaw/a:AddressEntries/a:AddressEntry
return
<b:AddressEntry>
<b:Division>
{
$AddressEntry/a:DIV/text()
}
</b:Division>
etc...

I can see the default scenario has an main input file identified, which is an XML file dumped out by a flat file converter. I would like to create a pipeline like in this video: http://www.stylusstudio.com/videos/pipeline2/pipeline2.html so that I can use the ConvertToXML and pass the output to the XQuery.

How do I modify my xquery so that it accepts an input from ConvertToXML and still works in the mapper?

Thanks.

Postnext
chris miszturSubject: Using adapter URL in pipeline.
Author: chris misztur
Date: 11 Jun 2013 03:20 PM
http://postimg.org/image/i2vdsbp3z/

In this image, for example, I specify the flat file on the input of 'FF to XML', however the 'Normalize Raw Data' doesn't do anything as if no data came from 'FF to XML'.

-chris


Postnext
Ivan PedruzziSubject: Using adapter URL in pipeline.
Author: Ivan Pedruzzi
Date: 11 Jun 2013 04:02 PM

if you are not getting anything most likely you converter block is not configured correctly, check the converter URL also what kind of flat file are you converting?

If you are still in trouble, zip your project with all your files and send it to
stylussupport@ivitechnologies.com


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
chris miszturSubject: Using adapter URL in pipeline.
Author: chris misztur
Date: 11 Jun 2013 04:07 PM
The converter run on its own works fine.

It's when running it in the pipeline is when it outputs the below, instead of the converted file. Do I need to modify the xquery following the ConvertToXML to accept an adapter URL?

<?xml version="1.0"?>
<adapter version="2">
<class>com.ddtek.xmlconverter.adapter.flat.Flat</class>
<input encoding="US-ASCII">http://x/vendors.div12.txt</input>
<rootName namespace="http://x/vendor">AriadneRaw</rootName>
<pretty>-1</pretty>
<viewOpts>111</viewOpts>
<region type="fixed" ignore="no">
<regionName>AddressEntries</regionName>
<start>0</start>
<split>0</split>
<nameMode>First</nameMode>
<skipRows>0</skipRows>
<omit>no</omit>
<comment>45</comment>
<eol>13 10</eol>
<regionEnd/>
<row>
<rowName>AddressEntry</rowName>
ETC...

Postnext
Ivan PedruzziSubject: Using adapter URL in pipeline.
Author: Ivan Pedruzzi
Date: 11 Jun 2013 04:39 PM

It seems like that you are using the converter definition (.conv) as input of your converter block

See screens attached

1) ConvertToXML_properties.PNG set the Converter URL property to you .conv file

2) ConvertToXML_InputPort_properties.PNG selct the input port and set the url to the flat file you want to convert

3) make sure that the single block works


Ivan Pedruzzi
Stylus Studio Team

Postnext
chris miszturSubject: Using adapter URL in pipeline.
Author: chris misztur
Date: 11 Jun 2013 08:11 PM
Ha... I didn't click the magic ellipse for the converter selection, I just pasted the .conv URL.

(solved)

Thanks!

Posttop
chris miszturSubject: Using adapter URL in pipeline.
Author: chris misztur
Date: 11 Jun 2013 04:27 PM
I changed my xquery to the following and assigned the parameter value to:

doc('adapter:http://x/conv_vendors.div12.conv?http://x/vendors.div12.txt')

But I am not sure what else I need to change in the xquery FWLOR to iterate the parameter value instead of the document assigned in the mapper. It would be nice if the two were interchangable so the visual mapper remains functional but the xquery can be automated in a pipeline.



declare namespace b = "http://xout/vendor";
declare namespace a = "http://xin/vendor";
declare variable $inputFile as document-node() external;


<b:AriadneNormalized>
<b:AddressEntries>
{
for $AddressEntry in /a:AriadneRaw/a:AddressEntries/a:AddressEntry
return
<b:AddressEntry>
<b:Division>
{
$AddressEntry/a:DIV/text()
}
</b:Division>

ETC...

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.