Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XSL stylesheet

Posted on 2008-06-25
4
Medium Priority
?
642 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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 …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

618 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