xslt

XslTransform.Transform to produce multiple output files

I need to produce multiple HTML report files from an XML data file and I'm using C# (.NET 3.5). I essentially need on HTML report for each of certain child trees in the XML file (but they have to include some parent info). I've decided to use XSLT, because it seems to be the most elegant solution to my problem. I can then use the .NET X...

Embedding fonts

I'm using Apache FOP with an XML document, and I'm trying to render a pdf. I have to embed a font into the resultant pdf file because it has to use international characters. Does anyone know how to do this? ...

Any good XSLT sheets for XML to PDF?

Does anyone know of a solid non-encumbered suite of XSLT sheets that can generate PDF via an XSL transform? I really like XSL transforms, I use them to make HTML output from dbms's. Now I have some data in a DBMS that I like to generate PDF output from. I've not written a dbms to XML script yet for this data, so I have no commitment to...

[XSLT] Test for a value inside a string

Let's say I have the string of "2004,2005,2006,2007,2008,2009" that is assigned to the parameter of "show". Now, this does work: <xsl:if test="$show='2004'"> //stuff </xsl:if> This doesn't work: <xsl:if test="$show='2005'"> //stuff </xsl:if> I'm not sure how to test for part of a string like that. Any idea? ...

Two concepts from XSLT in other languages: apply-templates and xpath

Background: Having given up on the practical daily use of XSLT as a part of my programming toolkit, I was wondering if there were any implementations in other languages of the (only) two things I miss about that tool: the ability to traverse data structures using "path" style statments via xpath the ability to traverse template transfo...

Add soap header - update a node - copy document

I'm trying to add Soap headers to my document and update the first RS node with <Rs xmlns="http://tempuri.org/schemas"&gt; all while copying the remainder of the document nodes. In my real example i'll have more nodes within RS parent node so i'm looking for a solution with a deep copy of some sort. <-- this is the data which needs...

How to deal with namespaces in XSLT?

If I have XML like this: <sample> <a:element1 xmlns:a="..." /> <b:element2 xmlns:b="..." /> </sample> it seems that XSL can't find the two child nodes of <sample> due to the prefixes a: and b:. If I eliminate the two prefixes as well as the namespace declaration, then they are found. The problem is that I can't do any...

XSLT transform element value to childs value

My XML looks like this: <element> <AttrValue someatt="a"> <StyledElement> <Container /> <StyledElement> <Paragraph /> <StyledElement> <PlainText someValue="some Text" /> </StyledElement> </StyledElement> <StyledElement> <Paragraph /> <StyledElement> ...

Ubuntu: Error installing php5-xsl package

Hi Guys, I am trying to install php5-xsl (XSLT) package in my Ubuntu 8.10 but I am getting an error message. I think I need to update the repository of the apt-get? Thanks in advance :) - Mark My syntax: sudo apt-get install php5-xsl Error message: W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php5/php5-xsl_5.2.6...

How to remove particular characters from a string using XSLT?

Hi, I need to check if a particular string contains a a particular word for example to check if, SultansOfSwing contains the word Swing. Let me also mention that the value of the string in question is unknown. As in it can be any word so we do not know the length et cetera. I understand I can do this by using the contains keyword. Bu...

[XSLT] Get the total number of nodes and counting nodes

Is it possible to get the total number of XML nodes? Also, how does one do a for-statement with XSLT? ...

Question on XPATH for an XSLT File And XSLT If Statement

I have the following xml file <DriveLayout> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="4" /> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="16" /> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="510" /> <Drive driveVolume="/u" Group="sa" Owner="sa" /> <Drive driveVolume="/u" Group="sa" Owner="sa" tota...

Incorporating XSLT generated table into a webpage

I am currently updating a webpage that has some very simple data displayed in a 2xnumberOfEntries table. The original is hard-coded into html, which, as a programmer, I find to be annoying. I decided that converting the data to a simple XML schema would be the best idea since I really have no need for the added features of a database. ...

XSL element with multiple namespace with different prefix

I wanna create an element in my XSL 1.0 with some namespace Just like this: <element xmlns:a = '...' xmlns:b = '...' xmlns = '...' > For some reason I can't use XSL 2.0, with <xsl:namespace> extension, there is only one allowed namespace declared for each element in XSL 1.0,how should I do? Regards, ...

Is there any easy way to create new xmls from a xml file using c#

For example <?xml version="1.0" encoding="UTF-8"?> <!--just example, the actual element structure is rather complex --> <components> <component name='a'/> <component name='b'/> <component name='c'/> </components> Now I want to create three separate xml file, whose root element is component and the file name is according to t...

How to generate metrics file (xml) for font?

Hi! How can I generate metrics file for font using iText? I need to append new font to pdf I generate using iText, I found that I need a metrics file for font to do that... ...

Is there a free tool to generate a XSLT template based on one XSD file?

The tool I am looking for should be able to generate a XSLT template based upon one XSD file (target = source). Without changes to the template the execution of the XSLT would result in a XML file that is exactly the same as the source. My goal is to use the template and do minor changes to the sequence of tags in the result XML-file. Th...

Group Similar nodes in XML using XSLT

I have the following XML structure <?xml version="1.0" encoding="UTF-8"?> <Root> <BookingGroup> <PostCodes> <PostCode >AB</PostCode> <PostCode >AL</PostCode> </PostCodes> </BookingGroup> <BookingGroup> <PostCodes> <PostCode >AB</PostCode> <PostCode >D</PostCode> </PostCodes> </...

Why is my XSLT fragment causing an error?

I am trying to use the below code to check if my variable contains the word NOT_INTERFACED. So I am using the ends-with function. But if it does I want to print the remaining word minus NOT_INTERFACED. But I am getting an error, my java program is calling this template however I get an exception ends-with not found. Am I doing somet...

Conditional statements in xsl

I working on a site which some if/or statements in XSL and being a little unfamilar with the language i'm not certain how to accomplish: if [condion one is met] or [condition two is met] then do [action] otherwise do [alternative action] can anyone offer some examples? Thanks in advance! ...