で普段はVBなんて数年間やっていないのでWebを探したら、「拡張メソッド」というのがありました.実は上記のmDataRowの要素はCellInfoというクラスのインスタンスなんですが、これを一般化して、array As T(,)の行をIEnumrableとして取り出せる拡張メソッドを書いてみました.以下のような感じです.
Imports System.Runtime.CompilerServices
''' <summary>''' Extend two dimensional array : get IEnumerble or list of row ''' </summary>Public Module ArrayEx
<Extension()>Public Iterator Function GetRow(Of T)(ByValarrayAs T(,),ByVal row AsInteger)As IEnumerable(Of T)For i AsInteger=0Toarray.GetLength(1)-1
Yield array(row, i)NextEndFunction<Extension()>Public Iterator FunctionGetRows(Of T)(ByValarrayAs T(,))As IEnumerable(Of IEnumerable(Of T))For i AsInteger=0Toarray.GetLength(0)-1
Yield array.GetRow(i)NextEndFunction<Extension()>PublicFunction GetRowsAsList(Of T)(ByValarrayAs T(,))As List(Of IEnumerable(Of T))Dim list As List(Of IEnumerable(Of T))=New List(Of IEnumerable(Of T))For i AsInteger=0Toarray.GetLength(0)-1
list.Add(array.GetRow(i))NextReturn list
EndFunctionEnd Module
This instruction works only with global variables. It should be regarded as deprecated, and may be withdrawn completely at some time in the future, since it is incompatible with many of the optimizations that Saxon now performs.
There are better ways of achieving the same effect. Consider constructs such as tunnel parameters, xsl:iterate, higher-order functions, or xsl:accumulator.
<?xml version="1.0"?><!DOCTYPE topic PUBLIC"-//OASIS//DTD DITA Topic//EN""topic.dtd"><topic id="topic_55762342DAC09974FDC8"xml:lang="en-US"><title>Typographic elements testing</title><shortdesc>The typographic elements are used to highlight text with styles (such as bold, italic, and monospace). Never use these elements when a semantically specific element is available. These elements are not
intended for use by specializers, and are intended solely for use by authors when no semantically
appropriate element is available and a formatting effect is required.</shortdesc><body><section><title>sup/sub element</title><p>The superscript (<xmlelement>sup</xmlelement>) element indicates that text should be
superscripted, or vertically raised in relationship to the surrounding text.
Superscripts are usually a smaller font than the surrounding text. Use this element
only when there is not some other more proper tag. This element is part of the
<?oxy_comment_start author="toshi" timestamp="20200719T210652+0900" comment="<p>要素をまたがったコメントが書けてしまいます.これは通常のXSLTスタイルシートでは処理しようがありません."?>DITA
highlighting domain.</p><p>A subscript (<xmlelement>s<?oxy_comment_end?>ub</xmlelement>) indicates that text
should be subscripted, or placed lower in relationship to the surrounding text.
Subscripted text is often a smaller font than the surrounding text. Formatting may
vary depending on your output process. This element is part of the DITA highlighting
domain.</p><p>The power produced by the electrohydraulic dam was 10<sup>10</sup> more than the
older electric plant. The difference was H<sub id="sub_99876530FDA634CE2A34" >2</sub>O.</p></section></body></topic><?oxy_options track_changes="on"?>
<?oxy_insert_start author="toshi" timestamp="20200719T192312+0900"?>Use this element
only when there is not some other more proper element. For example, for specific items such as GUI
controls, use the <xmlelement>uicontrol</xmlelement> element. This element is part of the DITA highlighting domain.<?oxy_insert_end?>
削除された内容は処理命令の中に保存されます.
<?oxy_delete author="toshi" timestamp="20200719T203739+0900" content="<b>STOP!</b> This is <b>very</b> important!"?>
コメントも次のように範囲が囲まれます.
<?oxy_comment_start author="toshi" timestamp="20200719T204110+0900" comment="重要な指摘!Typographic elementは出力の体裁を指定するので、論理的な意味は持っていない."?>
Use this element only when there is not some other more proper element.
<?oxy_comment_end?>
<p>The superscript (<xmlelement>sup</xmlelement>) element indicates that text should be
superscripted, or vertically raised in relationship to the surrounding text.
Superscripts are usually a smaller font than the surrounding text. Use this element
only when there is not some other more proper tag. This element is part of the
<?oxy_comment_start author="toshi" timestamp="20200719T210652+0900" comment="<p>要素をまたがったコメントが書けてしまいます.これは通常のXSLTスタイルシートでは処理しようがありません."?>DITA
highlighting domain.</p><p>A subscript (<xmlelement>s<?oxy_comment_end?>ub</xmlelement>) indicates that text
should be subscripted, or placed lower in relationship to the surrounding text.
Subscripted text is often a smaller font than the surrounding text. Formatting may
vary depending on your output process. This element is part of the DITA highlighting
domain.</p>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE concept PUBLIC"-//OASIS//DTD DITA Concept//EN""concept.dtd"><concept id="cConrefTargetConcept"><title>Conref Target Concept</title><shortdesc>
Contains conref target elements
</shortdesc><conbody><div id="div-001"><p>This paragraph is contained in <xmlelement>div</xmlelement> element and contains xref element that refers paragraph in parent div. <xref href="#./p-999"format="dita">The reference to paragraph authored using <xmlatt>href=#./element-id</xmlatt> notation.</xref></p><p>Dummy paragraph</p><p>Dummy paragraph</p>
...
<p id="p-999">The referenced paragraph.</p></div></conbody></concept>
<concept id="cConrefSourceConcept"><title>Conref Source Concept</title><conbody><div><p>This paragraph is contained in <xmlelement>div</xmlelement> element and
contains xref element that refers paragraph in parent div.
<xref href="#cConrefSourceConcept/p-999"format="dita" ><?ditaot usertext?>The reference to paragraph authored
using <xmlatt>href=#./element-id</xmlatt> notation.</xref></p><p>Dummy paragraph</p>
...
<p id="d7e148">The referenced paragraph.</p></div></conbody></concept>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE concept PUBLIC"-//OASIS//DTD DITA Concept//EN""concept.dtd"><concept id="cConrefTargetConcept"><title>Conref Target Concept</title><shortdesc>
Contains conref target elements
</shortdesc><conbody><div id="div-001"><p>This paragraph is contained in <xmlelement>div</xmlelement> element and contains xref element that refers paragraph in parent div. <xref href="#cConrefTargetConcept/p-999"format="dita">The reference to paragraph authored using <xmlatt>href=#topic-id/element-id</xmlatt> notation.</xref></p><p>Dummy paragraph</p><p>Dummy paragraph</p>
...
<p id="p-999">The referenced paragraph.</p></div></conbody></concept>
<concept id="cConrefSourceConcept"><title>Conref Source Concept</title><conbody><div><p>This paragraph is contained in <xmlelement>div</xmlelement> element and contains xref element that refers paragraph in parent div. <xref href="#cConrefSourceConcept/d7e148"format="dita"><?ditaot usertext?>The reference to paragraph authored using <xmlatt>href=#topic-id/element-id</xmlatt> notation.</xref></p><p>Dummy paragraph</p>
...
<p id="d7e148">The referenced paragraph.</p></div></conbody></concept>