Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 5th, 2006, 02:48 PM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default XPATH SORTING EXPRESSION

Hi,

I am finding it very hard to get the right expression to sort the xml below:

ORIGINAL SORT EXPRESSION
<xsl:sort select ="descendant::Msr[$sortCol]/@val" data-type="text"/>

This works up to a point. However, I need to change this to include cells which have no Msr children.

I think this expression would find these cells:

//Row/Cell[not(Msr)][ceiling($sortCol div $msrs)]

The problem is that the expression that gives the sort seed (//Row/descendant::Msr[$sortCol]/@val) returns a value (string or number).

BUT the empty node expression (//Row/Cell[not(Msr)][ceiling($sortCol div $msrs)]) returns a node. I need a string or number because I cannot sort on a node, so I think I need to find an attribute of the empty Cell node that returns something that is consistent with the string we get from the original expression

I think the expression will look something like:

descendant::Msr[$sortCol]/@val | Cell[not(Msr)][ceiling($sortCol div $msrs)]

... plus the magic bit I am missing. I would appreciate if someone could help me to find the solution for this problem.

Cheers

CP

<Report xmlns="">

  <Measures>

    <Measure idx="1" heading="Cost" />

    <Measure idx="2" heading="Total Pages" />

  </Measures>

  <Columns>

    <ColGrp heading="Quarter">

      <ColGrp heading="2003">

        <Col heading="Quarter 1" />

        <Col heading="Quarter 2" />

        <Col heading="Quarter 3" />

        <Col heading="Quarter 4" />

      </ColGrp>

      <ColGrp heading="2004">

        <Col heading="Quarter 1" />

        <Col heading="Quarter 2" />

        <Col heading="Quarter 3" />

        <Col heading="Quarter 4" />

      </ColGrp>

    </ColGrp>

  </Columns>

  <Rows>

    <RowGrp heading="Product Name">

      <RowGrp heading="Abbott Labs">

        <RowGrp heading="Ross Labs">

          <Row heading="Collagenase Santyl">

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$21,270.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$33,306.00" />

              <Msr idx="2" val="9.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$25,206.00" />

              <Msr idx="2" val="6.50" />

            </Cell>

            <Cell>

            ..........................................
  #2 (permalink)  
Old June 5th, 2006, 03:10 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You don't make it clear which part of the source XML you are sorting. Cells within a Row, perhaps?

In that case, why are you using descendant::Msr rather than child::Msr?

>I think this expression would find these cells:

>//Row/Cell[not(Msr)][ceiling($sortCol div $msrs)]

Why the "//Row"? You need an expression that selects relative to the elements being sorted. The first predicate here selects Cell elements that have no Msr children. You don't say what the second predicate is doing, or what the variables are supposed to mean.

Sorry, you'll have to explain the problem a bit more clearly. (Once you've done so, you'll probably understand it better yourself)


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old June 6th, 2006, 08:38 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi Michael ,

Thanks for your reply.

$sortCol = the index of the column to sort by. I pass it to the xslt.

$msrs = number of measures I get by counting number of Measures. This can change.

<xsl:variable name="msrs">
    <xsl:choose>
      <xsl:when test="//Measure">
       <xsl:value-of select="count(//Measure)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="1"/>
      </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

"
You don't make it clear which part of the source XML you are sorting. Cells within a Row, perhaps?
"

I am trying to sort the @val attribute within Cells within a Row. Please see the comlete xml below.

"
In that case, why are you using descendant::Msr rather than child::Msr?
"
I am using descendant because it worked when I tried the expression below in FireFox and I thought this was the right expression.

//Report/Rows//Row/descendant::Msr[12]/@val

This returns the @Val sorted and I get 20 matches.

However when I change the index to 2 :

//Report/Rows//Row/descendant::Msr[2]/@val

I get 32 matches instead and I think this is happening because of the empty Cells. The empty Cell nodes are messing up the sorting.

"
//Row/Cell[not(Msr)][ceiling($sortCol div $msrs)]

Why the "//Row"? You need an expression that selects relative to the elements being sorted. The first predicate here selects Cell elements that have no Msr children."

you are right. I was trying to retun something from the empty Cells rather than a node.

The )][ceiling($sortCol div $msrs)] expression I was using to get This:

Suppose that the $sortCol = 7 and $msrs = 2

 //Row/Cell[not(Msr)][ceiling(7 div 2)])

So:

   when count(//Measures) = 2
   sortCol = 5 -> Cell[3]
   sortCol = 7 -> Cell[4]
   sortCol = 6 -> Cell[3]

Then:

   when count(//Measures) = 3
   sortCol = 5 -> Cell[2]
   sortCol = 7 -> Cell[3]
   sortCol = 6 -> Cell[2]


Basically, what I need to do is to sort the xml based on the @val attribute value within Cells within a Row. However, The empty Cells (which have no Mrs elements) are messing up the sorting)!!

Cheers

CP

XML

<Report xmlns="">

  <Measures>

    <Measure idx="1" heading="Cost" />

    <Measure idx="2" heading="Total Pages" />

  </Measures>

  <Columns>

    <ColGrp heading="Quarter">

      <ColGrp heading="2003">

        <Col heading="Quarter 1" />

        <Col heading="Quarter 2" />

        <Col heading="Quarter 3" />

        <Col heading="Quarter 4" />

      </ColGrp>

      <ColGrp heading="2004">

        <Col heading="Quarter 1" />

        <Col heading="Quarter 2" />

        <Col heading="Quarter 3" />

        <Col heading="Quarter 4" />

      </ColGrp>

    </ColGrp>

  </Columns>

  <Rows>

    <RowGrp heading="Product Name">

      <RowGrp heading="Abbott Labs">

        <RowGrp heading="Ross Labs">

          <Row heading="Collagenase Santyl">

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$21,270.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$33,306.00" />

              <Msr idx="2" val="9.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$25,206.00" />

              <Msr idx="2" val="6.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$14,511.00" />

              <Msr idx="2" val="4.70" />

            </Cell>

          </Row>

          <Row heading="Oxandrin">

            <Cell>

              <Msr idx="1" val="$67,636.00" />

              <Msr idx="2" val="18.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$212,080.00" />

              <Msr idx="2" val="62.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$235,448.00" />

              <Msr idx="2" val="66.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$189,981.00" />

              <Msr idx="2" val="50.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$117,320.00" />

              <Msr idx="2" val="36.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$188,855.00" />

              <Msr idx="2" val="54.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$24,390.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$34,120.00" />

              <Msr idx="2" val="8.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Boehringer Ingelheim Pharma">

        <RowGrp heading="Boehringer Ingelheim Pharma">

          <Row heading="Aggrenox">

            <Cell>

              <Msr idx="1" val="$119,109.00" />

              <Msr idx="2" val="73.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$66,155.00" />

              <Msr idx="2" val="43.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$69,284.00" />

              <Msr idx="2" val="45.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$175,181.00" />

              <Msr idx="2" val="63.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$154,571.00" />

              <Msr idx="2" val="71.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$158,370.00" />

              <Msr idx="2" val="72.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$88,594.00" />

              <Msr idx="2" val="41.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$76,766.00" />

              <Msr idx="2" val="37.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Braintree Labs">

        <RowGrp heading="Braintree Labs">

          <Row heading="HalfLytely">

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$99,880.00" />

              <Msr idx="2" val="18.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$538,732.00" />

              <Msr idx="2" val="109.00" />

            </Cell>

          </Row>

          <Row heading="Miralax">

            <Cell>

              <Msr idx="1" val="$818,973.00" />

              <Msr idx="2" val="130.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$852,424.00" />

              <Msr idx="2" val="132.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$837,894.00" />

              <Msr idx="2" val="133.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$847,108.00" />

              <Msr idx="2" val="131.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$744,838.00" />

              <Msr idx="2" val="119.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$748,405.00" />

              <Msr idx="2" val="123.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$421,220.00" />

              <Msr idx="2" val="68.50" />

            </Cell>

            <Cell />

          </Row>

          <Row heading="NuLytely">

            <Cell>

              <Msr idx="1" val="$148,537.00" />

              <Msr idx="2" val="34.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$140,157.00" />

              <Msr idx="2" val="33.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$143,934.00" />

              <Msr idx="2" val="34.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$132,831.00" />

              <Msr idx="2" val="28.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$125,586.00" />

              <Msr idx="2" val="37.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$166,526.00" />

              <Msr idx="2" val="41.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$84,466.00" />

              <Msr idx="2" val="21.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$3,250.00" />

              <Msr idx="2" val="2.00" />

            </Cell>

          </Row>

          <Row heading="PhosLo">

            <Cell>

              <Msr idx="1" val="$254,294.00" />

              <Msr idx="2" val="46.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$613,311.00" />

              <Msr idx="2" val="116.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$226,220.00" />

              <Msr idx="2" val="40.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$29,373.00" />

              <Msr idx="2" val="13.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$29,817.00" />

              <Msr idx="2" val="14.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$29,329.00" />

              <Msr idx="2" val="15.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$29,687.00" />

              <Msr idx="2" val="14.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$77,964.00" />

              <Msr idx="2" val="38.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Corixa/Glaxosmithkline Cm">

        <RowGrp heading="Corixa/Glaxosmithkline Cm">

          <Row heading="Bexxar">

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$38,661.00" />

              <Msr idx="2" val="14.30" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$151,341.00" />

              <Msr idx="2" val="58.10" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$85,716.00" />

              <Msr idx="2" val="30.30" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$25,520.00" />

              <Msr idx="2" val="7.80" />

            </Cell>

            <Cell />

            <Cell />

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Eisai/Janssen Cmkt">

        <RowGrp heading="Eisai/Janssen Cmkt">

          <Row heading="Aciphex">

            <Cell>

              <Msr idx="1" val="$184,200.00" />

              <Msr idx="2" val="28.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$907,177.00" />

              <Msr idx="2" val="126.50" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$634,190.00" />

              <Msr idx="2" val="90.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$589,230.00" />

              <Msr idx="2" val="82.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$86,653.00" />

              <Msr idx="2" val="16.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$137,677.00" />

              <Msr idx="2" val="25.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$52,214.00" />

              <Msr idx="2" val="4.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$20,844.00" />

              <Msr idx="2" val="2.50" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Fleet">

        <RowGrp heading="Fleet">

          <Row heading="Phospho-Soda Acc-Prp">

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$51,303.00" />

              <Msr idx="2" val="14.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$54,700.00" />

              <Msr idx="2" val="18.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$33,930.00" />

              <Msr idx="2" val="14.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Johnson &amp; Johnson">

        <RowGrp heading="Janssen Pharma Inc">

          <Row heading="Duragesic">

            <Cell>

              <Msr idx="1" val="$146,689.00" />

              <Msr idx="2" val="33.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$309,397.00" />

              <Msr idx="2" val="64.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$671,489.00" />

              <Msr idx="2" val="101.40" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$272,694.00" />

              <Msr idx="2" val="55.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$385,072.00" />

              <Msr idx="2" val="62.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$478,408.00" />

              <Msr idx="2" val="79.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$175,135.00" />

              <Msr idx="2" val="31.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$240,977.00" />

              <Msr idx="2" val="35.00" />

            </Cell>

          </Row>

          <Row heading="NPS(Schizophrenia)">

            <Cell>

              <Msr idx="1" val="$189,314.00" />

              <Msr idx="2" val="45.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$148,267.00" />

              <Msr idx="2" val="35.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$62,899.00" />

              <Msr idx="2" val="13.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$27,556.00" />

              <Msr idx="2" val="7.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$367,627.00" />

              <Msr idx="2" val="55.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$5,625.00" />

              <Msr idx="2" val="3.00" />

            </Cell>

            <Cell />

            <Cell />

          </Row>

          <Row heading="Reminyl">

            <Cell>

              <Msr idx="1" val="$14,730.00" />

              <Msr idx="2" val="8.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$438,017.00" />

              <Msr idx="2" val="66.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$699,002.00" />

              <Msr idx="2" val="104.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$474,523.00" />

              <Msr idx="2" val="72.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$311,986.00" />

              <Msr idx="2" val="48.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$452,386.00" />

              <Msr idx="2" val="76.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$337,346.00" />

              <Msr idx="2" val="56.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$341,023.00" />

              <Msr idx="2" val="54.00" />

            </Cell>

          </Row>

          <Row heading="Risperdal">

            <Cell>

              <Msr idx="1" val="$124,124.00" />

              <Msr idx="2" val="27.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$270,330.00" />

              <Msr idx="2" val="76.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$282,428.00" />

              <Msr idx="2" val="70.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$133,316.00" />

              <Msr idx="2" val="31.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$783,270.00" />

              <Msr idx="2" val="110.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$910,518.00" />

              <Msr idx="2" val="138.10" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$418,510.00" />

              <Msr idx="2" val="72.80" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$254,860.00" />

              <Msr idx="2" val="49.30" />

            </Cell>

          </Row>

          <Row heading="Risperdal Consta">

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$29,752.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$963,797.00" />

              <Msr idx="2" val="203.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$587,537.00" />

              <Msr idx="2" val="139.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$332,762.00" />

              <Msr idx="2" val="73.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$289,979.00" />

              <Msr idx="2" val="64.00" />

            </Cell>

          </Row>

          <Row heading="Risperdal M-Tab">

            <Cell />

            <Cell>

              <Msr idx="1" val="$116,100.00" />

              <Msr idx="2" val="19.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$150,000.00" />

              <Msr idx="2" val="27.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$88,052.00" />

              <Msr idx="2" val="19.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$22,126.00" />

              <Msr idx="2" val="5.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$31,940.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$250,571.00" />

              <Msr idx="2" val="36.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$167,480.00" />

              <Msr idx="2" val="23.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Medimmune/Ross Comkt">

        <RowGrp heading="Medimmune/Ross Comkt">

          <Row heading="Synagis">

            <Cell />

            <Cell>

              <Msr idx="1" val="$35,530.00" />

              <Msr idx="2" val="4.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$153,681.00" />

              <Msr idx="2" val="34.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$287,795.00" />

              <Msr idx="2" val="79.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$78,425.00" />

              <Msr idx="2" val="22.00" />

            </Cell>

            <Cell />

            <Cell>

              <Msr idx="1" val="$10,970.00" />

              <Msr idx="2" val="4.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$64,845.00" />

              <Msr idx="2" val="22.00" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Merck &amp; Company, Inc">

        <RowGrp heading="Merck &amp; Company, Inc">

          <Row heading="Vioxx">

            <Cell>

              <Msr idx="1" val="$1,755,358.00" />

              <Msr idx="2" val="264.70" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$500,236.00" />

              <Msr idx="2" val="73.30" />

            </Cell>

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$689,037.00" />

              <Msr idx="2" val="94.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$600,348.00" />

              <Msr idx="2" val="86.70" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$252,967.00" />

              <Msr idx="2" val="33.10" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$103,545.00" />

              <Msr idx="2" val="20.10" />

            </Cell>

          </Row>

        </RowGrp>

      </RowGrp>

      <RowGrp heading="Mission Pharmacal Co">

        <RowGrp heading="Mission Pharmacal Co">

          <Row heading="Citracal Prenatal Rx">

            <Cell>

              <Msr idx="1" val="$3,080.00" />

              <Msr idx="2" val="1.00" />

            </Cell>

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell />

            <Cell>

              <Msr idx="1" val="$7,910.00" />

              <Msr idx="2" val="1.00" />

            </Cell>

          </Row>

          <Row heading="Urocit-K">

            <Cell>

              <Msr idx="1" val="$33,886.00" />

              <Msr idx="2" val="6.70" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$27,960.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$27,960.00" />

              <Msr idx="2" val="6.00" />

            </Cell>

            <Cell>

              <Msr idx="1" val="$33,000.00" />

              <Msr idx="2" val="7.50" />

        &n
  #4 (permalink)  
Old June 6th, 2006, 09:05 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Sorry,

The previous xml was too long.

<Report xmlns="">
  <Measures>
    <Measure idx="1" heading="Total Pages" />
    <Measure idx="2" heading="Cost" />
  </Measures>
  <Columns>
    <ColGrp heading="Year">
      <Col heading="2003" />
      <Col heading="2004" />
    </ColGrp>
  </Columns>
  <Rows>
    <RowGrp heading="Journal Group Name">
      <Row heading="Gastroenterology">
        <Cell />
        <Cell>
          <Msr idx="1" val="21.00" />
          <Msr idx="2" val="$32,115.00" />
        </Cell>
      </Row>
      <Row heading="General Medicine">
        <Cell />
        <Cell>
          <Msr idx="1" val="18.00" />
          <Msr idx="2" val="$111,245.00" />
        </Cell>
      </Row>
      <Row heading="Orthopedics">
        <Cell />
        <Cell>
          <Msr idx="1" val="22.00" />
          <Msr idx="2" val="$53,700.00" />
        </Cell>
      </Row>
      <Row heading="Other Specialty">
        <Cell />
        <Cell>
          <Msr idx="1" val="18.00" />
          <Msr idx="2" val="$17,910.00" />
        </Cell>
      </Row>
      <Row heading="Pharmacy">
        <Cell>
          <Msr idx="1" val="7.10" />
          <Msr idx="2" val="$64,015.00" />
        </Cell>
        <Cell />
      </Row>
      <Row heading="Rheumatology">
        <Cell />
        <Cell>
          <Msr idx="1" val="30.00" />
          <Msr idx="2" val="$62,760.00" />
        </Cell>
      </Row>
    </RowGrp>
  </Rows>
</Report>

  #5 (permalink)  
Old June 9th, 2006, 07:17 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi,

This is just to let you know that I finally found the right XPath expression.

<sort select="number(//Row/Cell[number($sortCell)]/descendant::Mrs[number($sortCol])/@val)" data-type=...>

Cheers


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath 2.0 every expression stolte XSLT 5 November 24th, 2008 03:32 PM
XPath Expression NEO1976 XSLT 11 August 2nd, 2006 02:28 AM
Need help with XPATH Expression benomathew XSLT 1 May 12th, 2006 04:41 AM
Need help with XPATH Expression benomathew XML 1 May 9th, 2006 03:38 PM
Logical XPath Expression rohit72 XML 0 June 23rd, 2004 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.