How to apply an XSLT Stylesheet in C#
I want to apply an XSLT Stylesheet to an XML Document using C# and write the output to a File. 4 Answers 4
I want to apply an XSLT Stylesheet to an XML Document using C# and write the output to a File. 4 Answers 4
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
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
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
Using a XPath query how do you find if a node (tag) exists at all? For example if I needed to make sure a website page has the correct basic structure like /html/body and /html/head/title. 6 Answers 6
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
I want to produce a newline for text output in XSLT. Any ideas? 13 Answers 13
How can I insert Into an XSLT stylesheet, I keep getting this error: XML Parsing Error: undefined entity Essentially I want a non breaking space character in the XSLT Template. 12 Answers 12
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
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