Tag Archives: xslt

How to do XSLT 2.0 transformation with C# [duplicate]

Questions: This question already has an answer here: What is the current state of XSLT 2.0 availability within .NET 2 answers Answers: There is no XSLT 2.0 processor offered by Microsoft. An XSLT 2.0 processor that claims to be written especially to be used in .NET is XQSharp. Another very popular XSLT 2.0 processor is… Read More »

What does node()|@* mean XSLT?

Questions: I have seen this being used in this contect: <xsl:template match=”node()|@*”> <xsl:copy> <xsl:apply-templates select=”node()|@*”/> </xsl:copy> Can anyone explain that the “node()|@*” means? Answers: This is called the identity transform. The node()|@* is matching all child nodes (node() is all text,element,processing instructions,comments) and attributes (@*) of the current context.

Getting “prefix 'soap' is not defined” in xslt file

Questions: I am trying to transform a string with xml data (response from a web service). I tried to start simple by just getting the name: <?xml version=”1.0″ encoding=”utf-8″?> <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:msxsl=”urn:schemas-microsoft-com:xslt” exclude-result-prefixes=”msxsl”> <xsl:output method=”html” indent=”yes”/> <xsl:template match=”/”> <table> <tr> <th>Name</th> </tr> <xsl:for-each select=”soap:Envelope/soap:Body/ABRSearchByABNResponse/ABRPayloadSearchResults/response/legalName/”> <tr> <td> <xsl:value-of select=”givenName”/> </td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet>… Read More »

Can you use JQuery to transfrom XML to XML via XSLT

Questions: I have a website that has links to documents that are dynamically populated based on the document type and all the data is located in one central xml file. I wanted have JQuery pass a parameter to the style sheet, the style sheet segregate out the the nodes using xpath based on the passed… Read More »

How to output HTML file from XML and XSLT stylesheet

Questions: I’ve created a XML data document and an XSLT stylesheet, and I want to output an HTML document based on the two. My stylesheet has the tag, and my XML document has the processor instuction (along with various “xsl:value-of” references). My question is, what are the actual “mechanics” of getting the XSLT processor (which,… Read More »

XSLT if attribute exists / else

Questions: I’m quite new to XSLT and therefore I want to know what is the best practice for checking the existance of an attribute. My XML looks something like this: <root> <languages> <lang id=”EN”>English<lang> <lang id=”FR”>French<lang> <lang id=”DE”>German</lang> </languages> <items> <item lang=”EN”>test 1</item> <item>test 2</item> <item lang=”FR”>item 3</item> </items> </root> Note that the ‘lang’-attribute for… Read More »

Will XSLT work well with AJAX?

Questions: This might be a stupid or obvious question, but our whole site is rendered using XSLT to transform xml which is created on the fly from database queries and other pieces. Im starting to push a lot of ajax into the site to make it more dynamic, is there a good tutorial on xslt… Read More »

How do I get EXSLT support in Saxon-HE?

Questions: I have a bunch of XSLT files that I need to process against some XML files. I cannot change the XSLT files as they come from a 3rd party. The XSLT’s are version 2.0. I’m on Mac OS X 10.6 and it looks like Saxon-HE is the only XSLT 2.0 processor available. Most of… Read More »

Use XSLT to convert separators into wrappers

Questions: I have a piece of XML that I want to transform with XSLT (using xsltproc–so only XSLT 1.0). The original XML uses some tags as separators like this: <container> <element /> <element /> <separator /> <element /> <element /> <element /> <separator /> <element /> </container> I need to transform this into a format… Read More »

Is IF statement allow OR condition in XSLT?

Questions: how to test if my condition is this; <xsl:if test=”node = ‘1’ or node=’2′”> <input name=”list_{@id}” value=”{@id}” type=”checkbox”/> </xsl:if> Is IF statement allowed OR condition? Please advice.. Answers: Is IF statement allowed OR condition? No, but XPath has an or operator — do note that XPath is case-sensitive language. The XPath expression in the… Read More »