mdo:xml(procedure-name, entity-names, [parameter1 [ , ...n ] )

Please review Database Access section to get a sample of mdo:xml usage.

mdo:xml executes specified stored procedure, formats results as xml and returns xml to the XSLT processor. mdo:xml is also capable of putting results into asp.net cache for specified period of time. See Caching Database article for details. mdo:xml executes only procedures named with mdo_xslt_ This ensures that admin of particular portal will never get access to all stored procedures on your server.
  • procedure-name - part of the procedure name to be called Actually XsltDb translates mdo:xml into the following call:
EXEC {databaseOwner}[{objectQualifier}mdo_xslt_<<procedure-name>>] PortalID, parameter1, ...
So the procedure must have at least 1 parameter PortalID. PortalID is automatically passed to the procedure by XsltDb so you may safely isolate portals on your DotNetNuke host.
  • entity-names - names of entities returned by stored procedure. If SP executs single select you specify only one name. Id SP executes more than one select statement you have to specify entity name for each result set. Entity name is used as root xml tag for each record.
  • parameters - parameters that passed to stored procedure after PortalID. They can be of any type but should be convertable to procedure's parameters types.
  • return value - mdo:xml returns all record sets returned by the stored procedure in the following format:
<root>
  <entity-name-1>
    <field-name-1-1>value-1-1</field-name-1-1>
    <field-name-1-2>value-1-2</field-name-1-2>
    ......
  </entity-name-1>
  ......
  <entity-name-2>
    <field-name-2-1>value-2-1</field-name-2-1>
    <field-name-2-2>value-2-2</field-name-2-2>
    ......
  </entity-name-2>
  ......
</root>

Please review Database Access section to get a sample of mdo:xml usage.

entity-names can be one of the following:
  • list of entity names
  • $xml - in this case XsltDb reads the first column of first row of first result set, creates an XML document and returns it to the caller.
  • $scalar - in this case XsltDb reads the first column of first row of first result set and returns it as a simple value (not really XML).
  • $script - use this if procedure doesn't return any results.

Last edited Dec 11, 2010 at 8:28 AM by findy, version 9

Comments

No comments yet.