Project

Profile

Help

Command Line Syntax for Saxon

Added by Anonymous over 17 years ago

Legacy ID: #4215891 Legacy Poster: Vikas (vikas_acc)

Hi, I need to perform XML to CSV transformation using Saxon. I created a XQuery (.xq) file for that to perform Saxon XQuery Transformation for CSV. I When I execute the following Command-Line, it generate CSV file but include XML Prolog also. Is there any option to generate CSV with-out XML Prolog. Command Line: ------------- java net.sf.saxon.Query -s C:\Data.xml C:\Transform.xq XQuery Output: -------------- <?xml version="1.0" encoding="UTF-8"?>Hello,123456,Completed XQuery File: ------------ xquery version "1.0"; concat("Hello", ",", data(RespondWorkOrder/serviceorderload/soNumber), ",", data(RespondWorkOrder/serviceorderload/completedCode)) XML File: --------- <RespondWorkOrder> <serviceorderload> <soNumber>123456</soNumber> <completedCode>Completed</completedCode> </serviceorderload> </RespondWorkOrder> Please can anybody help suggesting how to generate CSV file with out XML Prolog to generate file like: Hello,123456,Completed Thanks, Vikas


Replies (1)

RE: Command Line Syntax for Saxon - Added by Anonymous over 17 years ago

Legacy ID: #4216113 Legacy Poster: Michael Kay (mhkay)

For CSV output you should be using the text output method not the XML output method. Select this using !method=text at the end of the command line, or using declare option saxon:output "method=text"; in the query prolog. Michael Kay

    (1-1/1)

    Please register to reply