[Mono-list] FYI: X# - New Data/XML-oriented language projectat MS

A Rafael D Teixeira rafaelteixeirabr@hotmail.com
Thu, 09 Jan 2003 11:24:22 -0200

I think they probably would go the route of turning XPath 2.0 one of the 
legs of X#, C# being the other. That would make possible to do things like.

for a xml with this form

  <Channel name="Mandrake9.0">
    <Item id="11" Name="gnome-libs.i586mdk.rpm" currentVersion="2.01.333" 
    <Item id="11" Name="gnome-vfs.i586mdk.rpm" currentVersion="2.01.23" 
  <Channel name="RedHat8.0">
    <Item id="11" Name="gnome-libs.i386.rpm" currentVersion="2.01.334" .../>
    <Item id="11" Name="gnome-vfs.i386.rpm" currentVersion="2.01.23" .../>

a visual form, would have such X# code (just my guess):

class formUpgrades : System.Windows.Forms
  Datagrid dtgUpgrades;


  public void ShowMeUpgrades(string channel)
    XML localList = new XML("file:///etc/redcarpet/redcarpet.xml");
    XML list = new XML("http://www.ximian.com/redcarpet.xml");
    Sequence seq = list.Channel[@name == channel];
    Sequence seqLocal = localList.Channel[@name == channel]
    if (seq.count > 0)
      dtgUpgrades.DataSource = seq.Item[@currentVersion > 
max(seqLocal.ItemLocal.currentVersion[@id == current().@id])];

The above example, is similar to such an SQL query with subquery, being 
bound to a Datagrid:

SELECT * FROM RedCarpetItem INNER JOIN RedCarpetChannel ON 
RedCarpetItem.ChannelID = RedCarpetChannel.ID WHERE
RedCarpetChannel.Name = '@channel' AND RedCarpetItem.CurrentVersion > 
(SELECT MAX(CurrentVersion) FROM LocalItem INNER JOIN LocalChannel ON 
LocalItem.ChannelID = LocalChannel.ID WHERE LocalChannel.Name = '@channel' 
AND ID = RedCarpetItem.ID)

But RedCarpetItem and RedCarpetChannel tables, would have to be remote 

Interesting possibilities...

Rafael Teixeira
Brazilian Polymath
Mono, MonoQLE Hacker

The new MSN 8 is here: Try it free* for 2 months