zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #15023
[Merge] lp:~zorba-coders/zorba/data-converters-module-doc into lp:zorba/data-converters-module
William Candillon has proposed merging lp:~zorba-coders/zorba/data-converters-module-doc into lp:zorba/data-converters-module.
Commit message:
Minor documentation improvements.
Requested reviews:
William Candillon (wcandillon)
Sorin Marian Nasoi (sorin.marian.nasoi)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/data-converters-module-doc/+merge/126951
Minor documentation improvements.
--
https://code.launchpad.net/~zorba-coders/zorba/data-converters-module-doc/+merge/126951
Your team Zorba Coders is subscribed to branch lp:zorba/data-converters-module.
=== modified file 'src/com/zorba-xquery/www/modules/converters/csv.xq'
--- src/com/zorba-xquery/www/modules/converters/csv.xq 2011-08-17 23:28:43 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq 2012-09-28 12:53:22 +0000
@@ -21,7 +21,7 @@
: The functions are optimized to work with large amounts of data, in a streaming way.
:
: @author Daniel Turcanu
- : @project data processing/data converters
+ : @project Zorba/Data Converters/CSV
:)
module namespace csv = "http://www.zorba-xquery.com/modules/converters/csv";;
@@ -40,32 +40,24 @@
(:~
: Parse a CSV or fixed size text and convert to XML.<br/>
- : By default each line is converted to a <row> element, and each field to a <column> element inside <row>.<br/>
+ : By default each line is converted to a <code>row</code> element, and each field to a <code>column</code> element inside <code>row</code>.<br/>
: The format of the param $options is:<br/>
- : <csv-options:options><br/>
- : <csv [separator="default comma ,"] ? <br/>
- : [quote-char="default double quotes &quote;"]? <br/>
- : [quote-escape="default double double quotes &quote;&quote;"]? /> <br/>
- : <br/>
- : or<br/>
- : <column-widths><br/>
- : <column-width><i>[column fixed width, unsigned int]</i><column-width>*<br/>
- : </column-widths><br/>
- : <br/>
- : or<br/>
- : <column-positions><br/>
- : <column-position><i>[column position on line, unsigned int]</i><column-position>*<br/>
- : </column-positions><br/>
- : <br/>
- : <first-row-is-header [line="<i>first_line[-last_line]?</i>"]?/>?<br/>
- : <start-from-row line="<i>first_line[-last_line]?</i>"/>?<br/>
- : <add-last-void-columns/>?<br/>
- : <xml-nodes><br/>
- : [<<i>row-name</i>><br/>
- : [<<i>column-name/</i>>]?<br/>
- : </<i>row-name</i>>]?<br/>
- : </xml-nodes>?<br/>
- : </csv-options:options><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<csv-options:options>
+ : <csv [separator="default comma ,"]?
+ : [quote-char="default double quotes "e;"]?
+ : [quote-escape="default double double quotes "e;"e;"]? />
+ : <column-widths>
+ : <column-width>[(column fixed width | column fixed width), unsigned int]<column-width>*
+ : </column-widths>
+ : <first-row-is-header [line="<i>first_line[-last_line]?</i>"]?/>?
+ : <start-from-row line="<i>first_line[-last_line]?</i>"/>?
+ : <add-last-void-columns/>?
+ : <xml-nodes>
+ : [<row-name>
+ : [<column-name/>]?
+ : <row-name />]?
+ : </xml-nodes>?
+ : </csv-options:options>]]></pre>
: <br/>
: All the parameters are optional and can appear in any order.<br/>
: All the parameters are case sensitive. The namespace used is "http://www.zorba-xquery.com/modules/converters/csv-options";.<br/>
@@ -113,11 +105,11 @@
: 1,John,student</i><br/>
: <br/>
: is parsed into<br/>
- : <i><row><br/>
- : <ID>1</ID><br/>
- : <Name>John</Name><br/>
- : <Occupation>student</Occupation><br/>
- : </row></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<row>
+ : <ID>1</ID>
+ : <Name>John</Name>
+ : <Occupation>student</Occupation>
+ : </row>]]></pre>
: <br/>
: If the header names contain characters that cannot be used in a QName, they are replaced with underscore '_'.<br/>
: The namespace for the header QNames is taken from the column name specified in xml-nodes parameter, or from
@@ -134,14 +126,14 @@
: 1,John,Howard,student</i><br/>
: <br/>
: is parsed into<br/>
- : <i><row><br/>
- : <ID>1</ID><br/>
- : <Name><br/>
- : <First_Name>John</First_Name><br/>
- : <Last_Name>Howard</Last_Name><br/>
- : </Name><br/>
- : <Occupation>student</Occupation><br/>
- : </row></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<row>
+ : <ID>1</ID>
+ : <Name>
+ : <First_Name>John</First_Name>
+ : <Last_Name>Howard</Last_Name>
+ : </Name>
+ : <Occupation>student</Occupation>
+ : </row>]]></pre>
: <br/>
: This element can have an attribute "accept-all-lines" with values "false" or "true" (default "false").
: When set to true it tells the parser to not report lines that do not have the same number of items as
@@ -165,18 +157,18 @@
: that enclose the fields in the output xml if there is no header. <br/>
: If the csv has a header, only the namespace is used from the column element.<br/>
: For example, with parameter:<br/>
- : <i><xml-nodes><br/>
- : <r><br/>
- : <c/><br/>
- : </r><br/>
- : </xml-nodes></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<xml-nodes>
+ : <r>
+ : <c />
+ : </r>
+ : </xml-nodes>]]></pre>
: <br/>
: the output for each line will look like<br/>
- : <i><r><br/>
- : <c>field1</c><br/>
- : <c>field2</c><br/>
- : .......<br/>
- : </r></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<r>
+ : <c>field1</c>
+ : <c>field2</c>
+ : ......
+ : </r>]]></pre>
: </dd>
: </dl>
: @param $csv the string containing the csv or fixed size text.
@@ -220,34 +212,29 @@
:
: Note: if you want to serialize out the result, make sure that the serializer method is set to "text".
: For example, in zorba command line, you have to set the param --serialize-text.
- : When using the <pre>file:write(...)</pre> function, you have to set the
+ : When using the <code>file:write(...)</code> function, you have to set the
: method serialization parameter to "text":
- : <pre>
- : <output:serialization-parameters<
- : <output:method value="text"/<
- : </output:serialization-parameters<
- : </pre>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<output:serialization-parameters>
+ : <output:method value="text"/>
+ : </output:serialization-parameters>]]></pre>
:
- : The <pre>$options</pre> parameter must have the following format:
- : <pre>
- : <csv-options:options><br/>
- : <csv [separator="default comma ,"] ? <br/>
- : [quote-char="default double quotes &quote;"]? <br/>
- : [quote-escape="default double double quotes &quote;&quote;"]? /> <br/>
- : <br/>
- : or<br/>
- : <column-widths [align="left|right"]?><br/>
- : <column-width [align="left|right"]?><i>[column fixed width, unsigned int]</i><column-width>*<br/>
- : </column-widths><br/>
- : <br/>
- : or<br/>
- : <column-positions [align="left|right"]?><br/>
- : <column-position [align="left|right"]?><i>[column position on line, unsigned int]</i><column-position>*<br/>
- : </column-positions><br/>
- : <br/>
- : <first-row-is-header/>?<br/>
- : </csv-options:options>
- : </pre>
+ : The <code>$options</code> parameter must have the following format:
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<csv-options:options>
+ : <csv [separator="default comma ,"]?
+ : [quote-char="default double quotes "e;"]?
+ : [quote-escape="default double double quotes "e;"e;"]? />
+ : <column-widths>
+ : <column-width>[(column fixed width | column fixed width), unsigned int]<column-width>*
+ : </column-widths>
+ : <first-row-is-header [line="<i>first_line[-last_line]?</i>"]?/>?
+ : <start-from-row line="<i>first_line[-last_line]?</i>"/>?
+ : <add-last-void-columns/>?
+ : <xml-nodes>
+ : [<row-name>
+ : [<column-name/>]?
+ : <row-name />]?
+ : </xml-nodes>?
+ : </csv-options:options>]]></pre>
:
: All the parameters are optional and can appear in any order.<br/>
: All the parameters are case sensitive. The namespace used is "http://www.zorba-xquery.com/modules/converters/csv-options";.<br/>
@@ -292,11 +279,11 @@
: <dd>The presence of this element indicates that the first row will contain the header, that is, the names of
: the column elements. Only the column names from the first row element are taken into account.<br/>
: For example, the row xml:<br/>
- : <i><row><br/>
- : <ID>1</ID><br/>
- : <Name>John</Name><br/>
- : <Occupation>student</Occupation><br/>
- : </row></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<row>
+ : <ID>1</ID>
+ : <Name>John</Name>
+ : <Occupation>student</Occupation>
+ : </row>]]></pre>
: <br/>
: is converted to<br/>
: <i>ID,Name,Occupation<br/>
@@ -309,15 +296,14 @@
: When generating the subheaders, the non-whitespace text nodes are also taken into account,
: and a separate column is generated for them too.<br/>
: For example, the xml row element:<br/>
- : <i><row><br/>
- : <ID>1</ID><br/>
- : <Name><br/>
- : Mr.<br/>
- : <First_Name>John</First_Name><br/>
- : <Last_Name>Howard</Last_Name><br/>
- : </Name><br/>
- : <Occupation>student</Occupation><br/>
- : </row></i><br/>
+ : <pre class="ace-static" ace-mode="xquery"><![CDATA[<row>
+ : <ID>1</ID>
+ : <Name>
+ : <First_Name>John</First_Name>
+ : <Last_Name>Howard</Last_Name>
+ : </Name>
+ : <Occupation>student</Occupation>
+ : </row>]]></pre>
: is converted to<br/>
: <i>ID,Name,,Occupation<br/>
: ,,First Name,Last Name,<br/>
=== modified file 'src/com/zorba-xquery/www/modules/converters/html.xq'
--- src/com/zorba-xquery/www/modules/converters/html.xq 2011-08-18 23:42:49 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq 2012-09-28 12:53:22 +0000
@@ -26,7 +26,7 @@
:
: @author Sorin Nasoi
: @library <a href="http://tidy.sourceforge.net/";>Tidy C++ Library</a>
- : @project data processing/data converters
+ : @project Zorba/Data Converters/HTML
:
:)
module namespace html = "http://www.zorba-xquery.com/modules/converters/html";;
Follow ups