1 Replies - 422 Views - Last Post: 21 July 2012 - 12:26 AM

#1 Lazy Vulpes  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 02-May 12

xslt in conjunction with xsl-fo or css

Posted 20 July 2012 - 10:11 PM

First of all I would like to make sure that I have the correct understanding of the difference between transformation and formatting. Transformation is adding e.g. a p tag around your text? Formatting is e.g. making the text red?

In my current cms project I've decided to have static content saved in xml files.

e.g.
<welcome_text>
Hello and welcome to LazyVulpes.com Here you can do stuff.
</welcome_text>



Implementing this text is fairly easy using xslt, but what if I want "LazyVulpes.com" to be a orange link?

Should my xml be something like this?
<welcome_text>
Hello and welcome to <link location="http://www.lazyvulpes.com/" color="orange">LazyVulpes.com</link> Here you can do stuff.
</welcome_text>



And if so, how do I add the a element and use xsl-fo to make the link text orange?

Also, what if I just want it to be orange and not a link, can I do this without adding any tags around it? If a tag is always required to add extra styling to a inline text, why use xsl-fo at all?

Is there any reason to use both xsl-fo and css? xsl-fo for formatting and css for positioning?

This post has been edited by Lazy Vulpes: 20 July 2012 - 10:21 PM


Is This A Good Question/Topic? 0
  • +

Replies To: xslt in conjunction with xsl-fo or css

#2 Lazy Vulpes  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 02-May 12

Re: xslt in conjunction with xsl-fo or css

Posted 21 July 2012 - 12:26 AM

I'm starting to realize that this is more a question about xpath functions.. I think I need to use

contains(string1,string2)
substring-before(string1,string2)
substring-after(string1,string2)

But I'm really unsure on how to use these..

All in all I want the outputs like this.
<p>some <b>text</b></p>


from a XML source like this
<text>some <bold>text</bold></text>

or this
<text>some [b]text[/b]</text>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1