xslt

XSLT Intellisense in Visual Studio 2008

I have an XML file which in addition to it's standard XML schema allows the use of XSLT. I am including the correct namespace for XSLT (xmlns:xsl="http://www.w3.org/1999/XSL/Transform") however I am not receiving Intellisense for XSLT when I start typing xsl: tags. Is it possible to turn this on? When I edit XSLT files it works absolut...

docbook maxwidth on images? (xml:fo)

is there a way to specify the maximum width of images in a docbook xsl-transform? we have a problem with screen shots being to big to fit on a page, and thus would like to set a max width on images in the output. specifying the width of the image in the Docbook XML files seems bad form (the Docbook file should be about content not pres...

Sum contents of column based on a variable with XPath

Hi.. I'm a little bit of a rookie when it comes to XSLT and XPath, so I've run into this problem. I'm creating a simple table based on a view on the databse, which needs to sum some of the columns in the view. What I thourght i could do was add 'SUM_' as a prefix of all the coumns that i want to sum, and cut that tag off with a substring...

Storing XSLT in SQL Server 2005 with xml type?

I have a lot of XSL files in my ASP.NET web app. A lot. I generate a bunch of AJAX HTML responses using this kind of generic transform method: public void Transform(XmlDocument xml, string xslPath) { ... XslTransform myXslTrans = new XslTransform(); myXslTrans.Load(xslPath); myXslTrans.Transform(xml,null, HttpContext.Cu...

Xpath function to remove white space

Hey everyone Im trying to use XSL and Xpath functions to remove all the white space from a XML attribute called name and make it lower case. At the moment i have something like <xsl:variable name="linkName"> <xsl:value-of select="normalize-space(name)"/> </xsl:variable> This removes the white space at the beginning and end but no...

pound(#) sign in directory name: in Java How to read it

The ClassLoader doesn't find me the file. It throws a: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.io.FileNotFoundException: I was trying to do the follwoing: TransformerFactory.newInstance().newTransformer(new StreamSource("C:\\dev\\workspace\\test1\\a#b\\Browser-Email....

XSLT:Which is the best tutorial you would like to recommend..

I want to learn the programming skills in XSLT to convert from XML to XML .. step by step .. I am finding it hard to program with XSLT .. I have tried w3schools.com, tizag.com and books like XSLT from novice to professional(O'Reilly publications) etc,all these teach to convert XML to HTML page ..but I need some tutorial or guide which c...

XSLT: what is the difference between <copy-of> and <apply-templates>?

hi! where should I use <copy-of> and <apply-templates> ? I mean where they play unique role .. Most of the time replacing <apply-templates> with <copy-of> gives out weird output .. why is that? thanx in advance .. ...

preproccesing in XSLT

is it at all possible to 'pre-proccess' in XSLT? with preprocessing i mean updating the (in memory representation) of the source tree. is this possible, or do i need to do multiple transforms for it. use case: we have Docbook reference manuals for out clients but for certain clients these need different 'skins' (different images etc)....

XSL msxsl:node-set problem

Please help me out guys. I'm just trying to declare a simple result tree fragment and iterate over it. ... <xsl:variable name="rtf"> <item-list> <item id="1">one</item> <item id="2">two</item> <item id="3">three</item> <item id="4">four</item> </item-list> </xsl:variable> <xsl:for-each select="msxsl:node-set($rt...

Varying xpath-default-namespace in XML source files

I have a set of XML files that I am processing with an XSL transform. They have a default namespace, so my XSL transform must contain the declaration: xpath-default-namespace="urn:CZ-RVV-IS-VaV-XML-NS:data-1.2.2" The problem is that this value changes from time to time, and my transform suddenly stops working, until I look at an exampl...

Display XSD-defined default value of attribute using XSL

I thought this ought to be simple to find, yet after some searching I found this might be nice to define clearly. In my XSD I've defined an enum, derived from string. In a complex type I've defined and attribute that refers to this enum, with a default value. In my XSL I wish to display the default value of this attribute for elements ...

How to remove part of attached xml with xslt?

Lets assume we have xml: <tag1> text <tag2> { <tag3> name1 </tag3>:<tag4><val>value1</val>;</tag4> <tag3> name2 </tag3>:<tag4><val>value2</val>;</tag4> }</tag2> </tag1> How to remove whole line with name1 and value1 (from <tag3> to </tag4>) with xslt? I have no problem to remove tag3 and tag4 but this colon (':') character is pr...

XSLT document() usage with WebKit browsers

I'm having an issue when attempting to include and access multiple XML documents in an XSL stylesheet. I'm assigning document nodes as variables and then attempting to access them in my xsl:template, similar to this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="xml" omit-xml-d...

Parsing BBCode with xslt 2.0

Hi. I need help finding a viable solution to convert bbcode to html, this is where ive come so far, but fails when bbcodes get wrapped. Src: [quote id="ohoh81"]asdasda [quote id="ohoh80"]adsad [quote id="ohoh79"]asdad[/quote] [/quote] [/quote] Code: <xsl:variable name="rules"> <code check="&#xD;" >&lt;br/&g...

How to enable XSLT scripting in C# .. ?

I have modified the title of the question after finding the answer :) :P I am loading an XML file and an XSL file by a C# program and triggering the XSL transformation .. here is the code for it: static void Main(string[] args) { // Create the XslCompiledTransform and load the stylesheet. XslCompiledTransform xslt...

Capitalize Element Name in XSL

I am writing a XSL transformation and my source has an element like this - "title". The target xml should contain "Title". Is there a way to capitalize the first letter of a string in XSL? ...

How to transform xml and keep newlines?

Hi, I'm trying to preserve row breaks in an xml file when transforming it to html, but I cant find a way that works. <meta> <name>Message</name> <value>Hi! I need info! Mr Test</value> </meta> And I use this xsl: <xsl:if test="name='Message'"> <tr> <th align="left" colspan="2">Message:</th> </tr> <tr> <td colsp...

How do I shorten this XSL block?

I've come across the following snippet in an XSL file that I'm working with. The XSL is basically converting HTML tags and international content (characters with accents mostly) into a format digestable by QuarkXPress. I'm not familiar with XSL at all and judging by the code it looks like we're checking some content against a regular e...

Can we pass values from XSLT to code behind(C#)

Hi, I have an XML response. In that response I have a node called <Paging> which gives information about Paging. I need to pass the values of paging node to code behind. So that I will have to use those values to form a URL. I am using C#. My ultimate goal is to build a Paging Web Part. Any help would be really appreciated. Thanks Ca...