473,804 Members | 4,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uppercase in XSLT/XSL-FO

Hi all,

Is there a function or something in XSLT or XSL-FO to make data from
an XML-file uppercase?
I ask this becouse I have a XML-document with <title>whatever </title>
tags, and i want the data to appear in uppercase in the final
PDF-document.

Thanks for any help
Jul 20 '05 #1
3 12651
On Wed, 01 Oct 2003 01:38:38 -0700, Jurrie wrote:
Hi all,

Is there a function or something in XSLT or XSL-FO to make data from an
XML-file uppercase?
I ask this becouse I have a XML-document with <title>whatever </title>
tags, and i want the data to appear in uppercase in the final
PDF-document.


this is not an XSLT, but an XPath issue. there are several xpath string
functions, that can easily be found in the XPath standard

http://www.w3.org/TR/xpath#section-String-Functions

look for the translate function. this will solve your problem.

alex
Jul 20 '05 #2
Jurrie <ju************ @hotmail.com> wrote:
Is there a function or something in XSLT or XSL-FO to make data from
an XML-file uppercase?
I ask this becouse I have a XML-document with <title>whatever </title>
tags, and i want the data to appear in uppercase in the final
PDF-document.


There are some fonts that display upper case characters for both upper
and lower case characters.

--
Ron

Jul 20 '05 #3
Ron Peterson <ro*@shell.core .com> writes:

Jurrie <ju************ @hotmail.com> wrote:
Is there a function or something in XSLT or XSL-FO to make data from
an XML-file uppercase?
I ask this becouse I have a XML-document with <title>whatever </title>
tags, and i want the data to appear in uppercase in the final
PDF-document.


There are some fonts that display upper case characters for both upper
and lower case characters.


Alternatively use the translate() function from XPath.

With this XML,

- - -
<doc>
<title>Hello, world!</title>
</doc>
- - -

this transformation,

- - -
<xsl:styleshe et
version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">

<xsl:output omit-xml-declaration="ye s"/>

<xsl:template match="/doc">
<xsl:value-of select="transla te(title,
'abcdefghijklmn opqrstuvwxyz',
'ABCDEFGHIJKLMN OPQRSTUVWXYZ')"/>
</xsl:template>

</xsl:stylesheet>
- - -

gives the result

- - -
HELLO, WORLD!
- - -

A neater way to do it if you have more than one occasion to upcase
things is to define entities as follows:

- - -
<!DOCTYPE xsl:stylesheet [
<!ENTITY lower "abcdefghijklmn opqrstuvwxyz">
<!ENTITY upper "ABCDEFGHIJKLMN OPQRSTUVWXYZ">
]>

<xsl:styleshe et
version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">

<xsl:output omit-xml-declaration="ye s"/>

<xsl:template match="/doc">
<xsl:value-of select="transla te(title,&lower ;,&upper;)"/>
</xsl:template>

</xsl:stylesheet>
- - -

Ben

--
Ben Edgington
Mail to the address above is discarded.
Mail to ben at that address might be read.
http://www.edginet.org/
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2750
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a straight XML file http://www.discovertravelandtours.com/test/templates/test.xml?Location=Germany To another XML file http://www.discovertravelandtours.com/test/templates/test2.xml?Location=Germany
2
5472
by: Sven | last post by:
Hi I have the following XML & XSLT: XML: <?xml version="1.0" encoding="utf-8"?> <Source Source="IBM"> <Detail> <UserID></UserID>
1
3606
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by version 2 of XSLT processor based on some condition. Q) How and where shall I write logic or import desirable XSLT on the Fly ? Q) When we call AAA.XSLT then it will be processed by XSLT Processor 1
8
2167
by: Maciej Wegorkiewicz | last post by:
Hi, I have small experience in XSLT processing and I have a problem which I cannot solve. Can you look at it? I have an input file containing info about bank accounts like this: (...) <acc id="1"> <balance>100</balance>
12
3240
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation (xml->html) doen't happen! I have XSLT files for this, they work, I mean when I put the output of the app as an XML file on some server, and make it use the XSLT files to transform into HTML, it works, I get a HTML page.
7
2872
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID parameter to the XSLT stylesheet XsltArgumentList xsltArgList = new XsltArgumentList(); xsltArgList.AddParam("pmID", "", pmID); xmlItems.TransformArgumentList = xsltArgList;
1
2745
by: Nick | last post by:
I am working on a website for a client and one of their requirements was to have a mailing list. I decided to XSLT to transform "templates" to HTML so that editing was very easy and less time consuming. I keep getting the following error when I submit my email to their site. System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'ext:MailingList'. at...
18
2090
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to look up what each feature depends on and gerenate a text file. For example, in the following file, I would like to find out feature A depends on A1 and A2 and feature B depends on B1 and B2. And write that to a text file.
2
22780
jkmyoung
by: jkmyoung | last post by:
Here's a short list of useful xslt general tricks that aren't taught at w3schools. Attribute Value Template Official W3C explanation and example This is when you want to put dynamic values in the attribute of an element. Instead of using the <xsl:attribute> element, you can simply place the xpath in the attribute itself. The most common usage of this is in creating hyperlinks.
1
5712
by: Sandeep Singh | last post by:
Hi, How to do group by in XSLT ? I tried on the following codes: <files> <file name="swablr.eps" size="4313" project="mars"/> <file name="batboy.wks" size="424" project="neptune"/> <file name="potrzebie.dbf" size="1102" project="jupiter"/>
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.