xslt

Missing <?xml version="1.0" encoding="XXXXX"?> after transformation

I am facing a problem after transformation of an XML file and saving it, i.e. I'm not getting the XML file top tag <?xml version="1.0" encoding="utf-8"?>. Below is my XSLT file: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes" ...

Transforming XML in ISO-8859-1 to HTML

I have an XML document that I'm transforming using XSL and then spitting out directly into an HTML document (all server side). Everything works OK functionally but special characters (specifically the © symbol -- these are ads and many have © symbols) don't show up right (IE shows ? and FF shows a diamond with a ? inside). Obviously so...

How do I run an XSLT file?

Alright this seems like a stupid question but I can't figure it out. I'm writing an XSLT file to translate an XML document into an XHTML document. I've used both Visual Studio and XML Notepad 2007 to preview the results of my XSLT file, but now I want to actually write out a real XHTML file so I can see how it looks in other browsers. ...

xslt count nodesets returned by key

In my xslt, I am trying to determine the number of distinct schedule_id values in my <event/>s so that I can output a table where each column is used for one schedule_id. The following key should retrieve the nodesets grouped as I require. So how do I determine how many nodesets are returned? <xsl:key name="events-by-schedule" match="...

XSLT+ooxml worksheet problem

Hello everyone, I am using ooxml format for generating excel based sheets from xml data using xslt 2.0. The issues I am running into is . I have a multiple worksheets in xsl:template match as below: xsl:template match="Detail" Worksheet ss:Name="D" .... /Worksheet Worksheet ss:Name="A" ... /Worksheet Worksheet ss:Name="C" ... /W...

XSL Transform - Remove Parent Node

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com"> <soapenv:Body> <upsertResponse> <result> <created>true</created> <id>0011</id> <success>true</success> </result> <result> <created>false</created> <id>0012</id> <success>true</success> ...

Sourcing multiple xml docs from single xslt.

I am trying this and cannot seem to get it to work. Can someone take a look and see if I am missing something obvious. I am referencing the extra doc like this in test.xsl. <xsl:value-of select="document('/customercare/library/test/test1.xml')/resources/resource/name" /> This is the xml test1.xml. <resources> <resource> <n...

Using new fonts with Apache FOP in Java

I have to internationalize an application, and therefore have to let a user chose a font for a PDF that I will create at runtime. I want to be able to display a list of font choices from the user's system using GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); This works fine for getting fonts, but then it seems that ...

Xslt transform on special characters

Hi Guys, I have an XML document that needs to pass text inside an element with an '&' in it. This is called from .NET to a Web Service and comes over the wire with the correct encoding &amp; e.g. T&amp;O I then need to use XSLT to create a transform but need to query SQL server through a SP without the encoding on the Ampersand e.g...

XSLT: Use result of expression inside a loop outside of that loop

I'm trying to transform certain parts of an XML file to another XML file. The source file: <CUSTOMERS> <CUSTOMER> <CUSTOMER_NUMBER>12345678</CUSTOMER_NUMBER> <CUSTOMER_ADDRESS> <CUSTOMER_ADDRESS_NAME>John Doe</CUSTOMER_ADDRESS_NAME> <CUSTOMER_ADDRESS_STREET>Street 1</CUSTOMER_ADDRESS_STREET> <CUSTOMER_ADDRESS...

How to remove namespace in xslt

Hi All, using xslt I am trying to get xhtml o/p .I have used xmlns="http://www.w3.org/1999/xhtml" in <xsl:stylesheet> to get xhtml o/p.Every thing is fine but in the first div I am getting the same namespace. i.e. <div xmlns="http://www.w3.org/1999/xhtml"&gt; Now how to remove xmlns="http://www.w3.org/1999/xhtml" ...

Beginner's XSLT question: Select node based on a value elsewhere in the XML structure

--edited for clarity (hopefully) I have an XML file that looks something like this: <questionBlock> <responses> . . . <response> <degree>1</degree> <instdegree>1</instdegree> </response> . . . </responses> <question> <variable>degree</variable> <text>Please select a degree o...

XHTML to XHTML with XSLT and its encodings

Hi there! I'm learning XSLT, and as an exercise, I'm trying to get the top links of http://ptchan.org/fa/, namely {al, az, fa, ga, li, tm}. To do so, I've created the following XSL Template: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.o...

Xslt transformation for-each

Could anyone help me with the following transformation? Here is the XML <Chart> <Chart.Series> <DataSeries LegendText="Complete On Time" > <DataSeries.DataPoints> <DataPoint AxisXLabel="Sep 09" YValue="10" /> <DataPoint AxisXLabel="Oct 09" YValue="11" /> <DataPoint AxisXLabel="Nov 09" YValue="12" /> </DataSeries.DataPoin...

CUSTOM SORT XSL ?

Hi This is my XML Structure like this input :- <MYDATA> <DETAILS> <DESCRIPTION>EASE</DESCRIPTION> </DETAILS> <DETAILS> <DESCRIPTION>COMPLEX</DESCRIPTION> </DETAILS> <DETAILS> <DESCRIPTION>SIMPLE</DESCRIPTION> </DETAILS> </MYDATA> I want to display like this using xsl sort it mea...

Use xslt to convert xml list into html table with multiple columns

Say I have an xml document consisting of a list as shown below: <Items> <Item>First Item</Item> <Item>Second Item</Item> <Item>Third Item</Item> <Item>4</Item> <Item>Five</Item> </Items> I want to convert it to a html table with two columns for the Item elements (I'm not fussed at the moment whether it's ordererd top-bottom-...

XSLT: Apply templates with conditional parameters?

I'd like to apply a template with different parameters based on the result of a conditional. Something like this: <xsl:choose> <xsl:when test="@attribute1"> <xsl:apply-templates select='.' mode='custom_template'> <xsl:with-param name="attribute_name" tunnel="yes">Attribute no. 1</xsl:with-param> <xsl:...

Working with XSLT in Visual Studio

In my C# client application, I use XSLT to transform XML into HTML. I would like to be able to edit these files in place, without having to recompile the entire solution. I'm having trouble working out how to set up Visual Studio 2008 to allow this. The problem is that the XSLT files must get copied to the output directory somehow. Cu...

applying xml to xslt help

I have an XML file that is very long, but here is a shot excerpt. <?xml version="1.0" encoding="UTF-8"?> <dicom> <attr tag="00020000" vr="UL" len="4">190</attr> <attr tag="00020001" vr="OB" len="2">00\01</attr> <attr tag="00020002" vr="UI" len="30">1.2.840.10008.5.1.4.1.1.88.11</attr> <attr tag="00080090" vr="PN" len="14...

Assigning parameter value to the xsl: for each..

Hi All, Can anybody who has worked on XSLT help me on this? I am using XSL version 1.0. I have declared a parameter in XSL file like: <xsl:param name="HDISageHelpPath"/> Now I am assigning the value to this parameter from an asp page . The value which I assign is "document('../ChannelData/Sage/help/ic/xml/HDI.xml')/HelpFiles/Help"....