[ 
https://issues.apache.org/jira/browse/XALANJ-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17734357#comment-17734357
 ] 

Joe Kesselman edited comment on XALANJ-2474 at 6/19/23 8:17 PM:
----------------------------------------------------------------

Since in this case the document() call is being used to retrieve the same file 
as the input document, I decided to test replacing 
{code:java}
document($global.result)/{code}
with 
{code:java}
/{code}
The results are indeed different. Start of a diff between the two outputs, with 
< being with the *document()* call and > being with {*}/{*}:
{code:java}
1,2c1,2
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXABB0'
---
> file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt.simplified;
>  Line #101; Column #31;
>                                       /*/NetworkElement[Name='FTMYFLXABB0'
30,32c30,31
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXA02W'
---
> file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt.simplified;
>  Line #101; Column #31;
>                                       /*/NetworkElement[Name='FTMYFLXA02W'
60,152c59,60
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXABB0'
<                and Description='Ascend CBX 500'
<                and Id='1000000010'
<                and CreationTime=''
<                and LastUpdatedTime=''
<                and Enabled='EnableType.Enabled'
<                and ManagementAddress=''
<                and LastDiscovered='2002-05-11 21:21:56.0'
<                and FirstDiscoveryFailure=''
<                and LastDiscoveryFailure=''
<                and NumDiscoveryFailures='0'
<                and 
NemClass='com.comanage.truesource.nem.naviscore.NavisCoreNem'
<                and ContactAddress='Ipv4Address:172.20.254.1'
<                and Vendor='Lucent'
<                and Model='CBX 500'
<                and HardwareVersion='03'
<                and SoftwareVersion='04.02.00.00'
<                and SerialNumber=''
<                and Supplier=''
<                and PartNumber=''
<                and Clei=''
<                and Label=''
<                and Credibility='CredibilityLevel.Medium'
<                and SlotCount='4'
<                and AvailableSlotCount='-1'
<
<                                                       and 
HostAgent[@xlink:href='nil'] and HostSystem[@xlink:href='nil'] and 
Host[@xlink:href='nil']]
<
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.{code}
The question is, is the difference because the document() call is actually 
delivering different content, or because the stylesheet is unintentionally 
relying upon identity (eg via id()) rather than content equality? The latter 
could explain why behavior changed between versions, if the way input documents 
are being cached changed.

 


was (Author: JIRAUSER285361):
Since in this case the document() call is being used to retrieve the same file 
as the input document, I decided to test replacing 
{code:java}
document($global.result)/{code}
with 
{code:java}
/{code}
The results are indeed different. Start of a diff between the two outputs, with 
< being with the *document()* call and > being with {*}/{*}:
{code:java}
1,2c1,2
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXABB0'
---
> file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt.simplified;
>  Line #101; Column #31;
>                                       /*/NetworkElement[Name='FTMYFLXABB0'
30,32c30,31
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXA02W'
---
> file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt.simplified;
>  Line #101; Column #31;
>                                       /*/NetworkElement[Name='FTMYFLXA02W'
60,152c59,60
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#101; Column #31;
<                                       
document('jira-xalanj-2474.xml')/*/NetworkElement[Name='FTMYFLXABB0'
<                and Description='Ascend CBX 500'
<                and Id='1000000010'
<                and CreationTime=''
<                and LastUpdatedTime=''
<                and Enabled='EnableType.Enabled'
<                and ManagementAddress=''
<                and LastDiscovered='2002-05-11 21:21:56.0'
<                and FirstDiscoveryFailure=''
<                and LastDiscoveryFailure=''
<                and NumDiscoveryFailures='0'
<                and 
NemClass='com.comanage.truesource.nem.naviscore.NavisCoreNem'
<                and ContactAddress='Ipv4Address:172.20.254.1'
<                and Vendor='Lucent'
<                and Model='CBX 500'
<                and HardwareVersion='03'
<                and SoftwareVersion='04.02.00.00'
<                and SerialNumber=''
<                and Supplier=''
<                and PartNumber=''
<                and Clei=''
<                and Label=''
<                and Credibility='CredibilityLevel.Medium'
<                and SlotCount='4'
<                and AvailableSlotCount='-1'
<
<                                                       and 
HostAgent[@xlink:href='nil'] and HostSystem[@xlink:href='nil'] and 
Host[@xlink:href='nil']]
<
< file:///home/keshlam/git/xalan-test/tests/jira/jira-xalanj-2474.xslt; Line 
#117; Column #35; yep.Two sets are not equivalent.{code}
The question is, is the difference because the document() call is actually 
delivering different content, or because the stylesheet is unintentionally 
relying upon identity rather than content equality? The latter could explain 
why behavior changed between versions, if the way input documents are being 
cached changed.

 

> document() function returns different values with xalan version 2.7.1. and 
> 2.6.0.
> ---------------------------------------------------------------------------------
>
>                 Key: XALANJ-2474
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2474
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>    Affects Versions: 2.7.1
>         Environment: Windows, using command line transform of xalan.
>            Reporter: pavankumar
>            Priority: Blocker
>         Attachments: input.xml, transform.xslt
>
>
> xslt document() function returns duplicate and improper values with 2.7.1. 
> where as the same code works with 2.6.0.
> Info : document and evaluate functions are used in xslt and there were other 
> slightly inconsistent behaviour also for 2 versions in terms of syntax and 
> all. and xlink:href is getting nil values in 2.7.1
> document result contained by path variable line 93 - transform.xsl is the one 
> causing problem. and and when printed, it outputs different values with 
> different versions.
> Executed using xalan CLI
> C:\>java org.apache.xalan.xslt.Process -IN "C:\input.xml" -XSL 
> "C:\transform.xslt" -OUT new.html -PARAM global.result input.xml
> attaching the files.transform.xslt and input.xml



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to