Smartsite Documentatie
>
SXML
>
Vipers
>
Local Viper Methods
> This.PopulateDatatable (XmlProcessor) Viper Method
|
|
Populates the specified datatable with the child nodes below the selected node.
Syntax
| Smartsite SXML |
|
|---|---|
this.populatedatatable(datatable dataTable) this.populatedatatable(datatable dataTable, string[ ] columnQueries) |
|
Parameters
| Name | Data Type | Description |
|---|---|---|
| dataTable | DataTable | The data table. |
| columnQueries | String[ ] | The (relative) column XPath queries to select the column values. |
Return Value
None.
Used in
| Macro | Description |
|---|---|
| XmlProcessor | Native Xml data Macro. |
Examples
Populating a DataTable
In this example, a node list is selected from the given Xml document, and a given DataTable is populated with nodes relative to the nodes in the selected nodes.
| Smartsite SXML |
|
|---|---|
{buffer.set(d, datatable.createempty())}
<se:xmlprocessor save="a" >
<se:parameters>
<se:parameter name="xml">
<root>
<addresses>
<address nr="1">
<street>Jaarbeursplein</street>
<zipcode>3521 AL</zipcode>
<city>Utrecht</city>
</address>
<address nr="2">
<street>Elektronicaweg 131</street>
<zipcode>2628 XG</zipcode>
<city>Delft</city>
</address>
</addresses>
</root>
</se:parameter>
<se:parameter name="actions">
<se:collection>
<se:member type="multiplenodes" query="//addresses/address" >
{this.populatedatatable($d, 'nr=@nr', 'street=./street', 'zipcode=./zipcode', 'city=./city')}
</se:member>
</se:collection>
</se:parameter>
</se:parameters>
</se:xmlprocessor>
<se:format inputdata="{buffer.get(d)}" resultformat="{page.setforcedresult(this.result())}">
<se:rowformat trim="both"><p>
{this.field(street)}<br />
{this.field(zipcode)}, {this.field(city)}
</p></se:rowformat>
</se:format>
|
|
Populating a DataTable using an existing data structure
In this example, a node list is selected from the given Xml document, and a given DataTable is populated with nodes relative to the nodes in the selected nodes.
To create a datatable structure, the placeholder macro is used, because of its declarative column syntax.
| Smartsite SXML |
|
|---|---|
<se:xmlprocessor save="snippet" ><![CDATA[
<cars xmlns="uri:cars">
<car nr="1" brand="Alfa Romeo" type="156" />
<car nr="2" brand="Rover" type="75" />
<car nr="3" brand="lexus" type="IS 250" />
<car nr="4" brand="Mercedes" type="C" />
</cars>
]]></se:xmlprocessor>
<h3>XML Snippet</h3>
<se:viewsource xml="{buffer.get(snippet)}" recurse="true" />
<se:hidden whitespace="remove">
<se:placeholder localid="xml" render="false">
<se:parameters>
<se:parameter name="fieldnames">
<se:collection>
<se:member name="nr" primarykey="true" type="integer" />
<se:member name="brand" type="string" />
<se:member name="type" type="string" />
</se:collection>
</se:parameter>
</se:parameters>
</se:placeholder>
<se:xmlprocessor resulttype="none" xml="{buffer.get(snippet)}" >
<se:parameters>
<se:parameter name="namespaces">
<se:collection>
<se:member prefix="def" value="uri:cars" />
</se:collection>
</se:parameter>
<se:parameter name="actions">
<se:collection>
<se:member query="//def:car" type="multiplenodes">
{this.populatedatatable(scope.xml.data(), 'nr=@nr', 'brand=@brand', 'type=@type' )}
</se:member>
</se:collection>
</se:parameter>
</se:parameters>
</se:xmlprocessor>
</se:hidden>
<se:format inputdata="{scope.xml.data()}">
<se:rowformat trim="both">
<dt>{this.field(nr)}</dt><dd class="brand">{this.field(brand)}</dd><dd class="type">{this.field(type)}</dd>{char.crlf()}
</se:rowformat>
<se:resultformat whitespace="remove">
<h3>Translations defined in snippet</h3>
<dl>{this.result()}</dl>
</se:resultformat>
</se:format>
|
|
SXML
- Macro
- Macro Parameters
- Macro Parameter Properties
-
Vipers
- Global Viper Methods
-
Local Viper Methods
- This.Add (Json) Viper Method
- This.Add (Metadata) Viper Method
- This.Add (PlaceHolder) Viper Method
- This.Add (ShoppingCart) Viper Method
- This.AddDublinCore (Metadata) Viper Method
- This.AddLine Viper Method
- This.AddNamespace (Metadata) Viper Method
- This.AddNull (Json) Viper Method
- This.AddValue (Json) Viper Method
- This.AffectedRecords (SqlQuery) Viper Method
- This.AIM.Relations Viper Method
- This.Allowemptysearch (FacetedSearchQueryBuilder20) Viper Method
- This.AltText (Image) Viper Method
- This.Amount (Payment) Viper Method
- This.Append Viper Method
- This.AppendChild (XmlProcessor) Viper Method
- This.AppendChildBinary (XmlProcessor) Viper Method
- This.AppendChildXml (XmlProcessor) Viper Method
- This.ApplyBoxFormat (SmartletBox) Viper Method
- This.Attribs (SmartletBox) Viper Method
- This.AutoTitle (Image) Viper Method
- This.BoxData (SmartletBox) Viper Method
- This.BoxMode (SmartletBox) Viper Method
- This.BoxSkin (SmartletBox) Viper Method
- This.Brand (Payment) Viper Method
- This.Break (For) Viper Method
- This.Break Viper Method
- This.Buffer.Exists Viper Method
- This.Buffer.Get Viper Method
- This.Buffer.Set Viper Method
- This.Buttons (SmartletBox) Viper Method
- This.CanGoBack (Paging) Viper Method
- This.CanGoForward (Paging) Viper Method
- This.Caption (SmartletBox) Viper Method
- This.ChildLevelResult Viper Method
- This.ClassName (Image) Viper Method
- This.Clear Viper Method
- This.ClearDublinCore (Metadata) Viper Method
- This.ClearForcedResult Viper Method
- This.ColCount Viper Method
- This.ColName Viper Method
- This.ColNumber Viper Method
- This.CompleteDocument Viper Method
- This.ContentTypeWeight (FacetedSearchQueryBuilder) Viper Method
- This.ContentTypeWeight (FacetedSearchQueryBuilder20) Viper Method
- This.Count (Paging) Viper Method
- This.Currency (Payment) Viper Method
- This.Current (Paging) Viper Method
- This.CurrentIndex (Siblings) Viper Method
- This.CustomerAddress (Payment) Viper Method
- This.CustomerCountry (Payment) Viper Method
- This.CustomerEmail (Payment) Viper Method
- This.CustomerName (Payment) Viper Method
- This.CustomerPhone (Payment) Viper Method
- This.CustomerTown (Payment) Viper Method
- This.CustomerZipcode (Payment) Viper Method
- This.Data (ViewSource) Viper Method
- This.Data Viper Method
- This.DefaultResultFormat (XLinks) Viper Method
- This.DefaultRowFormat (XLinks) Viper Method
- This.Delete (XmlProcessor) Viper Method
- This.Delete Viper Method
- This.DocTypeHeader Viper Method
- This.DocumentBody Viper Method
- This.DocumentBodyNode Viper Method
- This.EditedSmartlet (SmartletEditor) Viper Method
- This.EditorUseLocation (SmartletEditor) Viper Method
- This.Enable (CacheFile) Viper Method
- This.Error.InnerException.Message Viper Method
- This.Error.InnerException.SmartsiteCode Viper Method
- This.Error.InnerException.Throw Viper Method
- This.Error.InnerException.ToString Viper Method
- This.Error.InnerException.Type Viper Method
- This.Error.Message Viper Method
- This.Error.SmartsiteCode Viper Method
- This.Error.Throw Viper Method
- This.Error.ToString Viper Method
- This.Error.Type Viper Method
- This.Evaluate (XmlProcessor) Viper Method
- This.Exists (Json) Viper Method
- This.Expires Viper Method
- This.ExtractBinary (XmlProcessor) Viper Method
- This.ExtraData (Payment) Viper Method
- This.ExtraElements (SmartletBox) Viper Method
- This.Facet (FacetedSearchQueryBuilder) Viper Method
- This.Facet (FacetedSearchQueryBuilder20) Viper Method
- This.FacetSelectFields (FacetedSearchQueryBuilder) Viper Method
- This.FacetSelectFields (FacetedSearchQueryBuilder20) Viper Method
- This.FacetWhereClause (FacetedSearchQueryBuilder) Viper Method
- This.FacetWhereClause (FacetedSearchQueryBuilder20) Viper Method
- This.Field Viper Method
- This.Field.Exists Viper Method
- This.FieldName (FacetedSearchQueryBuilder) Viper Method
- This.FieldName (FacetedSearchQueryBuilder20) Viper Method
- This.FieldWeight (FacetedSearchQueryBuilder) Viper Method
- This.FieldWeight (FacetedSearchQueryBuilder20) Viper Method
- This.FindExact Viper Method
- This.FindExtension Viper Method
- This.FirstResult (Paging) Viper Method
- This.Footer (SmartletEditor) Viper Method
- This.ForceLayout (FlexLayout) Viper Method
- This.FormAttribs (SmartletBox) Viper Method
- This.FreetextTablesearch (FacetedSearchQueryBuilder20) Viper Method
- This.Get (Json) Viper Method
- This.GetAttribute (XmlProcessor) Viper Method
- This.GetByPosition (Json) Viper Method
- This.GetCacheKey (Cache) Viper Method
- This.getcount (Chart) Viper Method
- This.GetDocType Viper Method
- This.GetEncoded (Json) Viper Method
- This.GetEncodedValue (Json) Viper Method
- This.GetEncoding Viper Method
- This.GetForcedResult Viper Method
- This.GetInnerXml (XmlProcessor) Viper Method
- This.GetJson (Json) Viper Method
- This.GetJsonTypeName (Json) Viper Method
- This.GetJsonTypeName (Json) Viper Method
- This.GetLabel (SmartletEditor) Viper Method
- This.GetLocalNodeName (XmlProcessor) Viper Method
- This.GetMaxYValue (Chart) Viper Method
- This.GetMinYValue (Chart) Viper Method
- This.GetNameByPosition (Json) Viper Method
- This.GetNamespaceUri (XmlProcessor) Viper Method
- This.GetNodeName (XmlProcessor) Viper Method
- This.GetOmitXmlDeclaration (XHtmlPage) Viper Method
- This.GetParameter Viper Method
- This.GetPollItem (Poll) Viper Method
- This.GetPrefix (XmlProcessor) Viper Method
- This.getseriesname (Chart) Viper Method
- This.GetTotalCount (Paging) Viper Method
- This.GetTypedValue (XmlProcessor) Viper Method
- This.GetValue (Json) Viper Method
- This.GetValue (XmlProcessor) Viper Method
- This.GetValueByPosition (Json) Viper Method
- This.GetXml (XmlProcessor) Viper Method
- This.GoTo (Paging) Viper Method
- This.Group Viper Method
- This.GroupCount Viper Method
- This.GroupNumber Viper Method
- This.GroupResult Viper Method
- This.GroupRowNumber Viper Method
- This.HasUserVoted (Poll) Viper Method
- This.HeadSection Viper Method
- This.Height (SmartletBox) Viper Method
- This.Ignore (CacheFile) Viper Method
- This.ImageId (Image) Viper Method
- This.Index (For) Viper Method
- This.InfoLabel (SmartletEditor) Viper Method
- This.Initialized (Paging) Viper Method
- This.InnerClass (SmartletBox) Viper Method
- This.InsertAfter (XmlProcessor) Viper Method
- This.InsertBefore (XmlProcessor) Viper Method
- This.InsertNodeAfter (XmlProcessor) Viper Method
- This.InsertNodeBefore (XmlProcessor) Viper Method
- This.isActive (Poll) Viper Method
- This.IsBaseQuery (FacetedSearchQueryBuilder) Viper Method
- This.IsBaseQuery (FacetedSearchQueryBuilder20) Viper Method
- This.IsCached (Cache) Viper Method
- This.IsDirectory (Dir) Viper Method
- This.isMultiSelect (Poll) Viper Method
- This.ItemFormat (FeedReader) Viper Method
- This.ItemFormat (SiteMap) Viper Method
- This.JoinClause (FacetedSearchQueryBuilder) Viper Method
- This.JoinClause (FacetedSearchQueryBuilder20) Viper Method
- This.Key.Add (CacheFile) Viper Method
- This.Key.RemoveChannelDependency (CacheFile) Viper Method
- This.LastModified Viper Method
- This.LastResult (Paging) Viper Method
- This.Length (Json) Viper Method
- This.Length Viper Method
- This.Level Viper Method
- This.LevelResult Viper Method
- This.LevelRowNumber Viper Method
- This.Load (Json) Viper Method
- This.Location (Paging) Viper Method
- This.Location Viper Method
- This.MaxRows Viper Method
- This.MimeType (Json) Viper Method
- This.MimeType Viper Method
- This.Mode (FacetedSearchQueryBuilder) Viper Method
- This.Mode (FacetedSearchQueryBuilder20) Viper Method
- This.Name Viper Method
- This.Offset (Paging) Viper Method
- This.OnClick (Image) Viper Method
- This.OrderBy (FacetedSearchQueryBuilder) Viper Method
- This.OrderBy (FacetedSearchQueryBuilder20) Viper Method
- This.OrderId (Payment) Viper Method
- This.OuterClass (SmartletBox) Viper Method
- This.OuterId (SmartletBox) Viper Method
- This.OutputColorDepth (Image) Viper Method
- This.OutputCommandOrder (Image) Viper Method
- This.OutputFileSize (Image) Viper Method
- This.OutputFileType (Image) Viper Method
- This.OutputFrameCount (Image) Viper Method
- This.OutputHeight (Image) Viper Method
- This.OutputLocation (Image) Viper Method
- This.OutputResolutionUnit (Image) Viper Method
- This.OutputResolutionX (Image) Viper Method
- This.OutputResolutionY (Image) Viper Method
- This.OutputStyle (Image) Viper Method
- This.OutputWidth (Image) Viper Method
- This.param Viper Method
- This.ParameterExists Viper Method
- This.ParentLevel (Parents) Viper Method
- This.PaymentMethod (Payment) Viper Method
- This.PopularityWeight (FacetedSearchQueryBuilder) Viper Method
- This.PopularityWeight (FacetedSearchQueryBuilder20) Viper Method
- This.PreviewPane (SmartletEditor) Viper Method
- This.Price (ShoppingCart) Viper Method
- This.Products (ShoppingCart) Viper Method
- This.Question (Poll) Viper Method
- This.Rank (Tags) Viper Method
- This.RankingFields (FacetedSearchQueryBuilder) Viper Method
- This.RankingFields (FacetedSearchQueryBuilder20) Viper Method
- This.RankingStatement (FacetedSearchQueryBuilder) Viper Method
- This.RankingStatement (FacetedSearchQueryBuilder20) Viper Method
- This.RawField Viper Method
- This.Redirect (Payment) Viper Method
- This.Remove (Json) Viper Method
- This.Remove (ShoppingCart) Viper Method
- This.RemoveAll (ShoppingCart) Viper Method
- This.RemoveAttribute (XmlProcessor) Viper Method
- This.RemoveNamespace (XmlProcessor) Viper Method
- This.Render (Application) Viper Method
- This.Render Viper Method
- This.Rendered Viper Method
- This.RenderedChannel (References) Viper Method
- This.RenderTime Viper Method
- This.ResponseCookies (EmbedUri) Viper Method
- This.ResponseHeaders (EmbedUri) Viper Method
- This.ResponseHeaders Viper Method
- This.ResponseTime Viper Method
- This.Result Viper Method
- This.Result Viper Method
- This.ResultChannelCode (FacetedSearchQueryBuilder) Viper Method
- This.ResultChannelCode (FacetedSearchQueryBuilder20) Viper Method
- This.ResultChannelJoins (FacetedSearchQueryBuilder) Viper Method
- This.ResultChannelJoins (FacetedSearchQueryBuilder20) Viper Method
- This.RowCount Viper Method
- This.RowNumber Viper Method
- This.RowResult Viper Method
- This.Search Viper Method
- This.SearchCondition (FacetedSearchQueryBuilder) Viper Method
- This.SearchCondition (FacetedSearchQueryBuilder20) Viper Method
- This.SearchGroupViewName (FacetedSearchQueryBuilder) Viper Method
- This.SearchGroupViewName (FacetedSearchQueryBuilder20) Viper Method
- This.SearchQuery (FacetedSearchQueryBuilder) Viper Method
- This.SearchQuery (FacetedSearchQueryBuilder20) Viper Method
- This.SelectFields (FacetedSearchQueryBuilder) Viper Method
- This.SelectFields (FacetedSearchQueryBuilder20) Viper Method
- This.SeoPriority (FacetedSearchQueryBuilder) Viper Method
- This.SeoPriority (FacetedSearchQueryBuilder20) Viper Method
- This.Serial (Payment) Viper Method
- This.Serve (CacheFile) Viper Method
- This.Set (Json) Viper Method
- This.SetAttribute (XmlProcessor) Viper Method
- This.SetCurrentPage (Paging) Viper Method
- This.SetCustomDocType Viper Method
- This.SetDocType Viper Method
- This.SetEncoding Viper Method
- This.SetForcedResult Viper Method
- This.SetInnerXml (XmlProcessor) Viper Method
- This.SetNamespace (XmlProcessor) Viper Method
- This.SetNull (Json) Viper Method
- This.SetOmitXmlDeclaration (XHtmlPage) Viper Method
- This.SetProductCount (ShoppingCart) Viper Method
- This.SetResult (XmlProcessor) Viper Method
- This.SetTotalCount (Paging) Viper Method
- This.SetValue (Json) Viper Method
- This.SetValue (XmlProcessor) Viper Method
- This.SetXmlVersion (XHtmlPage) Viper Method
- This.SiblingCount (Siblings) Viper Method
- This.SiblingExists (Siblings) Viper Method
- This.Size (Dir) Viper Method
- This.Size (Paging) Viper Method
- This.Size Viper Method
- This.Skip (Paging) Viper Method
- This.SkipRows Viper Method
- This.SmartletName (SmartletEditor) Viper Method
- This.Status (Payment) Viper Method
- This.StatusCode Viper Method
- This.Step (For) Viper Method
- This.Summary (Payment) Viper Method
- This.SXMLPath Viper Method
- This.TableOrView (FacetedSearchQueryBuilder) Viper Method
- This.TableOrView (FacetedSearchQueryBuilder20) Viper Method
- This.TaxGroups (ShoppingCart) Viper Method
- This.TaxTotals (ShoppingCart) Viper Method
- This.Title (Dir) Viper Method
- This.Title (Image) Viper Method
- This.Title (SmartletEditor) Viper Method
- This.Title Viper Method
- This.ToDisplay (ShoppingCart) Viper Method
- This.ToString (ShoppingCart) Viper Method
- This.Totals (ShoppingCart) Viper Method
- This.TotalVotes (Poll) Viper Method
- This.ToXml (ShoppingCart) Viper Method
- This.UseBox (SmartletBox) Viper Method
- This.Value (Switch) Viper Method
- This.VisibleRowCount Viper Method
- This.VisibleRowNumber Viper Method
- This.Vote (Poll) Viper Method
- This.WhereClause (FacetedSearchQueryBuilder) Viper Method
- This.WhereClause (FacetedSearchQueryBuilder20) Viper Method
- This.Width (SmartletBox) Viper Method
- This.Xml (XmlProcessor) Viper Method
- This.XmlDeclaration (XHtmlPage) Viper Method
- This.XValue (Chart) Viper Method
- This.YValue (Chart) Viper Method
- SXML Data Types
- Examples
- Tips & Tricks