Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2006, 09:08 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default transformer does not detect some tags in my srcXML

Hello, everyone,

I wrote a large XSL file 2 months ago and now I found a bug in it. It seems that my transformer doesn't see that the source xml file has some tags and does not produce needed output.

When I have this source:


<root>
...
<biography>
  <bg>
    <i fname="#1043;#1077;#1086;#1088;#1075;#1080;" ind_id="34" lname="#1063;o#1083;#1072;#1082;#1086;#1074;" egn="7509234443" email="[email protected]">
       <deg_rank/>
    </i>
  </bg>
  <en>
    <i email="[email protected]" ind_id="34" fname="Georgi" lname="Cholakov" birthdate="23 Sep 1975">
      <deg_rank/>
    </i>
  </en>
</biography>
...
</root>


And this XSL piece:
<fo:block font-size="11pt" font-family="Arial" margin-left="3pt">
    <xsl:for-each select="/root/biography/bg/i/deg_rank[@type != 'P']">
        <xsl:sort select="@type"/>
        <xsl:value-of select="@name"/>
        <xsl:if test="position() != last()">, </xsl:if>
    </xsl:for-each>
    <xsl:text> </xsl:text>
    <xsl:value-of select="/root/biography/bg/i[1]/@lname"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="/root/biography/bg/i[1]/@fname"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="/root/biography/bg/i[1]/@mname"/>
</fo:block>

I do not get the output, but when I have this source:

<biography>
  <bg>
    <i fname="#1043;#1077;#1086;#1088;#1075;#1080;" ind_id="34" lname="#1063;o#1083;#1072;#1082;#1086;#1074;" egn="7509234443" email="[email protected]">
      <deg_rank type="R" year="1998" name="1st rank" authors="auth"/>
    </i>
  </bg>
  <en>
    <i email="[email protected]" ind_id="34" fname="Georgi" lname="Cholakov" birthdate="23 Sep 1975">
      <deg_rank type="R" year="1998" name="1st rank en" authors="auth"/>
    </i>
  </en>
</biography>

It produces the output I need. The difference is only that the <deg_rank> tag has attributes in the second case. Why is all that? All myh paths are correct, because in the second cae it works.

Also with the first source a template is not working:
<xsl:template match="root/biography/bg/i | root/biography/en/i">

If somebody can spend a little more time I could send him/her both the source and the XSL which are a bit long and complex. For just two months I have forgotten much of this stuff, any help would be appreciated.







Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT 2.0 Transformer for Java albinjoseph XSLT 1 March 2nd, 2007 04:05 AM
Help detect error elania Beginning PHP 4 February 14th, 2005 09:55 PM
Transformer.transform throws DOM006 error saladin XML 0 October 13th, 2004 08:53 AM
Exception in generating a new transformer neta XSLT 5 September 23rd, 2004 04:51 AM
Flash detect Adam H-W Javascript 4 October 30th, 2003 08:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.