msxsl bug?

Barry MacKichan barrym at halcyon.com
Tue Apr 7 03:32:19 BST 1998


I've been working with Microsoft's msxsl program, to apply their xsl style
sheets to xml documents to produce an html file.

Is the following a bug, or do I not understand xsl?

My xml file is:

<base>
 <node>
  <L1>Line 1</L1>
  <L2>Line 2</L2>
  <L3>Line 3</L3>
  <L2>Another Line 2</L2>
  <L1>Another Line 1</L1>
 </node>
</base>

My xsl file is using the <select-elements> element to select the <L1> and
<L2> elements first, and then to select the <L3> elements.  The problem is
that apparently I can select only the <L1> elements OR the <L2> elements,
but not both.

I am inferring that it is possible to select multiple kinds of elements,
from the way selection for rules works.  If it is not possible to select
multiple kinds of elements, then Microsoft's claim that you can use xsl to
re-order the children of an element seems pretty weak: you can only do it
when there are only two kinds of children in an element.

My xsl file is:

<xsl>
 <rule>
  <root/>
  <HTML>
   <BODY>
    <children/>
   </BODY>
  </HTML>
 </rule>

 <rule>
  <target-element type="node"/>
  <select-elements>
//***** here is the problem ******
   <target-element type="L2"/>
   <target-element type="L1"/>
//***** end of problem area
  </select-elements>
  <select-elements>
   <target-element type="L3"/>
  </select-elements>
 </rule>

 <rule>
  <target-element type="L1"/>
  <h2><children/></h2>
 </rule>

 <rule>
  <target-element type="L2"/>
  <h2><children/></h2>
 </rule>

 <rule>
  <target-element type="L3"/>
  <h2><children/></h2>
 </rule>

</xsl>

I would expect output to look like:

Line 1
Line 2
Another Line 2
Another Line 1
Line 3

but I get

Line 1
Another Line 1
Line 3

That is, the select-elements with multiple criteria ignores all the criteria
but the last.

Can anybody set me straight?  TIA

--Barry MacKichan




xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list