I have some sample xml data, for ex:
<?xml version="1.0" encoding="utf-8"?>
<Account>
<User>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</User>
<LoginDetails Sequence="1">
<LoginDate>01/01/09</LoginDate>
<Status>Successful</Status>
</LoginDetails>
<LoginDetails Sequence="2">
<LoginDate>01/02/09</LoginDate>
<Status>Failed</Status>
</LoginDetails>
</Account>
I have a schema file for this xml. I'd like to provide functionality that allows an end user to do the following:
- Define which elements to display.
- Define a label for each element.
- Give the user the ability to save this information and then utilize it at runtime in my application when I load the real xml data.
I'm thinking maybe I can use LINQ or Dynamic LINQ to do this. I think I can first parse the xml or use the schema to show a list of all the nodes (possibly in a tree view?) and let the user check which element they want to display and type in a label.
Does this sound like a good idea? I was thinking to use XSLT but I think it might be easier in LINQ. Can anyone provide me some links or information that would help me achieve this? Are there any better solutions out there?