G
Gadrin77
<Restaurants>
<FastFood>
<DriveIn Name="Del Taco"/>
<DriveIn Name="McDonalds"/>
<DriveIn Name="Bakers"/>
<DriveIn Name="Arbys"/>
<DriveIn Name="Green Burrito"/>
<DriveIn Name="Jack in the Box"/>
<DriveIn Name="Green Burrito"/>
<DriveIn Name="KFC"/>
<DriveIn Name="Burger King"/>
<DriveIn Name="El Pollo Loco"/>
</FastFood>
</Restaurants>
I need to know how to build an XSL file that will:
1) give me a count of how many DriveIn elements have the
word "Green" in the Name attribute.
2) output the Name attributes that do have "Green" in them, in a
comma-separated list, with a period after the last one.
Green Drive Ins: Green Burrito, Green Burrito.
the data may have zero occurences...
<Restaurants>
<FastFood>
<DriveIn Name="Del Taco"/>
<DriveIn Name="McDonalds"/>
<DriveIn Name="Bakers"/>
<DriveIn Name="Arbys"/>
<DriveIn Name="Jack in the Box"/>
<DriveIn Name="KFC"/>
<DriveIn Name="Burger King"/>
<DriveIn Name="El Pollo Loco"/>
</FastFood>
</Restaurants>
3) When the XML has zero DriveIn elements with "Green" in the Name
attribute, it'll output like:
Green Drive Ins: None.
I've been able to list the names like
Green Drive Ins: Green Burrito, Green Burrito,
but not determine when to place a period and not a comma on the last
one, or how to place an alternate string, indicating none were listed.
Any help will be greatly appreciated. I'm using MS XML 4, SP2.
<FastFood>
<DriveIn Name="Del Taco"/>
<DriveIn Name="McDonalds"/>
<DriveIn Name="Bakers"/>
<DriveIn Name="Arbys"/>
<DriveIn Name="Green Burrito"/>
<DriveIn Name="Jack in the Box"/>
<DriveIn Name="Green Burrito"/>
<DriveIn Name="KFC"/>
<DriveIn Name="Burger King"/>
<DriveIn Name="El Pollo Loco"/>
</FastFood>
</Restaurants>
I need to know how to build an XSL file that will:
1) give me a count of how many DriveIn elements have the
word "Green" in the Name attribute.
2) output the Name attributes that do have "Green" in them, in a
comma-separated list, with a period after the last one.
Green Drive Ins: Green Burrito, Green Burrito.
the data may have zero occurences...
<Restaurants>
<FastFood>
<DriveIn Name="Del Taco"/>
<DriveIn Name="McDonalds"/>
<DriveIn Name="Bakers"/>
<DriveIn Name="Arbys"/>
<DriveIn Name="Jack in the Box"/>
<DriveIn Name="KFC"/>
<DriveIn Name="Burger King"/>
<DriveIn Name="El Pollo Loco"/>
</FastFood>
</Restaurants>
3) When the XML has zero DriveIn elements with "Green" in the Name
attribute, it'll output like:
Green Drive Ins: None.
I've been able to list the names like
Green Drive Ins: Green Burrito, Green Burrito,
but not determine when to place a period and not a comma on the last
one, or how to place an alternate string, indicating none were listed.
Any help will be greatly appreciated. I'm using MS XML 4, SP2.