开发者

strange pdf generator issue

Is there a problem with xml tags that have a dash in them??

I am trying to generate a pdf from and xsl and an xml..

I have the following for example:

<car>
  <name>toyotoa</name>
  <color-value>green</color-value>
</car>

In my xsl I have something like

<fo:inline font-weight="bold"> <xsl:value-of select="name" /> </fo:inline>

this prints the correct value in the pdf

if I try to print the second tag (color-value) .. nothing is printed in the pdf.. as if it can't read that node.

<fo:inline font-weight="bold"> <xsl:value-of select="color-value" /> </fo:inline>

this returns nothing..

However when I do the test in eclipse and run the xsl as xsl tranformation .. the output file correctly displays both values. O开发者_运维问答nly in the pdf does it only display the first one.

Any clues on what might be going on?

EDIT Can I somehow debug by trying to list all the values of the tags under the car node? maybe that will give me some hints. ?

EDIT 2 Looks like the problem occurs at the velocity template not the xls

EDIT 3 found the solution after checking the method called by the velocity template for generating the value of car-color.. apparently there was an inheritence isssue and the value was not even inserted in the xml for the tranformation.


you need to close the select attribute in the second example.


I'm sorry if this is not a complete answer, but it seems to me, that escaping might be the issue here. The XSLT standard seems to suggest, that the value of the select attribute is an expression, that might see the dash as a subtraction (as in value of the element color minus the value of the element value). I have no idea though, how to fix this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜