Teach Yourself e.net - Syspro
Teach Yourself e.net - Syspro
Teach Yourself e.net - Syspro
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Example 10.32. Calling the Build Method in ASP.NET VB codebehind<br />
'********************************************************<br />
'-- Build does a build using the special xml string<br />
' provided as input and returns xml/html<br />
'********************************************************<br />
'Parameters:<br />
'Uid:- GUID returned by Logon<br />
'BusObject:- business object used to<br />
'<br />
do query<br />
'XmlIn:- The xml to be used in query - can have a<br />
'<br />
xsl directive<br />
'XmlTransform:- Parameter will specify if<br />
' server/client side transform is required<br />
'XslIn:- The XLS used to transform the<br />
' incomming xml preferably as a server<br />
' path ie. "c:\......mac.xsl"<br />
'ContentType:- ByRef parameter<br />
' representing the content type to be returned by IIS<br />
'********************************************************<br />
'Returns:_ Whatever the transform does with<br />
' the xml, used mostly to generate HTML.<br />
'********************************************************<br />
Function Build(ByVal Uid As String, ByVal BusObject \<br />
As String, ByVal XmlIn As String, ByVal XmlTransform \<br />
As String, ByVal XslIn As String, ByRef ContentType As \<br />
String) As String<br />
Try<br />
'Case statement to toggle between server/client<br />
'side transform<br />
Select Case XmlTransform<br />
Case "C" 'Prefers a client side transform<br />
ContentType = "text/xml"<br />
Return <strong>Syspro</strong>Build(Uid, BusObject, XmlIn)<br />
Case "S" 'Prefers a server side transform (Default)<br />
ContentType = "text/html"<br />
Return Transform(<strong>Syspro</strong>Build(Uid, BusObject, XmlIn), XslIn)<br />
End Select<br />
Catch Exc As Exception<br />
Return "" & Exc.Message & " \<br />
"<br />
End Try<br />
End Function<br />
10–46