xslt

RegExp in XSLT

Hi all! I need to parse Visual Studio automatically generated XML documentation to create a report. I decided to use XSLT but I'm very new to it and need help. Common template is: <doc> <members> <member name="F:MyNamespace"> <summary>Some text</summary> </member> </members> </doc> I want to isolate members with nam...

How to to create a boolean value in XSLT?

I am totally new to XSLT and can't work out where I am going wrong with the following code. <xsl:variable name="var" select="boolean('false')"/> <xsl:if test="$var'">variable is true</xsl:if> It is always returning true when it is meant to be false. Can anyone help? ...

How can xsl:apply-templates match only templates I have defined ?

I have several templates that match various nodes in an xml document. If I do just an <xsl:apply-templates/> it somehow recursively outputs the text of all the nodes beneath. I just want it to recursively match any template I have defined. How do I do that ? ...

Check if the node set contains any value in XSLT

Hello, I need some help with XSLT syntax. Here is my scenario, I have an XML file that needs to be transformed in to a different look and feel of XML file, I have several sections where if particular node set don't contain any value the whole section shouldn't be processed. Here is an example of XML: <Dates> <Date> <VALUE1></V...

With XSLT/XPath, how can I match any element in the null namespace?

<xsl:template match="foo"> matches the foo element in the null namespace. <xsl:template match="*"> matches any element in any namespace. I tried: xmlns:null="" ... <xsl:template match="null:*"> but it's illegal to declare a prefix for the null namespace. So how can I match an element with any name in the null namespace? ...

xsl:include of another xslt file from Win32 resources

Hello. I'm using xslt transformer in my C++ Win32 application and several xsl files that have a common part that I would like to separate into another xsl file. All xsl files are stored as resources. The only way I encountered for xsl:include is using res:// protocol that does not work properly for xsl files (at least on two of my Windo...

How to remove duplicate XML nodes using XSLT

I've got an extremely long XML file, like <Root> <ele1> <child1>context1</child1> <child2>test1</child2> <child1>context1</child1> </ele1> <ele2> <child1>context2</child1> <child2>test2</child2> <child1>context2</child1> </ele2> <ele3>...........<elen> </Root> Now I want to remove al...

One large xslt over smaller more granular ones

We have one large xslt that renders a whole shop area including products, manifacturers and does filtering based on price and cateogry on top of that. I'm using sitecore as a CMS and I'm having problems with caching. I have about 9000 items and some pages take as much as 20s to render. Will it be better to split the xslt into smaller par...

Element-in-List testing in XSLT

For a stylesheet I'm writing (actually for a set of them, each generating a different output format), I have the need to evaluate whether a certain value is present in a list of values. In this case, the value being tested is taken from an element's attribute. The list it is to be tested against comes from the invocation of the styleshee...

i need XSLT for indesign

hi this is ahamed, i need some ideas for indesign with XSLT...i donot have any idea about programming i am using indesign CS3.. i have ms access file contain 8 columns. 1st column Classification 2nd column company name 3rd column postbox 4th column city 5th column telephone 6th column fax 7th column email 8th column website First, how...

Use XSL to generate dynamic XSL that is executed within the same script?

Hello all, I want to dynamically create variables with dynamic names for later use in my transform, but to do this I'd need to dynamically generate XSL and then run it in the same script. This is just a rough pseudo code example of what I'm looking for. <xsl:for-each select="//constants/constant" > <xsl:variable > ...

Embed xsl into an XML file

I'm trying to embed an xsl into a XML file. The reason for doing this is to create a single file that could be moved to different computers, this would prevent the need to move the xsl file. The xsl file is creating a table and grabbing a test step from the xml and whether it passed or failed, pretty simple. The issue I'm having, I t...

XML to CSV Using XSLT

I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008 0:00:00</startDate> </project> <project> <name>Other</name> <language>Erlang</language> <owner>Takashi Miike</owner> <state> C...

What are the allowed .NET return types from a XSLT extension object method?

.NET allows to extend XSLT by using the so called extension object. Very handy and very convenient. You do so by creating a class: public class VeryHandyExtensionFunctions { public string VerySmartStringConcat(XPathNodeIterator NodeList) { return "some very smart string concat based on NodeList"; } } pending some ma...

How to get tag name of root element in an XML document w/ XSLT?

Hi all, I'm interested in assigning the tag name of the root element in an xml document to an xslt variable. For instance, if the document looked like (minus the DTD): <foo xmlns="http://....."&gt; <bar>1</bar> </foo> and I wanted to assign the string 'foo' to an xslt variable. Is there a way to reference that? Thanks, Matt ...

xsl grouping sort problem

Hi I have the following xsl template that I'm using to group my xsl. The problem I have is that I need to uppercase the @Title as currently my grouping is seeing upper and lowercase as seperate groups. <xsl:key name="rows-by-title" match="Row" use="substring(@Title,1,1)" /> <xsl:template name="Meunchian" match="/dsQueryResponse/...

java append to file

I googled for this for a while but can't seem to find it and it should be easy. I want to append a CR to then end of an XML file that I am creating with a Transformer. Is there a way to do this> I tried the following but this resulted in a blank file? Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.set...

Is there any online XSLT processing service available?

(This might not seem strictly programming related, but I figure it's about deployment of an XSLT solution, and XSLT is a programming language, right?) I have this cunning plan for customizing a podcast that I subscribe to so the titles and other parts of the feed fit more to my liking. I figure I can devise some XSLT that expects the or...

can you get XmlCompiledTransform progress?

Hello, I want to read an xml file, apply a transform, then write to another file. The best way I can think of is this: using (XmlTextReader reader = new XmlTextReader(new FileStream(_source, FileMode.Open))) using (XmlTextWriter writer = new XmlTextWriter(new StreamWriter(_destination))) { _xslTransform.Transform(reader, writer); } ...

How can I do an in list option for XSLT

In Pseudo code If Domain inList(GB,US,ES,FR Then Print This Html Else Print This HTML EndIf Thanks ...