• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in HTML to Formatting Objects

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In my DOM (Document) object, I have an element called bodyHeader1 and its value is <b><i>Overview</i></b>. In my XSL, I am formatting HTML tags into FO thru <xsl:apply-templates select="bodyHeader1" />

For example If the node is b, then call b matching template as below.

<xsl:template match="b">
<fo:inline font-weight="bold">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>

But what is happening is transformer transforms these angle brackets (<,>) into (&lt; &gt;) which leads to not matching the respective template and apply formatting objects. I came to know this is happening by producing FO file.

I have used HTML to Formatting Objects (FO) conversion guide
link:http://www.ibm.com/developerworks/library/x-xslfo2app/

How would I accomplish matching the respective template and apply formatting objects?

Thanks in advance.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ramkumar rengarajan wrote:In my DOM (Document) object, I have an element called bodyHeader1 and its value is <b><i>Overview</i></b>.

But what is happening is transformer transforms these angle brackets (<,>) into (&lt; &gt;)...



I'm not sure what you mean by "its value is...". Elements don't have values in XML. But a lot of people seem to use that terminology to mean "It has a single text node as a child and the value of that text node is..."

If that's what you mean, then the transformer is not converting those angle brackets to XML escapes. They were that way already before the parser got them. Either that, or they were in a CDATA section.

If you want that string to be treated as XML markup, then you should put it in the document as markup. If you put it in the document as text (which is what you might be saying) then the parser and transformer will treat it as text. The only way to make it look like markup is to use the disable-output-escaping attribute which occurs on some of the XSLT elements, but even that just writes it to the output as markup instead of escaping it as text. You still can't deal with it inside your XSLT as markup.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic