Otis,
I'm currently trying to run the xml generated via WriteXml() through an Xsl transform before sending it to the client (and vice versa from client -> server). Ideally, I'd like to have a single Xsl transform for entity out and a single Xsl transform for entity in. However, a small feature of the schema is blocking me at the moment. The problem is that the primary key field of each entity is specified by name as the first attribute of each Entity node.
<?xml version="1.0" encoding="utf-8" ?>
<Entity UID="1" Assembly="..."
Because the PK field is listed by name as an attribute, there doesn't appear to be a way to generically handle the data. Is there any way to change the schema to something a little more amenible to transforms? The following structure would work:
<?xml version="1.0" encoding="utf-8" ?>
<Entity Assembly="..."
<PrimaryKeys>
<Key Name="UID" Value="x"/>
...composite keys here...
</PrimaryKeys>
Alternatively, do you know of a way to grab the first attribute of a node? I know this is not safe as some parsers will re-order the attributes but it would work as a temporary workaround.
Thanks,
Kilby