This is how I implement this type of functionality, feel free to disagree with me:
- Request comes in for page /somepath/index
- Query to OData to get /Pages()?$filter=Url eq '%2Fsomepath%2Findex'
- Potentially use a $expand(PageContent) on that URL so that it brings the presentation content as well
- Load the PageContent, it's been escaped because Tridion cannot guarantee the output of templates are well-formed, so parse it in XML, probably with a strong domain model
- From there on, build my page.
EDIT
Tridion Component links that are part of the content are resolved, as long as the output from the Tridion publisher is converted to a <tcdl:Link>
object. Something called "REL" - Render Engine Language - will convert those <tcdl:Link>
to the actual result.
EDIT 2
That same query for the pages could also be written like this:
var page = (from p in contentdeliveryservice.Pages
where p.Url == '/somepath/index'
select p).First();