简体   繁体   中英

XSL-FO | FO: Tags are being removed

I'm currently using XSL for a work project and I'm facing an issue.

I'm trying to read values for a database that look like this:

<fo:block font-weight='bold>hello</fo:block>

and it seems that XSL is stripping the <fo:block> element because it gives me text only ( I only see Hello, not in bold, and it doesn't behave like a block element ). I feel like, somehow, that XSL interprets the value read from the DB as a string, and strip of the <fo> tags, leaving my with text only.

Any idea what could be done in order that my styling get preserved?

( Obviously this example have been simplified, the text to be displayed is longer than that )

EDIT : Self answered for future references

根据您要更改的注释将<xsl:value-of select='/fulfill-list/ticket-list/list-item/eventTicketConte‌​nt/xmlTicketContent/‌​ticketdescription'/>更改为<xsl:copy-of select='/fulfill-list/ticket-list/list-item/eventTicketConte‌​nt/xmlTicketContent/‌​ticketdescription'/> (或<xsl:copy-of select='/fulfill-list/ticket-list/list-item/eventTicketConte‌​nt/xmlTicketContent/‌​ticketdescription/node()'/> )。

As first i wanted to thanks you all to have taken the time to answer me. I'm very very very glad to see SO community is such strong.

I have solved my problem this way :

 <xsl:for-each select="/fulfill-list/ticket-list/list-item/eventTicketContent/xmlTicketContent/ticketdescription/node()">
      <xsl:copy-of select="child::node()" />
    </xsl:for-each>

I don't really know what happened beneath the hood and why the <fo> tags were removed, but they were. Looping through all of them and using <xsl:copy-of> did the trick.

Once again, a big thanks to y'all !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM