Article archive
Add empty space with Xslt
17/12/2012 12:12
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
Create publishing pages from Xml file
17/12/2012 11:58
#Input Xml's
#SampleBlogs.xml (File name is derived from title, just illegal characters removed and replaced by dash)
<?xml version="1.0" encoding="utf-8"?>
<Pages>
<Page>
<Title>Page...
Add items to sharepoint list
17/12/2012 11:38
Add items to simple sharepoint list with 'Title' column only.
# ListItemExists
# GetListItemByTitle
# GetPageByTitle
# AddItemsToSimpleList
function ListItemExists
{
param ([object]$sourceList, [string]$value)
try
...
Include the same setting file only once
17/12/2012 11:18
We have many scripts (e. g. debug.ps1, debug2.ps1) with one shared settingsTest.ps1 file. We wanted to load settingsTest.ps1 file, but only when it's needed. Case was when file was not included yet, or was modified since last inclusion. We have four files here what use settingsTest.ps1 file....
Xml variable in Xslt
08/12/2012 14:48
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet...
Sorting by attribute, Paging with links
08/12/2012 12:56
Following Xslt code takes pageNr from itself, but it's supposed to take it from queryString. That's why links on pages create querystring with 'pageNr' name and value. pageSize is settable in Xslt or by web part and passed as webpart property to xml/xslt.
<?xml version="1.0"...
Xslt For loop example
08/12/2012 11:53
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited by Lukas Sevcik® -->
<xsl:stylesheet version="1.0"
xmlns:xsl="https://www.w3.org/1999/XSL/Transform">
<xsl:template...
Common Xslt function
08/12/2012 11:13
Starts-With
if url starts with http
<xsl:when test="starts-with('https://www.google.com','http')">
...
</xsl:when>
Replace text using translate(inText, what, with)
title is node value
{token} - text to replace
$days is variable
normalize-space is used to trim...
Basic XPath syntax
08/12/2012 11:08
XPath Syntax
Article copied from W3Schools: https://www.w3schools.com/xpath/xpath_syntax.asp
The XML Example Document
We will use the following XML document in the examples below.
<?xml version="1.0"...
Send Web part property to Xslt
08/12/2012 07:22
1. Define querystring in .webpart file
<property name="ParameterBindings" type="string"><ParameterBinding Location="WPProperty(category)" Name="CategoryProperty"/></property>
or equivalent in .aspx...
Items: 231 - 240 of 384