Main menu:

 

November 2008
M T W T F S S
« Sep    
 12
3456789
10111213141516
17181920212223
24252627282930

Site search

Archives

Categories

Tags

Links:

XPath String Operators and Functions

XPath 1.0 have many string functions:

concat(string string1, string string2, …)— This function returns all strings you pass to it concatenated (that is, joined) together.

contains(string string1, string string2)— This function returns true if the first string contains the second one.

normalize-space(string string1)— This function returns string1 after leading and trailing whitespace is stripped and multiple consecutive whitespace is replaced with a single space.

starts-with(string string1, string string2)— This function returns true if the first string starts with the second string.

string(string string1)— Returns the argument you pass to it in string form.

string-length(string string1)— This function returns the number of characters in string1.

substring(string string1, number offset, number length)— This function returns length characters from the string, starting at offset.

substring-after(string string1, string string2)— This function returns the part of string1 after the first occurrence of string2.

substring-before(string string1, string string2)— This function returns the part of string1 up to the first occurrence of string2.

translate(string string1, string string2, string string3)— This function returns string1 with all occurrences of the characters that occur in string2 replaced by corresponding characters (that is, characters that occur at the same location) in string3.

Create a Customer Dashboard in SharePoint

[youtube=http://in.youtube.com/watch?v=ITPHd5BmRaM]

Design patterns

Design pattern are the standards and best practices used to accomplish a particular goal, well there are various design patterns, they are Abstract factory pattern, Builder pattern, and Factory pattern.

Abstract factory pattern : Its a pattern where you create the interface and the interface expose the properties , methods , events and classess..

Like I have a EmployeeFactoryInterface which returns IEmployeeManager

public interface IEmployeeFactory

{

IEmployeeManager Create();

}

public interface IEmployeeManager()

{

Dataset getAllEmployee();

}

public EmployeeFactory : IEmployeeFactory

{

public IEmployeeManager Create()

{

return Employee();

}

}

public class Employee : IEmployeeManager

{

public Dataset getAllEmployee()

{

//create connection

//execute stored procedure

//return dataset containing the employee details

}

}

i will post the figure in my next post

Windows SharePoint Services server architecture

Courtesy:Microsoft

xsl how to count the nodes in a xml file

I have a xml sample file generated from the schema.

<ns0:PurchaseOrder xmlns:ns0=”http://yourprojectname.Schemas.PO”>
<PONumber>PONumber_0</PONumber>
<PODate>1999-05-31</PODate>
<POQty>POQty_0</POQty>
<Customer>

<Name1>Google</Name1>

<Name1>Google web</Name1>
</Customer>
</ns0:PurchaseOrder>

now, in order to find a countthe nodes in a xml file , you need to place the below code in the buffer are of the inline XSLT call template

<xsl:template name=”MyXsltSampleTemplate”>

<xsl:variable name=”countofPO” select=”count(/*[local-name()='PurchaseOrder' and namespace-uri()='http://yourprojectname.PO']/*[local-name()='Customer' and namespace-uri()='']/*[local-name()='Name1' and namespace-uri()=''])”/>

<xsl:element name=”countofPO”>
<xsl:value-of select=”$countofPO”/>
</xsl:element>
</xsl:template>

Thanks

xsl to find whether a string starts with a word in the element

I have a xml sample file generated from the schema.

<ns0:PurchaseOrder xmlns:ns0=”http://yourprojectname.Schemas.PO”>
<PONumber>PONumber_0</PONumber>
<PODate>1999-05-31</PODate>
<POQty>POQty_0</POQty>
<Customer>
<Name1>BiztalkServerGuide</Name1>
</Customer>
</ns0:PurchaseOrder>

now, in order to find a specific string in the element , you need to place the below code in the buffer are of the inline XSLT call template
<xsl:template name=”AnyNameofYourChoice” match=”//*[starts-with(/*[local-name()='PurchaseOrder' and namespace-uri()='http://yourprojectname.Schemas.PO']/*[local-name()='Customer' and namespace-uri()='']/*[local-name()='Name1' and namespace-uri()=''], ‘Biz‘)]”>
<xsl:element name=”startsWithBiz”>
“starts with Biz”
</xsl:element>
</xsl:template>

Thanks

xsl to find a specific string in the element

I have a xml sample file generated from the schema.

<ns0:PurchaseOrder xmlns:ns0=”http://yourprojectname.Schemas.PO”>
<PONumber>PONumber_0</PONumber>
<PODate>1999-05-31</PODate>
<POQty>POQty_0</POQty>
<Customer>
<Name1>BiztalkServerGuide</Name1>
</Customer>
</ns0:PurchaseOrder>

now, in order to find a specific string in the element , you need to place the below code in the buffer are of the inline XSLT call template
<xsl:template name=”AnyNameofYourChoice” match=”//*[contains(/*[local-name()='PurchaseOrder' and namespace-uri()='http://yourprojectname.Schemas.PO']/*[local-name()='Customer' and namespace-uri()='']/*[local-name()='Name1' and namespace-uri()=''], ‘BizTalkServer‘)]”>
<xsl:element name=”containsBiztalkServerGuide”>
“Contains BiztalkServer String”
</xsl:element>
</xsl:template>

Thanks

xsl:template’ cannot be a child of the ‘xsl:template’ element

when you try to add a <xsl:template> element within a <xsl:template> element

<xsl:template>

<xsl:template>

</xsl:template>

</xsl:template>

and try to test the biztalk map, the compiler will throw an error stating xsl:template’ cannot be a child of the ‘xsl:template’ element.

The permissions granted to user ‘NT AUTHORITY\NETWORK SERVICE’ are insufficient for performing this operation. (rsAccessDenied)

I created a report in the development machine and pushed the same onto the server , I am calling the report using the report server url directly using response.redirect in the asp.net application, now it works well in my development machine, but the same doesnt work in the server throwing the above error,  i tried various alternative and finally stumbled upon the perfect resolution.

go to ssrs reports manager (http://yourservername/reports)

And go to the property tab and create a new group with name

BUILTIN\Users

And in the role assignment tick browser role
will work perfectly..

MOSS Ajax dropdown as the provider and gridview as the consumer

I was able to populate the user id’s in the dropdownlist and on selection of any one of the user id in the dropdownlist was able to display the details in the asp.net gridview on the MOSS using Ajax,

I placed the dropdownlist in the provider and asp.net gridview in the consumer, created a sql data source added the parameter and a code behind method which will execute on trigger of select statement.

i placed the dropdownlist in the update panel of the provider

placed the gridview in the update panel of the consumer

the exact implementation i will provide in the next post..