How to select following siblings until a certain sibling - xpath

I'm currently working with VDA message types that have been convert to xml using a custom xml converter. However each header and line record in the source document is at the same level, as in the sample below:
<root>
<row>
<Record_type>512</Record_type>
<Customer_item_Number>A0528406</Customer_item_Number>
<Supplier_item_number>10962915</Supplier_item_number>
</row>
<row>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</row>
<row>
<Record_type>513</Record_type>
<Date>190306</Date>
<Quantity>97</Quantity>
</row>
<row>
<Record_type>512</Record_type>
<Customer_item_Number>A0528433</Customer_item_Number>
<Supplier_item_number>10962916</Supplier_item_number>
</row>
<row>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</row>
<row>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</row>
<row>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</row>
<row>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</row>
</root>
(512) record types are headers, the following (513) record types are lines for the preceding (512) record above it.
I am struggling to format this message, so that the lines (513) are indented underneath each header (512) record.
i.e. required output, something like this.
<root>
<Header>
<Record_type>512</Record_type>
<Customer_item_Number>A0528406</Customer_item_Number>
<Supplier_item_number>10962915</Supplier_item_number>
<Line>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</Line>
<Line>
<Record_type>513</Record_type>
<Date>190306</Date>
<Quantity>97</Quantity>
</Line>
</Header>
<Header>
<Record_type>512</Record_type>
<Customer_item_Number>A0528433</Customer_item_Number>
<Supplier_item_number>10962916</Supplier_item_number>
<Line>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</Line>
<Line>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</Line>
<Line>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</Line>
<Line>
<Record_type>513</Record_type>
<Date>170306</Date>
<Quantity>115</Quantity>
</Line>
</Header>
</root>
I have had some success using following sibling, but I'm unable to link this with preceding-sibling, to filter out only the required records before the next loop.
I am hoping someone will be able to assist. :)

In XQuery 3.1 you can use a tumbling window https://www.w3.org/TR/xquery-31/#id-tumbling-windows:
<root>
{
for tumbling window $record in root/row
start $s when $s/Record_type = 512
return
<Header>
{
head($record)/*,
tail($record) !
<Line>
{ * }
</Line>
}
</Header>
}
</root>
https://xqueryfiddle.liberty-development.net/gWcDMef

If your XQuery processor supports XQuery 3.0's window clauses, your query is (at least conceptually) very straight forward and efficient:
<root>{
for tumbling window $w in /root/row
start when true()
end next $n when $n/Record_type = '512'
return <Header>{
head($w)/*,
for $line in tail($w)
return <Line>{$line/*}</Line>
}</Header>
}</root>
Otherwise you have to use the preceding-sibling and following-sibling XPath axes as Mads Hansen also shows in his answer:
<root>{
for $header in /root/row[Record_type = '512']
return <Header>{
$header/*,
for $line in $header/following-sibling::row[Record_type = '513']
let $prev-headers := $line/preceding-sibling::row[Record_type = '512']
where $prev-headers[last()] is $header
return <Line>{$line/*}</Line>
}</Header>
}</root>
Here we get all lines after the current header first, and then check for each line if the last header before it is the current one. It is important here to use is instead of = or eq because the latter two work on atomic items only. This means that XML nodes are atomized (i.e., stripped down to just their concatenated text contents) before the comparison is performed. The is operator compares node identity instead.

For every row that has a Record_type of 512, create a Header element.
In order to find the row elements for the relevant group of Line elements, you want to select the row elements that are following-sibling from the 512 who's Record_type = 513 and who's first preceding-sibling is the current header.
for $header in $doc/root/row[Record_type = 512]
let $lines := $header/following-sibling::row[Record_type = 513]
[preceding-sibling::row[Record_type = 512][1] = $header]
return
<Header>{
$header/*,
for $line in $lines
return <Line>{ $line/* }</Line>
}</Header>

Related

xQuery how to merge two list into one?

I have an XML document:
<resultsets>
<row>
<emp_no>10001</emp_no>
<first_name>Georgi</first_name>
<last_name>Facello</last_name>
</row>
<row>
<emp_no>10002</emp_no>
<first_name>Bezalel</first_name>
<last_name>Simmel</last_name>
</row>
<row>
<emp_no>10003</emp_no>
<first_name>Parto</first_name>
<last_name>Bamford</last_name>
</row>
</resultsets>
Currently, my code is as follows:
let $first := doc("db/apps/flowq/index/employees.xml")//first_name
let $last := doc("db/apps/flowq/index/employees.xml")//last_name
My question is, is it possible ONLY use $first and $last to generate the following result?
<row>
<first_name>Georgi</first_name>
<last_name>Facello</last_name>
</row>
<row>
<first_name>Bezalel</first_name>
<last_name>Simmel</last_name>
</row>
<row>
<first_name>Parto</first_name>
<last_name>Bamford</last_name>
</row>
Basically, if we have two lists of nodes same size, how can we merge them one by one? I have tried
($first_name, $last_name) and ($first_name union $last_name) but doesn't work,
thanks!
And of course for FP afficionados there's the basic recursive function:
declare function local:merge($s1, $s2) {
if ($s1 and $s2)
then (<row>{head($s1), head($s2)}</row>,
local:merge(tail($s1), tail($s2)))
else ()
}
It is a bit odd that you first extract the two different sequences from the same document but in general if you want positional merging then using for $item at $pos can help:
let $first := (
<first_name>Georgi</first_name>,
<first_name>Bezalel</first_name>,
<first_name>Parto</first_name>),
$second := (
<last_name>Facello</last_name>,
<last_name>Simmel</last_name>,
<last_name>Bamford</last_name>
)
return for $name at $pos in $first
return
<row>
{$name, $second[$pos]}
</row>
http://xqueryfiddle.liberty-development.net/eiQZDbb
Or use higher-order for-each-pair:
let $first := (
<first_name>Georgi</first_name>,
<first_name>Bezalel</first_name>,
<first_name>Parto</first_name>),
$second := (
<last_name>Facello</last_name>,
<last_name>Simmel</last_name>,
<last_name>Bamford</last_name>
)
return for-each-pair($first, $second, function($f, $s) { <row>{$f, $s}</row>})

oracle query to get list of xml nodes and their values using oracle

I have a XML column and i need help to write the query to display the nodes and their values.
below is the data from my xml column:
<item_content>
<stimulus_reference>
<table_wrapper>
<table frame="all" colsep="1" rowsep="1" pgwide="0">
<tgroup cols="3">
<thead>
<row>
<entry />
<entry align="center">Male</entry>
<entry align="center">Female</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left">Juniors</entry>
<entry align="right">12</entry>
<entry align="right">3</entry>
</row>
<row>
<entry align="left">Seniors</entry>
<entry align="right">9</entry>
<entry align="right">21</entry>
</row>
</tbody>
</tgroup>
</table>
</table_wrapper>
<rationale>This is a rationale paragraph</rationale>
</stimulus_reference>
<task>
<item_stem>
<stem_paragraph>The table above shows the distribution of students that attended a concert, by class and gender.</stem_paragraph>
</item_stem>
<item_response>
<response_choices>
<columnar_choice_list>
<columns align="character" align_character="1">
<choice_row numeric_identifier="1">
CHROW1
<choice_cell>3</choice_cell>
</choice_row>
<choice_row numeric_identifier="2">
CHROW2
<choice_cell>15</choice_cell>
</choice_row>
<choice_row numeric_identifier="3">
CHROW3
<choice_cell>2102</choice_cell>
</choice_row>
<choice_row numeric_identifier="4">
CHROW4
<choice_cell>321</choice_cell>
</choice_row>
ColumnsData
</columns>
</columnar_choice_list>
</response_choices>
</item_response>
</task>
<math_expression>1+2=3</math_expression>
</item_content>
i want the output in the below format
Node_Name Node_val
stimulus_reference
table_wrapper
table
tgroup
thead
row
entry
entry Male
entry Female
tbody
row
entry Juniors
entry 12
entry 3
row
entry Seniors
entry 9
entry 21
task
item_stem
stem_paragraph The table above shows the distribution of students that attended a concert, by class and gender.
item_response
response_choices
columnar_choice_list
columns ColumnsData
choice_row CHROW1
choice_cell 3
choice_row CHROW2
choice_cell 15
choice_row CHROW3
choice_cell 2102
choice_row CHROW4
choice_cell 321
appreciate your help on this.
//* returns all nodes on all levels.
name() returns node name
text() returns node value
If you want only text nodes you have to replace //* with //*[text()]
select * from xmltable('//*' passing xmltype ('
<item_content>
<stimulus_reference>
<table_wrapper>
<table frame="all" colsep="1" rowsep="1" pgwide="0">
<tgroup cols="3">
<thead>
<row>
<entry />
<entry align="center">Male</entry>
<entry align="center">Female</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left">Juniors</entry>
<entry align="right">12</entry>
<entry align="right">3</entry>
</row>
<row>
<entry align="left">Seniors</entry>
<entry align="right">9</entry>
<entry align="right">21</entry>
</row>
</tbody>
</tgroup>
</table>
</table_wrapper>
<rationale>This is a rationale paragraph</rationale>
</stimulus_reference>
<task>
<item_stem>
<stem_paragraph>The table above shows the distribution of students that attended a concert, by class and gender.</stem_paragraph>
</item_stem>
<item_response>
<response_choices>
<columnar_choice_list>
<columns align="character" align_character="1">
<choice_row numeric_identifier="1">
CHROW1
<choice_cell>3</choice_cell>
</choice_row>
<choice_row numeric_identifier="2">
CHROW2
<choice_cell>15</choice_cell>
</choice_row>
<choice_row numeric_identifier="3">
CHROW3
<choice_cell>2102</choice_cell>
</choice_row>
<choice_row numeric_identifier="4">
CHROW4
<choice_cell>321</choice_cell>
</choice_row>
ColumnsData
</columns>
</columnar_choice_list>
</response_choices>
</item_response>
</task>
<math_expression>1+2=3</math_expression>
</item_content>')
columns
node_name varchar2(100) path 'name()',
node_value varchar2(100) path 'text()'
)

XPath to parse eCFR XML using attributes and nodes

This question has been significantly edited to make things a bit clearer.
I am attempting to pull data out of the electronic Code of Federal Regulations XML feed (http://www.gpo.gov/fdsys/bulkdata/CFR/2015/title-15/CFR-2015-title15-vol2.xml) and am having trouble.
Specifically, I'd like to grab data that will be matched by a combination of Node and Attribute. In the following snippet of XML, you can see some of the text I'd like to grab. I would like to obtain the data for each FP node where the attribute FP-2 is present. I would also like to grab the data for each FP node having the attribute FP-1.
<APPENDIX>
<EAR>Pt. 774, Supp. 1</EAR>
<HD SOURCE="HED">Supplement No. 1 to Part 774—The Commerce Control List</HD>
<HD SOURCE="HD1">Category 0—Nuclear Materials, Facilities, and Equipment [and Miscellaneous Items]</HD>
<HD SOURCE="HD1">A. “End Items,” “Equipment,” “Accessories,” “Attachments,” “Parts,” “Components,” and “Systems”</HD>
<FP SOURCE="FP-2">
<E T="02">0A002Power generating or propulsion equipment “specially designed” for use with space, marine or mobile “nuclear reactors”. (These items are “subject to the ITAR.” See 22 CFR parts 120 through 130.)</E>
</FP>
<FP SOURCE="FP-2">
<E T="02">0A018Items on the Wassenaar Munitions List (see List of Items Controlled).</E>
</FP>
<FP SOURCE="FP-1">
<E T="04">License Requirements</E>
</FP>
<FP SOURCE="FP-1">
<E T="03">Reason for Control:</E> NS, AT, UN</FP>
<GPOTABLE CDEF="s50,r50" COLS="2" OPTS="L2">
<BOXHD>
<CHED H="1">Control(s)</CHED>
<CHED H="1">Country Chart (See Supp. No. 1 to part 738)</CHED>
</BOXHD>
<ROW>
<ENT I="01">NS applies to entire entry</ENT>
<ENT>NS Column 1.</ENT>
</ROW>
<ROW>
<ENT I="01">AT applies to entire entry</ENT>
<ENT>AT Column 1.</ENT>
</ROW>
<ROW>
<ENT I="01">UN applies to entire entry</ENT>
<ENT>See § 746.1(b) for UN controls.</ENT>
</ROW>
</GPOTABLE>
<FP SOURCE="FP-1">
<E T="05">List Based License Exceptions (See Part 740 for a description of all license exceptions)</E>
</FP>
<FP SOURCE="FP-1">
<E T="03">LVS:</E> $3,000 for 0A018.b</FP>
<FP SOURCE="FP-1">$1,500 for 0A018.c and .d</FP>
<FP SOURCE="FP-1">
<E T="03">GBS:</E> N/A</FP>
<FP SOURCE="FP-1">
<E T="03">CIV:</E> N/A</FP>
<FP SOURCE="FP-1">
<E T="04">List of Items Controlled</E>
</FP>
<FP SOURCE="FP-1">
<E T="03">Related Controls:</E> (1) See also 0A979, 0A988, and 22 CFR 121.1 Categories I(a), III(b-d), and X(a). (2) See ECCN 0A617.y.1 and .y.2 for items formerly controlled by ECCN 0A018.a. (3) See ECCN 1A613.c for military helmets providing less than NIJ Type IV protection and ECCN 1A613.y.1 for conventional military steel helmets that, immediately prior to July 1, 2014, were classified under 0A018.d and 0A988. (4) See 22 CFR 121.1 Category X(a)(5) and (a)(6) for controls on other military helmets.</FP>
<FP SOURCE="FP-1">
<E T="03">Related Definitions:</E> N/A</FP>
<FP>
<E T="03">Items:</E> a. [Reserved]</FP>
<P>b. “Specially designed” components and parts for ammunition, except cartridge cases, powder bags, bullets, jackets, cores, shells, projectiles, boosters, fuses and components, primers, and other detonating devices and ammunition belting and linking machines (all of which are “subject to the ITAR.” (See 22 CFR parts 120 through 130);</P>
<NOTE>
<HD SOURCE="HED">
<E T="03">Note:</E>
</HD>
<P>
<E T="03">0A018.b does not apply to “components” “specially designed” for blank or dummy ammunition as follows:</E>
</P>
<P>
<E T="03">a. Ammunition crimped without a projectile (blank star);</E>
</P>
</APPENDIX>
To complicate matters, I'm trying to pull this data into Filemaker, but upon edit, I'll stick to simple XSL.
The following XSL grabs all of the FP nodes without differentiation.
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="//FP">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Modifying this to match on xsl:template match="FP[#SOURCE='FP-1'] allows me to make the necessary match based on the attribute, but I'm still not clear on how to capture the data I need. Thoughts?
A few things:
Your XSLT actually is not an XSLT format
In XPath, to reference an attribute (i.e., SOURCE), it must be prefixed with #.
Finally, there are many FP1s and FP2s but your setup only choose first instances.
Consider the following XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output version="1.0" encoding="UTF-8"/>
<xsl:template match="/">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<METADATA>
<FIELD NAME="ECCNFP_2" TYPE="TEXT"/>
<FIELD NAME="ECCNFP_1" TYPE="TEXT"/>
</METADATA>
<RESULTSET>
<xsl:for-each select="//FP[#SOURCE = 'FP-2']/E[#T='02']">
<ROW>
<COL>
<DATA><xsl:value-of select="substring(.,1,5)"/></DATA>
</COL>
</ROW>
</xsl:for-each>
<xsl:for-each select="//FP[#SOURCE = 'FP-1']/E[#T='02']">
<ROW>
<COL>
<DATA><xsl:value-of select="substring(.,1,5)"/></DATA>
</COL>
</ROW>
</xsl:for-each>
</RESULTSET>
</FMPXMLRESULT>
</xsl:template>
</xsl:stylesheet>
Which would output:
<?xml version='1.0' encoding='UTF-8'?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<METADATA>
<FIELD NAME="ECCNFP_2" TYPE="TEXT"/>
<FIELD NAME="ECCNFP_1" TYPE="TEXT"/>
</METADATA>
<RESULTSET>
<ROW>
<COL>
<DATA>0A002</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A018</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
And partial output of full web link xml:
<?xml version='1.0' encoding='UTF-8'?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<METADATA>
<FIELD NAME="ECCNFP_2" TYPE="TEXT"/>
<FIELD NAME="ECCNFP_1" TYPE="TEXT"/>
</METADATA>
<RESULTSET>
<ROW>
<COL>
<DATA>2A000</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A002</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A018</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A521</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A604</DATA>
</COL>
</ROW>
<ROW>
<COL>
<DATA>0A606</DATA>
</COL>
</ROW>
...
In fact, point your XSLT processor to the GPO link and all FP1s and FP2s output. I just did so with Python! Close to 3,000 lines!
Your question is still not clear. If I concentrate on this part:
I would like to obtain the data for each FP node where the attribute
FP-2 is present. I would also like to grab the data for each FP node
having the attribute FP-1.
then you probably want to change this:
<xsl:for-each select="//FP">
to:
<xsl:for-each select="//FP[#SOURCE='FP-1' or #SOURCE='FP-2']">
Note that this returns the value of each FP element where the SOURCE attribute has a value of either 'FP-1' or 'FP-2'. I see no "FP node where the attribute FP-2 is present" in your input.
Note also that the // syntax is expensive in terms of processing power. You will get better performance if you use a full, explicit path.

Summary table with xForms

I have an xml like the following:
<table1>
<row>
<person>person1</person>
<value>10</value>
</row>
<row>
<person>person2</person>
<value>20</value>
</row>
<row>
<person>person1</person>
<value>5</value>
</row>
</table1>
<summaryTable>
<row>
<person>person1</person>
<value_total/>
</row>
<row>
<person>person2</person>
<value_total/>
</row>
</summaryTable>
With XForms 1 (there is no option to switch to XForms 2), using framework betterform, I want to calculate the values in the summary table, by doing the SUM of the rows in 'table1' that have the same person name. To do that I have the following binds:
<xf:bind id="bind_table1"
nodeset="table1" repeatableElement="row">
<xf:bind id="bind_head_table1" nodeset="head" />
<xf:bind id="bind_row_table1" nodeset="row">
<xf:bind id="bind_person" nodeset="person" type="xf:string" />
<xf:bind id="bind_value" nodeset="value" type="xf:integer" />
</xf:bind>
</xf:bind>
<xf:bind id="bind_summaryTable"
nodeset="summaryTable"
repeatableElement="row">
<xf:bind id="bind_head_summaryTable" nodeset="head" />
<xf:bind id="bind_row_summaryTable" nodeset="row">
<xf:bind id="bind_person_name" nodeset="person_name" type="xf:string" readonly="true"/>
<xf:bind id="bind_value_total" nodeset="value_total" type="xf:integer" readonly="true" calculate="SUM(//table1/row[person/text() = ../person_name/text()]/value)"/>
</xf:bind>
</xf:bind>
What I want to have at the end is the value_total for person1 = 15 and value_total for person2 = 20, but using this 'calculate' expression I'm getting 'NaN'. If I replace the calculate expression to compare with a literal String like:
<xf:bind id="bind_value_total" nodeset="value_total" type="xf:integer" readonly="true" calculate="SUM(//table1/row[person/text() = 'person1']/value)"/>
then I get as value_total 15 (the sum is correctly done). So it seems that the error is in the comparison expression person/text() = ../person_name/text() . Does someone have an idea about how should be the correct expression?
Thanks
Try the context() function in the calculate attribute to refer to the current node, like this:
<xf:bind nodeset="summaryTable/row/value_total" calculate="sum(//table1/row[person/text() = context()/../person/text()]/value)"/>
The context function gives you the current context node. If your bind references a nodeset with multiple nodes, it will be evaluated one time for every node, and that node is what context() returns.
It works for me with XSLTForms, maybe your version of betterForm supports it.

How to jump out of the loop and access previous elements

have one XML Structure:
<INFO>
<para Type="07">07 L„hetysluettelo</para>
<para Type="+0">+0 074064</para>
<para Type="07">07 Tilausnumero Ostajan viite</para>
<para Type="+0">+0 044275 5549177</para>
<para Type=" 0"> 0 836679586 (LONG 2478 3.63 8995.14</para>
<para Type="07">07 L„hetysluettelo2</para>
<para Type="+0">+0 074517</para>
<para Type="07">07 Tilausnumero Ostajan viite</para>
<para Type="+0">+0 044276 5534435</para>
<para Type=" 0"> 0 836679586 (LONG 2478 3.63 8995.14</para>
<para Type=" 0"> 0 L1 KUORMAL. 800 14 0.00 0.00</para>
</INFO>
I would like to use loop on para which has type SPACE0. By doing this i would alos like to fetch its previous data elements for example: +0 and 07 segments.
I am looking for this output:
<ROWS>
<ROW>
<NUMBER>074064</NUMBER>
<ORDER_NUMBER>044275</ORDER_NUMBER>
<REF>5549177</REF>
<NAME>836679586 (LONG</NAME>
<COUNT>2478</COUNT>
<PRICE>3.63</PRICE>
<TOTAL>8995.14</TOTAL>
</ROW>
<ROW>
<NUMBER>074517</NUMBER>
<ORDER_NUMBER>044276</ORDER_NUMBER>
<REF>5534435</REF>
<NAME>836679586 (LONG</NAME>
<COUNT>2478</COUNT>
<PRICE>3.63</PRICE>
<TOTAL>8995.14</TOTAL>
</ROW>
<ROW>
<NUMBER>074517</NUMBER>
<ORDER_NUMBER>044276</ORDER_NUMBER>
<REF>5534435</REF>
<NAME>L1 KUORMAL. 800</NAME>
<COUNT>14</COUNT>
<PRICE>0.00</PRICE>
<TOTAL>0.00</TOTAL>
</ROW>
</ROWS>
in some cases the elements NUMBER, ORDER_NUMBER, and REF value will remain the same because they belong to same segment.
Is it possible to do this?
I have tried this:
<xsl:for-each select="INFO/para[#Type=' 0']">
<ROW>
<NUMBER>
<xsl:value-of select="normalize-space(substring(../following-sibling::para[1],6,24))"/>
</NUMBER>
<ORDER_NUMBER>
<xsl:value-of select="normalize-space(substring(../following-sibling::para[3],7,24))"/>
</ORDER_NUMBER>
<REF>
<xsl:value-of select="normalize-space(substring(../following-sibling::para[3],31,50))"/>
</REF>
<NAME>
<xsl:value-of select="normalize-space(substring(.,7,24))"/>
</NAME>
<COUNT>
<xsl:value-of select="normalize-space(substring(.,33,8))"/>
</COUNT>
<PRICE>
<xsl:value-of select="normalize-space(substring(.,41,11))"/>
</PRICE>
<TOTAL>
<xsl:value-of select="normalize-space(substring(.,69,11))"/>
</TOTAL>
</ROW>
</xsl:for-each>
Thanks.
By using substring functions and nested loops, it worked well. So marking it closed.

Resources