Hello again, it’s been a busy time closing the year (I mean the fiscal for Microsoft). I have been off for a while, but I promise not to do that again – seems like another fake promise 
When we say that InfoPath is native to XML, we really mean it. One of the areas that some ignore about InfoPath is its ability to be an authoring tool for XML files. What do I mean by that? read on…
We’re establishing a solution for Sheraton Riyadh, where hotel guests can experience the new multi-touch experience of Windows 7 in an e-Concierge solution. The e-Concierge is basically a solution for guest relations to show hotel guests Points of Interests in Riyadh and surrounding area, with categories and mapping (using Bing Maps) functionality. The solution simply takes in an XML file with categories Points-of-Interest (POIs), like the below:
1: <?xml version="1.0" encoding="utf-8"?><Categories xml:lang="en-us">
2: <Category id="1" title="Culture" color="#91c1bc" iconUrl="/Resources/cat-icon-culture.png">
3: <PointOfInterests>
4: <PointOfInterest>
5: <Title>Culture item 1</Title>
6: <ImageUrl>
http://mw2.google.com/mw-panoramio/photos/medium/1674416.jpg
</ImageUrl>
7: <Latitude>0.43102538</Latitude>
8: <Longitude>0.81709864</Longitude>
9: <WebSiteUrl>
http://www.google.com
</WebSiteUrl>
10: <Description>Lorem ipsum dolor sit amet sed diam nonummy nibh eui....</Description>
11: </PointOfInterest>
12: <PointOfInterest>
13: <Title>Culture item 2</Title>
14: <ImageUrl>
http://mw2.google.com/mw-panoramio/photos/medium/1674416.jpg
</ImageUrl>
15: <Latitude>0.43402538</Latitude>
16: <Longitude>0.81409864</Longitude>
17: <WebSiteUrl>
http://www.google.com
</WebSiteUrl>
18: <Description>endrerit in vulputate velit esse molestie consequat....</Description>
19: </PointOfInterest>
20: </PointOfInterests>
21: </Category>
22: <Category id="2" title="Restaurants" color="#9e7a78" iconUrl="/Resources/cat-icon-restaurant.png">
23: <PointOfInterests>
24: <PointOfInterest>
25: <Title>Restaurant item 1</Title>
26: <ImageUrl>
http://mw2.google.com/mw-panoramio/photos/medium/1674416.jpg
</ImageUrl>
27: <Latitude>0.43102538</Latitude>
28: <Longitude>0.81709864</Longitude>
29: <WebSiteUrl>
http://www.google.com
</WebSiteUrl>
30: <Description>...</Description>
31: </PointOfInterest>
32: </PointOfInterests>
33: </Category>
34: <Category id="3" title="Transport" color="#a3b041" iconUrl="/Resources/cat-icon-transport.png">
35: <PointOfInterests>
36: </PointOfInterests>
37: </Category>
38: <Category id="4" title="Government" color="#e69553" iconUrl="/Resources/cat-icon-gov.png">
39: <PointOfInterests>
40: </PointOfInterests>
41: </Category>
42: </Categories>
The challenge now is that, Hotel IT need to author this file for the solution to pick up and plot on the map. Well, that’s not an easy task. We could do an authoring tool using the solution itself (which basically is based on WPF), but thought we can use a simpler version – InfoPath.
I asked the developer of the solution to give me a sample XML file, and the schema. I simply started InfoPath and started to design a new form by choosing (XML or Schema:

InfoPath will ask you a couple of questions to choose the XML and schema document, I did give it two files in the following order:
- XML Sample file – PointOfInterests.xml
- XML Schema file – PointOfInterests.xsd
It will also ask you if you want to load the sample data as part of the design, say yes to make it easy for changing the UI with real data.

Once done, you’ll be presented with any empty design and the following Fields (data source):

Before I proceed, let’s change the style of the form, by choosing layout template:

All you need to do is to drag the top element, and drop it on the design surface.

As you can see, InfoPath consulted the schema file, and inserted the data accordingly. What’s left is just styling the controls so they can look better and usable. I have inserted a couple of tables, and moved the controls and labels around. The final design is below:

If you fit F5 (or preview), you’ll see the following:

And that’s it. Once the author is done, filling up the fields and adding/deleting the points, he only needs to save, and an XML file will be the result.
I’m including all the files for your own testing, so feel free to download and improve: POIEditor.zip
Enjoy InfoPath, and remember that the fact that it’s XML-native.