Details
-
Type:
Task
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 4.0.1
-
Fix Version/s: 4.0.1
-
Component/s: None
-
Labels:None
-
Request Controller:Please Select
-
External Supervisor:Please select
-
Executing Programmer:Please select
Description
I have uploaded 2 customer layouts and the xml input file to Scandftp.
- Folder: /dtdiesel/xslfast/
- Scania_4-Serie_2-1_19-03-2010_rechts_2.xsf
- Scania_4-Serie_2-1_24-03-2010_links.xsf
- xml input file: Scania_4-Serie_2.1_FINAL_19032010_mod.zip
Task:
The "Ref"-numbers in the index should be ordered by the last character ("S" / "X").
Customer tried following for "tmpOEM" and "tempDIN1":
CompetitiveInformation[Competitor/CompetitorID='SCANIA' and not(contains (translate(CompetitorProductID,'ABCDEFGHIJKLMNOPQR TUVW YZabcdefghijklmnopqrstuvwxyz','XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'),'X'))]
In the exported PDF only the numbers with a "S" are show, the ones with the "X" are not shown.
Also the sorting is wrong.
In your XPath expression you're filtering out every CompetitiveInformation node where CompetitorProductID contains any other letter but S by replacing every letter but S with a string of X's and use the result only if it contains no X's in it. So it's quite obvious there'll be no values with X's in them. Why not test whether CompetitorProductID contains an S or an X by just using something like "contains(CompetitorProductID, 'S') or contains(CompetitorProductID, 'X')"?
Concerning the sorting, the problem is you selected numeric sorting for text data (a string that ends with an S is not numeric since it contains a letter). So you should either use textual sorting, or use an XPath expression that removes letters from the value, e.g. translate(CompetitorProductID, 'SX', '').