[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] handling of xsl-Variable in formatting text

Subject: Re: [xsl] handling of xsl-Variable in formatting text
From: "B Tommie Usdin btusdin@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Apr 2016 14:15:16 -0000

I suggest that you make the time to mock up a small sample source document
that demonstrates the problem. It does not need to contain personal data; make
up some data about a cartoon character.

As the list guidelines say:

> b& you will improve the chances that you will receive prompt and helpful
responses by:
> 	b" Asking questions specific enough that answers are possible. Describe
what you are trying to do, how you approached it, what happened, and why you
donbt like the result you got. Donbt simply say bit gave me an errorb;
paste in the error message (someone else can probably make sense of it).
> 	b" Illustrating your question with a demonstration of the problem.
Well-composed questions frequently include a small XML sample, an XSLT
stylesheet, the results received, and the result that was desired b all in
miniature, to make it comprehensible to readers new to your problem. (It is
also not uncommon to discover what a problem actually is in the process of
reducing it to an illustrative version.)

It is not reasonable to expect help from the list if you do not provide the
information necessary to analyze the problem.

b Tommie

> On Apr 15, 2016, at 9:30 AM, Dirk Naujoks naujoks@xxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Thanks for your quick reply.
> the problem with the source and the working document is that I am not to
familiar with XSL and so I imagine I am not able to create such a document and
the xml-source of the data contains personal data.
> So maybe I try to explain the task i have to solve.
> I want to format a block-objekt depending on a condition either 'bold' or
> My try was using the following code
> <fo:block span="none" font-family="OfficinaSansLT" font-size="{$schrifta}"
font-weight="{$outline}" text-align="start">
> The variable "schrifta" can be set either to 20pt or what other value you
like to and it is evaluated.
> The variable "outline" i set according to my first post doesnt seem to be
evaluated in this above code the text is allways "normal"
> But if i use the code
> <xsl:value-of disable-output-escaping="no" select="$outline" />
> I get the right output either "bold" or "normal".
> So I am a little mixed up. But I hope this description is clear enough to
see what my problem is.
> (because I am no nativ english-speaker it may be a little hard to find out
what I mean)
> Thanks for your Answers.
> Am 15.04.2016 um 14:42 schrieb Michael Kay mike@xxxxxxxxxxxx:
>> It would help to give a complete executable stylesheet (preferably with
irrelevant detail removed) and a source document, plus expected output, so
people can run it for themselves and debug it for you. As it is, we can only
stare at the code - you haven't even told us what the failure symptoms are
("it doesn't work" isn't very helpful...)
>> One thing I would suggest it to cut out the whitespace in the variable
value, which at best is unnecessary and at worst could cause downstream
processing to produce the wrong results:
>>>           <xsl:choose>
>>>                <xsl:when test="@pnr != '7000'">normal</xsl:when>
>>>                <xsl:otherwise>bold</xsl:otherwise>
>>>            </xsl:choose>
>> Not being able to see a source document, I don't know if it's relevant, but
you should be aware of the exact meaning of "@pnr != '7000'" - it means "if
the pnr attribute exists and has a value other than '7000'. Writing "not(@pnr
= '7000')" has a different meaning when the attribute is absent.
>> Michael Kay
>> Saxonica

B. Tommie Usdin                        mailto:btusdin@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
Mulberry Technologies: A Consultancy Specializing in XML and SGML

Current Thread