Solved

XSL stylesheet

Posted on 2008-06-25
4
633 Views
Last Modified: 2013-11-18
Am trying to create a template for the font-style heading 1, but when i try to open the doc generated via the xsl style sheet it gives an error... The column specified is the "paragraph" column but it looks ok to me. what am i doing wrong?

<xsl:template match="@font-style">
<xsl:if test=".='heading 1'"><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><wx:uiName wx:val="Heading 1"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:rsid w:val="00AE7E57"/><w:pPr><w:pStyle w:val="Heading1"/><w:keepNext/><w:spacing w:before="240" w:after="60"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/><wx:font wx:val="Arial"/><w:b/><w:b-cs/><w:kern w:val="32"/><w:sz w:val="32"/><w:sz-cs w:val="32"/></w:rPr></w:style></xsl:if>
</xsl:template>

Open in new window

0
Comment
Question by:babeBina
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:jimtech
ID: 21864243
I am a programmer but not that familiar with this language, you might want to check these links to see if they have the information you need:
http://www.php.net/manual/en/book.xsl.php
http://www.w3.org/Style/XSL/
http://www.w3schools.com/xsl/
0
 
LVL 10

Expert Comment

by:margajet24
ID: 21866262
give more details please..
0
 
LVL 11

Accepted Solution

by:
kmartin7 earned 500 total points
ID: 21866422
You are trying to match at attribute instead of an element. You must match an element name in your template match. So to correct your template, you must match the element(s) that contain the @font-style attributes, the perform the conditionality. For instance, if the font-style attribute that contains the value "heading 1" exists in a "p" element, then the following will work:

<xsl:template match="p">
            <xsl:if test="@font-style='heading 1'">
            ... do whatever here ...
                                          </xsl:if>
</xsl:template>

HTH,

kmartin7
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question