[oXygen-user] Unable to print an element's value

Bradley, Peter
Wed Sep 10 06:15:03 CDT 2008


Hi George,

Yes, sorry.  It was bad data.  I've posted to the list saying so.  You
must have replied before it appeared.

Thanks


Peter


-----Original Message-----
From: George Cristian Bina [mailto:] 
Sent: 10 September 2008 10:47
To: Bradley, Peter
Cc: ; Stillman, David; Leonard, David J.
Subject: Re: [oXygen-user] Unable to print an element's value

Hi Peter,

I cannot reproduce the problem using your sample data. For example the 
following stylesheet
<?xml version="1.0"?>
<xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
     <xsl:output indent="yes"/>

     <xsl:template match="/">
         <xsl:for-each select="Instance">
             <Instance>
                 <NUMHUS>
                     <xsl:value-of select="NUMHUS/text()"/>
                 </NUMHUS>
                 <REDUCEDI>
                     <xsl:attribute name="codeListAgencyName">
                         <xsl:text>HESA</xsl:text>
                     </xsl:attribute>
                     <xsl:attribute name="codeListName">
                         <xsl:text>REDUCEDI</xsl:text>
                     </xsl:attribute>
                     <xsl:attribute name="languageID">
                         <xsl:text>en</xsl:text>
                     </xsl:attribute>
                     <xsl:value-of select="REDUCEDI/text()"/>
                 </REDUCEDI>
                 <COURSEID>
                     <xsl:value-of select="COURSEID/text()"/>
                 </COURSEID>
             </Instance>
             </xsl:for-each>
     </xsl:template>
</xsl:stylesheet>

applied on

<?xml version="1.0" encoding="UTF-8"?>
<Instance>
     <NUMHUS>000001075369710892  </NUMHUS>
     <personal_id>02002538</personal_id>
     <REDUCEDI>00</REDUCEDI>
     <COURSEID>62105201                      </COURSEID>
</Instance>

gives with Saxon 6.5 the following result

<?xml version="1.0" encoding="utf-8"?>
<Instance>
    <NUMHUS>000001075369710892  </NUMHUS>
    <REDUCEDI codeListAgencyName="HESA" codeListName="REDUCEDI" 
languageID="en">00</REDUCEDI>
    <COURSEID>62105201                      </COURSEID>
</Instance>

If you can send us a sample that we can reproduce the problem with then 
we can say more about that.

You may try also the XSLT debugger in oXygen, that may help you identify

the issue. After you run the transformation in the debugger you can 
click on the REDUCEDI element in the output and that will locate the 
source code that generates it. Place a brakepoint there, run the 
transformation with the Run command (Run to end skips brakepoints) and 
that should get you to the moment the REDUCEDI element is output. You 
can see the current Instance and eventually enter the REDUCEDI/text() 
expression in the XWatch view to see what that evaluates to in the 
context of the current instance.

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Bradley, Peter wrote:
> Hi,
> 
>  
> 
> I've encountered some behaviour that I can't understand in a 
> transformation that I'm currently engaged on.  The transformations are

> all pretty simple and follow the same pattern, but with just a few of 
> them I'm getting odd results where the element text is not being
output.
> 
>  
> 
> For example, in one case I have the following xsl:
> 
>  
> 
> ...
> 
> ...
> 
> <!-- Instance -->
> <xsl:for-each select="Instance">
>   <Instance>
>     <NUMHUS>
>       <xsl:value-of select="NUMHUS/text()"/>
>     </NUMHUS>
>     <REDUCEDI>
>       <xsl:attribute name="codeListAgencyName">
>         <xsl:text>HESA</xsl:text>
>       </xsl:attribute>
>       <xsl:attribute name="codeListName">
>         <xsl:text>REDUCEDI</xsl:text>
>       </xsl:attribute>
>       <xsl:attribute name="languageID">
>         <xsl:text>en</xsl:text>
>       </xsl:attribute>
>       <xsl:value-of select="REDUCEDI/text()"/>
>     </REDUCEDI>
>     <COURSEID>
>       <xsl:value-of select="COURSEID/text()"/>
>     </COURSEID>
> ...
> 
> The source document has the following:
> 
>  
> 
> <Instance>
>   <NUMHUS>000001075369710892  </NUMHUS>
>   <personal_id>02002538</personal_id>
>   <REDUCEDI>00</REDUCEDI>
> 
> ...
>   <COURSEID>62105201                      </COURSEID>
> 
> ...
> 
>  
> 
> (Note that <personal_id> is not transferred to the output document)
> 
>  
> 
> The destination document gives:
> 
>  
> 
> <Instance>
>   <NUMHUS>000001070027710892  </NUMHUS>
>   <REDUCEDI codeListAgencyName="HESA" codeListName="REDUCEDI" 
> languageID="en"/>
>   <COURSEID>53705101                      </COURSEID>
>   ...
> 
>  
> 
> My problem is the <REDUCEDI> element.  I don't understand why it
hasn't 
> taken the text '00' into the destination document as I was expecting.
> 
>  
> 
> I've got what I take to be the same problem elsewhere, so I'm hoping 
> that solving it here will give the solution elsewhere as well.
> 
>  
> 
> Thanks in advance
> 
>  
> 
>  
> 
> Peter
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user



More information about the oXygen-user mailing list