本文介绍了多级Muenchian分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人可以通过Muenchian分组将我指向正确的方向,从而为我提供帮助.

I was hoping someone could assist me by pointing me in the right direction with Muenchian grouping.

我具有以下形式的数据:

I have data in the following form:

<?xml version="1.0" encoding="UTF-16"?>
<LandXML schemaLocation="http://www.landxml.org/schema/LandXML-1.2 http://www.landxml.org/schema/LandXML-1.2.xsd" version="1.2" date="2013-08-01" time="22:10:15.294-00:00" readOnly="false" language="english">
<Application name="ListechStyleSheet" version="1, 0, 0, 0" manufacturer="LISTech Pty Ltd" manufacturerURL="www.liscad.com">
<Author createdBy="Listech Development Team" />
</Application>
<Project name="LISCAD" desc="OLC ANGLES JULY 2013" />
<Units>
<Metric linearUnit="meter" areaUnit="squareMeter" volumeUnit="cubicMeter" temperatureUnit="celsius" pressureUnit="HPA" />
</Units>
<Survey>
<ReducedObservation setupID="liscadGM04" azimuth="70.0112" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0114" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0113" horizDistance="254.698" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3441" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3429" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3846" horizDistance="275.373" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3854" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3913" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0615" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0627" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4956" horizDistance="174.694" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4955" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0114" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0112" horizDistance="254.697" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3442" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3431" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3848" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3855" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.556" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3914" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0613" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0626" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4955" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4954" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0111" horizDistance="254.697" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0116" horizDistance="254.698" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3441" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3433" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3848" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3857" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3911" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0614" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0627" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4957" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="329.0304" horizDistance="138.077" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00228">
<TargetPoint pntRef="SAW61" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="148.0017" horizDistance="133.943" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00227">
<TargetPoint pntRef="GM06" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="148.0026" horizDistance="133.944" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00227">
<TargetPoint pntRef="GM06" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="149.1505" horizDistance="249.106" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00250">
<TargetPoint pntRef="SAW59" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="149.1451" horizDistance="249.106" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00250">
<TargetPoint pntRef="SAW59" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="160.2644" horizDistance="260.353" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00252">
<TargetPoint pntRef="SAW159" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="160.2659" horizDistance="260.353" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00252">
<TargetPoint pntRef="SAW159" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="244.5944" horizDistance="52.087" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00210">
<TargetPoint pntRef="SAW60" />
</ReducedObservation>

等等...

我正在尝试将输出分组如下:

I am trying to get output that groups as follows:

liscadGM04
                pntRef  GM03    Min azimuth=:"70.0109"
                pntRef  GM03    Max azimuth=:"70.0117"
liscadGM04
                pntRef  SAW53  Min azimuth=:"107.3429"
                pntRef  SAW53  Max azimuth=:"107.3442"
liscadGM04
                pntRef  HB402   Min azimuth=:"309.3845"
                pntRef  HB402   Max azimuth=:"309.3857"

                Etc…..
liscadSAW160
                pntRef  SAW61  Min azimuth=:"10.0112"
                pntRef  SAW61  Max azimuth=:"70.0112"

            Etc…

我正在努力获取这样的XSL代码嵌套,这是我迄今为止微不足道的尝试的一部分:

I am struggling to get the XSL code nesting like this, here is an extract of my feeble attempts to date:

 <!-- Define a key that uses our element or attribute for grouping -->
<xsl:key name="SetUp" match="LandXML/Survey/ReducedObservation" use="@setupID" />
<!--<xsl:key name="Target" match="LandXML/Survey/ReducedObservation/TargetPoint" use="@pntRef" />-->
<xsl:key name="Target" match="LandXML/Survey/ReducedObservation/TargetPoint" use="concat(@setupID, '|', @pntRef)" />




    <xsl:template match="/">
        <html>
        <!-- Create a node set for the current Row item (.) and the first
         item in the Key of the Current item  Category. Then we check the count to see is it 1 or 2..
         If 1, So we've the same item in the node set; We have a new Category.-->
        <xsl:for-each select="LandXML/Survey/ReducedObservation[count(. | key('SetUp', @setupID)[1]) = 1]">
            <!--<xsl:for-each select="LandXML/Survey/ReducedObservation/TargetPoint[count(. | key('Target', @pntRef)[1]) = 1]">-->
                <!-- Sort by the Category -->
                <xsl:sort select="@setupID" />
                <xsl:sort select="TargetPoint/@pntRef" />
                <xsl:sort select="@azimuth"/>
                <xsl:value-of select='substring(@setupID,7)' />
                <br />

                <!-- Now loop on the items of this Category, We get them from the Key we defined -->
                <xsl:for-each select="key('SetUp', @setupID)">
                <!--<xsl:for-each select="key('Target', @pntRef)">-->
                <!-- Sort by the item Value -->
                    <xsl:if test="position() = 1">
                        Min
                        <xsl:value-of select="TargetPoint/@pntRef"/>:
                        <xsl:value-of select="@azimuth"/><br />
                    </xsl:if>

                    <xsl:if test="position() = last()">
                        Max
                        <xsl:value-of select="TargetPoint/@pntRef"/>:
                        <xsl:value-of select="@azimuth"/>
                    </xsl:if>

              <!--</xsl:for-each>-->
          </xsl:for-each>
          <hr />
          <br />
        </xsl:for-each>

有人能指出我正确的方向吗?

Can anyone point me in the right direction?

谢谢

李·摩尔斯(Lee Morse)

Lee Morse

推荐答案

好的,尝试这种基于密钥的解决方案.事实证明,由于您不是按setupID进行分组的,它只是一个分组的级别,而不是一个多层的分组,因此只需要一个键.当我开始根据您的问题标题进行基于变量的分组时,我没有注意到.它产生的结果与基于变量的解决方案相同.它会占用更少的内存,希望可以减少到可以在您的环境中工作的程度.

Okay, try this key-based solution. It turns out since you aren't grouping by setupID, it is only a single level of grouping, not a multi-level grouping, and so only one key is needed. I hadn't noticed that when I started with the variable-based grouping based on your question title. It produces the identical result as my variable-based solution. It will occupy less memory, hopefully less enough to work in your environment.

请注意,您的最小/最大计算量过大,我的两种解决方案都建议使用一种更简单的方法.

Note also your min/max calculation is overkill and both of my solutions suggest a simpler approach.

t:\ftemp>type land.xml
<?xml version="1.0" encoding="UTF-16"?>
<LandXML version="1.2" date="2013-08-01" time="22:10:15.294-00:00" readOnly="false" language="english">
<Application name="ListechStyleSheet" version="1, 0, 0, 0" manufacturer="LISTech Pty Ltd" manufacturerURL="www.liscad.com">
<Author createdBy="Listech Development Team" />
</Application>
<Project name="LISCAD" desc="OLC ANGLES JULY 2013" />
<Units>
<Metric linearUnit="meter" areaUnit="squareMeter" volumeUnit="cubicMeter" temperatureUnit="celsius" pressureUnit="HPA" />
</Units>
<Survey>
<ReducedObservation setupID="liscadGM04" azimuth="70.0112" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0114" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0113" horizDistance="254.698" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3441" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3429" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3846" horizDistance="275.373" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3854" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3913" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0615" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0627" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4956" horizDistance="174.694" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4955" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0114" horizDistance="254.696" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0112" horizDistance="254.697" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3442" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3431" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3848" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3855" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.556" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3914" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0613" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0626" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4955" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4954" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0111" horizDistance="254.697" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="70.0116" horizDistance="254.698" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00251">
<TargetPoint pntRef="GM03" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3441" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="252.3433" horizDistance="107.081" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00221">
<TargetPoint pntRef="SAW53" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3848" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="309.3857" horizDistance="275.374" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00255">
<TargetPoint pntRef="HB402" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3917" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="320.3911" horizDistance="287.557" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00258">
<TargetPoint pntRef="GM05" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0614" horizDistance="108.041" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="348.0627" horizDistance="108.040" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00222">
<TargetPoint pntRef="SAW144B" />
</ReducedObservation>
<ReducedObservation setupID="liscadGM04" azimuth="35.4957" horizDistance="174.695" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00235">
<TargetPoint pntRef="SAW144" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="329.0304" horizDistance="138.077" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00228">
<TargetPoint pntRef="SAW61" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="148.0017" horizDistance="133.943" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00227">
<TargetPoint pntRef="GM06" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="148.0026" horizDistance="133.944" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00227">
<TargetPoint pntRef="GM06" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="149.1505" horizDistance="249.106" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00250">
<TargetPoint pntRef="SAW59" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="149.1451" horizDistance="249.106" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00250">
<TargetPoint pntRef="SAW59" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="160.2644" horizDistance="260.353" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00252">
<TargetPoint pntRef="SAW159" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="160.2659" horizDistance="260.353" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00252">
<TargetPoint pntRef="SAW159" />
</ReducedObservation>
<ReducedObservation setupID="liscadSAW160" azimuth="244.5944" horizDistance="52.087" azimuthType="measured" azimuthAccuracy="0.000300" distanceAccuracy="0.00210">
<TargetPoint pntRef="SAW60" />
</ReducedObservation>
</Survey>
</LandXML>
t:\ftemp>call xslt land.xml land.xsl
liscadGM04
            pntRef  GM03   Min azimuth:70.0111
            pntRef  GM03   Max azimuth:70.0116
liscadGM04
            pntRef  SAW53   Min azimuth:252.3429
            pntRef  SAW53   Max azimuth:252.3442
liscadGM04
            pntRef  HB402   Min azimuth:309.3846
            pntRef  HB402   Max azimuth:309.3857
liscadGM04
            pntRef  GM05   Min azimuth:320.3911
            pntRef  GM05   Max azimuth:320.3917
liscadGM04
            pntRef  SAW144B   Min azimuth:348.0613
            pntRef  SAW144B   Max azimuth:348.0627
liscadGM04
            pntRef  SAW144   Min azimuth:35.4954
            pntRef  SAW144   Max azimuth:35.4957
liscadSAW160
            pntRef  SAW61   Min azimuth:329.0304
            pntRef  SAW61   Max azimuth:329.0304
liscadSAW160
            pntRef  GM06   Min azimuth:148.0017
            pntRef  GM06   Max azimuth:148.0026
liscadSAW160
            pntRef  SAW59   Min azimuth:149.1451
            pntRef  SAW59   Max azimuth:149.1505
liscadSAW160
            pntRef  SAW159   Min azimuth:160.2644
            pntRef  SAW159   Max azimuth:160.2659
liscadSAW160
            pntRef  SAW60   Min azimuth:244.5944
            pntRef  SAW60   Max azimuth:244.5944

t:\ftemp>type land.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<xsl:output method="text"/>

<xsl:key name="setup-refs" match="ReducedObservation"
         use="concat(@setupID,' ',TargetPoint/@pntRef)"/>

<xsl:template match="/">
  <xsl:for-each select="LandXML/Survey/ReducedObservation
          [generate-id(.)=
           generate-id(key('setup-refs',
                           concat(@setupID,' ',TargetPoint/@pntRef))[1])]">
    <xsl:value-of select="@setupID"/>
    <xsl:text>&#xa;</xsl:text>
    <xsl:variable name="azimuths"
                  select="key('setup-refs',
                              concat(@setupID,' ',TargetPoint/@pntRef))/
                          @azimuth"/>
    <xsl:text>            pntRef  </xsl:text>
    <xsl:value-of select="TargetPoint/@pntRef"/>
    <xsl:text>   Min azimuth:</xsl:text>
    <xsl:value-of select="$azimuths[not(.>$azimuths)][1]"/>
    <xsl:text>&#xa;            pntRef  </xsl:text>
    <xsl:value-of select="TargetPoint/@pntRef"/>
    <xsl:text>   Max azimuth:</xsl:text>
    <xsl:value-of select="$azimuths[not(.&lt;$azimuths)][1]"/>
    <xsl:text>&#xa;</xsl:text>
  </xsl:for-each>
</xsl:template>

</xsl:stylesheet>
t:\ftemp>rem Done!

这篇关于多级Muenchian分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 08:24