Is there any way to do a “Replace Or Insert” using web.config transformation?

I’m using web.config transformation as described in the below post in order to generate configs for different environments. http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html I can do a “Replace” transformation by matching on the key, e.g. <add key=”Environment” value=”Live” xdt:Transform=”Replace” xdt:Locator=”Match(key)” /> And I can do “Inserts” e.g. <add key=”UseLivePaymentService” value=”true” xdt:Transform=”Insert” /> But what I would really find useful … Read more

How to implement if-else statement in XSLT?

I am trying to implement an if -else statement in XSLT but my code just doesn’t parse. Does anyone have any ideas? <xsl:variable name=”CreatedDate” select=”@createDate”/> <xsl:variable name=”IDAppendedDate” select=”2012-01-01″ /> <b>date: <xsl:value-of select=”$CreatedDate”/></b> <xsl:if test=”$CreatedDate > $IDAppendedDate”> <h2> mooooooooooooo </h2> </xsl:if> <xsl:else> <h2> dooooooooooooo </h2> </xsl:else> 5 Answers 5

XPath with multiple conditions

What XPath can I use to select any category with a name attribute specified and any child node author with the value specified. I’ve tried different variations of the path below with no success: //quotes/category[@name=”Sport” and author=”James Small”] The XML: <?xml version=”1.0″ encoding=”utf-8″?> <quotes> <category name=”Sport”> <author>James Small<quote date=”09/02/1985″>Quote One</quote><quote date=”11/02/1925″>Quote nine</quote></author> </category> <category name=”Music”> … Read more

XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless)

I’m trying to create a website that can be downloaded and run locally by launching its index file. All the files are local, no resources are used online. When I try to use the AJAXSLT plugin for jQuery to process an XML file with an XSL template (in sub directories), I receive the following errors: … Read more

Error: The processing instruction target matching “[xX][mM][lL]” is not allowed

This error, The processing instruction target matching “[xX][mM][lL]” is not allowed occurs whenever I run an XSLT page that begins as follows: <?xml version=”1.0″ encoding=”windows-1256″?> <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”> <xsl:include href=”https://stackoverflow.com/questions/19889132/header.xsl”/> <xsl:template match=”https://stackoverflow.com/”> <xsl:call-template name=”pstyle”/> <xsl:call-template name=”Validation”/> <xsl:variable name=”strLang”> <xsl:value-of select=”//lang”/> </xsl:variable> <!– ////////////// Page Title ///////////// –> <title> <xsl:value-of select=”//ListStudentFinishedExam.Title”/> </title> Note: I removed any … Read more

Check if a string is null or empty in XSLT

How can I check if a value is null or empty with XSL? For example, if categoryName is empty? I’m using a when choosing construct. For example: <xsl:choose> <xsl:when test=”categoryName !=null”> <xsl:value-of select=”categoryName ” /> </xsl:when> <xsl:otherwise> <xsl:value-of select=”other” /> </xsl:otherwise> </xsl:choose> 14 Answers 14