[ 
http://issues.apache.org/jira/browse/XALANJ-2180?page=comments#action_12317634 
] 

dcaveney commented on XALANJ-2180:
----------------------------------

I removed the <sort> element from the sample stylesheet and got the following 
output:

Priority = 1Priority = 2

I don't know why I get a result and the previous commenter (ie. Mr. Bertoni) 
doesn't. Could it have to do with factory builder settings or something? I 
wrote the applet quite a while ago and originally used the Java "endorsed 
mechanism" with hard-coded implementation classes and everything worked ok at 
that time.

I replaced the <for-each> element from the sample stylesheet with:

<for-each select="xalan:nodeset($foo)/bar"> 

...and that produced an empty result. Is it possible that when it was reported 
that "...if you remove the xsl:sort child from the xsl:for-each. That also 
produces no output. " that the xpath had already had :

"xalan:nodeset($foo)/xsl:bar" 

...replaced with:

"xalan:nodeset($foo)/bar"

...which produces no output? I'm still a little confused with respect to 
namespaces...can you show me a revised version of the sample stylesheet that 
produces: "Priority = 2Priority = 1" (ie. the entire stylesheet so I can 
"cut-and-paste" into my applet)? Thanks.


> xsl:sort does not work with nodeset variables
> ---------------------------------------------
>
>          Key: XALANJ-2180
>          URL: http://issues.apache.org/jira/browse/XALANJ-2180
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan
>     Versions: CurrentCVS
>  Environment: Java Plug-in 1.5.0_04 creates DocumentBuilderFactory, 
> TransformerFactory, Transformer objects etc. using newInstance() methods.
>     Reporter: dcaveney
>  Attachments: sortbug.xsl
>
> The symptoms I'm seeing are the same as in issue #Xalanj-860 but I can't use 
> the same workaround. A template creates some elements within a variable, and 
> then tries to sort the resulting nodeset. The following example produces no 
> output:
> <?xml version="1.0" encoding="UTF-8"?>
> <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"; 
> xmlns:xalan="http://xml.apache.org/xalan"; 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
>   <output method="text"/>
>   <template match="/">
>     <variable name="foo">
>       <xsl:element name="bar">
>          <xsl:attribute name="priority">1</xsl:attribute>
>         <text>Priority = 1</text>
>       </xsl:element>
>       <xsl:element name="bar">
>         <xsl:attribute name="priority">2</xsl:attribute>
>         <text>Priority = 2</text>
>       </xsl:element>
>     </variable>
>     <for-each select="xalan:nodeset($foo)/xsl:bar">
>       <xsl:sort data-type="number" order="descending" select="@priority"/>
>       <value-of select="text()"/>
>     </for-each>
>   </template>
> </stylesheet>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to