Click here to Skip to main content
15,559,819 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi i have a xsl that i want to recognize some control codes in the data

the control codes are for example are STA and ETA. which have specific OP codes in the software i need to recognize it.

see below how i need it to come out
{Version 6.0}
100		degrees	metres	millibars	celsius
//
02		Resect		001			400013.88722989	799990.52172517	19.49997310
07		K		1000		ES	180.00000000	90.00000000	20.00014131
61		STA
07		K		1001		ES	180.04600000	90.00004440	20.00014131
62		ETA
instead i am getting these results which is not what i need
07		K	1	2001		STA	160.00000000	90.00000000	15.00010598
07		K	1	2002		ETA	180.00000000	90.00000000	16.00011305

i also need it to see when a code is followed by a second code and assign an opcode accordingly

please post any answers in comments section rather than editing post

any help would be appreciated

What I have tried:

XSL
  1  <xsl:stylesheet version="1.0" 
  2  ="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  3  
  4  <xsl:output method="text" omit-xml-declaration="yes" encoding="ISO-8859-1">
  5  
  6  
  7  <xsl:variable name="DecPt" select="'.'">    
  8  <xsl:variable name="GroupSep" select="','"> 
  9  
 10  <xsl:decimal-format name="Standard" 
 11  ="" decimal-separator="." grouping-separator="," infinity="Infinity" minus-sign="-" nan="" percent="%" per-mille="߮" zero-digit="0" digit="#" pattern-separator=";">
 12  
 13  <xsl:variable name="DecPl0" select="'#0'">
 14  <xsl:variable name="DecPl1" select="concat('#0', $DecPt, '0')">
 15  <xsl:variable name="DecPl2" select="concat('#0', $DecPt, '00')">
 16  <xsl:variable name="DecPl3" select="concat('#0', $DecPt, '000')">
 17  <xsl:variable name="DecPl4" select="concat('#0', $DecPt, '0000')">
 18  <xsl:variable name="DecPl5" select="concat('#0', $DecPt, '00000')">
 19  <xsl:variable name="DecPl6" select="concat('#0', $DecPt, '000000')">
 20  <xsl:variable name="DecPl8" select="concat('#0', $DecPt, '00000000')">
 21  
 22  <xsl:variable name="fileExt" select="'fld'">
 23  
 24  
 25  
 26  
 27  
 28  
 29  
 30  
 31  
 32  
 33  
 34  
 35  
 36  
 37  
 38  
 39  
 40  
 41  
 42  
 43  
 44  
 45  
 46  
 47  
 48  
 49  
 50  
 51  
 52  
 53  
 54  
 55  
 56  <xsl:variable name="userField1" select="'copyAlphaNames|Assign alpha-numeric names as Named points|StringMenu|2|Yes|No'">
 57  <xsl:variable name="copyAlphaNames" select="'No'">  
 58  <xsl:variable name="userField2" select="'codePtTextSep|Character separating point code and point text|stringMenu|2|Space char|*'">
 59  <xsl:variable name="codePtTextSep" select="'Space char'">
 60  <xsl:variable name="userField3" select="'includeGNSSQCAsAttributes|Include GNSS QC details as point attributes|stringMenu|2|Yes|No'">
 61  <xsl:variable name="includeGNSSQCAsAttributes" select="'No'">
 62  <xsl:variable name="userField4" select="'includeDateTimeAsAttributes|Include date and time as point attributes|stringMenu|2|Yes|No'">
 63  <xsl:variable name="includeDateTimeAsAttributes" select="'No'">
 64  <xsl:variable name="userField5" select="'includeTargetInstDetailsAsAttributes|Include target and instrument details as point attributes|stringMenu|2|Yes|No'">
 65  <xsl:variable name="includeTargetInstDetailsAsAttributes" select="'No'">
 66  <xsl:variable name="userField6" select="'includeQCDetails|Output QC details to file as comments|stringMenu|2|Yes|No'">
 67  <xsl:variable name="includeQCDetails" select="'No'">
 68  
 69  <xsl:variable name="codePtTextSeparator">
 70    <xsl:choose>
 71      <xsl:when test="$codePtTextSep = 'Space char'"><xsl:value-of select="' '">
 72      <xsl:otherwise><xsl:value-of select="$codePtTextSep">
 73    
 74  
 75  
 76  <xsl:variable name="startArcCode">STA
 77  <xsl:variable name="endArcCode">ETA
 78  <xsl:variable name="closeCode">C
 79  <xsl:variable name="removeHtCode">RH
 80  
 81  
 82  <xsl:key name="tgtID-search" match="/JOBFile/FieldBook/TargetRecord" use="@ID">
 83  <xsl:key name="stnID-search" match="/JOBFile/FieldBook/StationRecord" use="@ID">
 84  <xsl:key name="atmosID-search" match="/JOBFile/FieldBook/AtmosphereRecord" use="@ID">
 85  <xsl:key name="bsID-search" match="/JOBFile/FieldBook/BackBearingRecord" use="@ID">
 86  <xsl:key name="ptFromStn-search" match="/JOBFile/FieldBook/PointRecord" use="StationID">
 87  <xsl:key name="instID-search" match="/JOBFile/FieldBook/InstrumentRecord" use="@ID">
 88  
 89  
 90  
 91  
 92  <xsl:variable name="DistUnit" select="/JOBFile/Environment/DisplaySettings/DistanceUnits">
 93  <xsl:variable name="AngleUnit" select="/JOBFile/Environment/DisplaySettings/AngleUnits">
 94  <xsl:variable name="CoordOrder" select="/JOBFile/Environment/DisplaySettings/CoordinateOrder">
 95  <xsl:variable name="TempUnit" select="/JOBFile/Environment/DisplaySettings/TemperatureUnits">
 96  <xsl:variable name="PressUnit" select="/JOBFile/Environment/DisplaySettings/PressureUnits">
 97  
 98  
 99  
100  <xsl:variable name="DistConvFactor">
101    <xsl:choose>
102      <xsl:when test="$DistUnit='Metres'">1.0
103      <xsl:when test="$DistUnit='InternationalFeet'">3.280839895
104      <xsl:when test="$DistUnit='USSurveyFeet'">3.2808333333357
105      <xsl:otherwise>1.0
106    
107  
108  
109  
110  
111  <xsl:variable name="AngleConvFactor">
112    <xsl:choose>
113      <xsl:when test="$AngleUnit='DMSDegrees'">1.0
114      <xsl:when test="$AngleUnit='Gons'">1.111111111111
115      <xsl:when test="$AngleUnit='Mils'">17.77777777777
116      <xsl:otherwise>1.0
117    
118  
119  
120  
121  <xsl:variable name="NECoords">
122    <xsl:choose>
123      <xsl:when test="$CoordOrder='North-East-Elevation'">true
124      <xsl:when test="$CoordOrder='X-Y-Z'">true
125      <xsl:otherwise>false
126    
127  
128  
129  
130  
131  <xsl:variable name="PressConvFactor">
132    <xsl:choose>
133      <xsl:when test="$PressUnit='MilliBar'">1.0
134      <xsl:when test="$PressUnit='InchHg'">0.029529921
135      <xsl:when test="$PressUnit='mmHg'">0.75006
136      <xsl:otherwise>1.0
137    
138  
139  
140  
141  
142  
143  
144  <xsl:template match="/">
145  
146    <xsl:text>{Version 6.0}
147    <xsl:call-template name="NewLine">
148  
149    
150    
151    <xsl:text>100		degrees	metres	millibars	celsius
152    <xsl:call-template name="NewLine">
153    
154    <xsl:text>//
155    <xsl:call-template name="NewLine">
156  
157    
158    <xsl:apply-templates select="JOBFile/FieldBook">
159  
160  
161  
162  
163  
164  
165  
166  <xsl:template match="FieldBook">
167  
168    
169    <xsl:apply-templates select="*[((name() = 'PointRecord') and (Deleted = 'false') and (Classification != 'MTA')) or
170                                   (name() = 'StationRecord') or (name() = 'TargetRecord') or
171                                   (name() = 'NoteRecord')]">
172  
173    
174    <xsl:if test="$includeQCDetails = 'Yes'">
175      <xsl:variable name="SSeriesInst" select="count(/JOBFile/FieldBook/InstrumentRecord[(Type = 'TrimbleSSeries') or (Type = 'TrimbleVXandSSeries')])">
176      <xsl:variable name="RTKPoints" select="count(/JOBFile/FieldBook/PointRecord[Precision])">
177      <xsl:if test="($SSeriesInst > 0) or ($RTKPoints > 0)">
178        <xsl:call-template name="OutputQCDetails">
179          <xsl:with-param name="instRecCount" select="$SSeriesInst">
180          <xsl:with-param name="RTKPtCount" select="$RTKPoints">
181        
182      
183    
184  
185  
186  
187  
188  
189  
190  
191  <xsl:template match="StationRecord">
192  
193    <xsl:variable name="recID" select="@ID">
194    <xsl:variable name="obsCount" select="count(following-sibling::PointRecord[(StationID = $recID) and (Deleted = 'false')])">
195    
196    <xsl:if test="$obsCount != 0">  
197      
198      <xsl:variable name="stnName" select="StationName">
199      <xsl:for-each select="/JOBFile/Reductions/Point[Name = $stnName]">
200        <xsl:variable name="ptRec">
201          <xsl:element name="PointRecord">
202            <xsl:copy-of select="Name">
203            <xsl:copy-of select="Code">
204            <xsl:copy-of select="Grid">
205          
206        
207        <xsl:apply-templates select="msxsl:node-set($ptRec)/PointRecord">
208      
209  
210      <xsl:text>03		  
211  
212      
213      <xsl:for-each select="/JOBFile/Reductions/Point[Name = $stnName]">
214        <xsl:variable name="pointDesc">
215          <xsl:call-template name="PointDescriptionOutput">
216            <xsl:with-param name="skipStringOutput">true
217          
218        
219        <xsl:value-of select="msxsl:node-set($pointDesc)/ptDesc">
220      
221      
222      <xsl:variable name="instHt">
223        <xsl:choose>
224          <xsl:when test="string(number(TheodoliteHeight)) != 'NaN'">
225            <xsl:value-of select="TheodoliteHeight">
226          
227          <xsl:otherwise>0
228        
229      
230      <xsl:value-of select="format-number($instHt, $DecPl8, 'Standard')">
231      <xsl:call-template name="NewLine">
232  
233      
234      
235      
236      <xsl:if test="$includeTargetInstDetailsAsAttributes = 'Yes'">
237        
238        <xsl:for-each select="key('instID-search', InstrumentID)">
239          <xsl:variable name="instType">
240            <xsl:call-template name="InstrumentType">
241              <xsl:with-param name="type" select="Type">
242            
243          
244  
245          
246          <xsl:text>73		  
247          <xsl:text>Instrument
248          <xsl:text>	
249          <xsl:value-of select="$instType">
250          <xsl:value-of select="' '">
251          <xsl:value-of select="Model">
252          <xsl:call-template name="NewLine">
253  
254          <xsl:if test="Serial != ''">
255            <xsl:text>73		  
256            <xsl:text>Serial Number
257            <xsl:text>	
258            <xsl:value-of select="Serial">
259            <xsl:call-template name="NewLine">
260          
261        
262      
263  
264      
265      <xsl:if test="ScaleFactor != 1">
266        <xsl:text>09		  
267        <xsl:value-of select="format-number(ScaleFactor, $DecPl8, 'Standard')">
268        <xsl:call-template name="NewLine">
269      
270    
271  
272  
273  
274  
275  
276  
277  <xsl:template match="PointRecord">
278  
279    <xsl:choose>
280      <xsl:when test="Grid">
281        
282        <xsl:text>02		  
283        <xsl:variable name="pointDesc">
284          <xsl:call-template name="PointDescriptionOutput">
285            <xsl:with-param name="skipStringOutput">true
286          
287        
288        <xsl:value-of select="msxsl:node-set($pointDesc)/ptDesc">
289        
290        <xsl:value-of select="format-number(Grid/East, $DecPl8, 'Standard')">
291        <xsl:text>	        
292        
293        <xsl:value-of select="format-number(Grid/North, $DecPl8, 'Standard')">
294        <xsl:text>	        
295        
296        <xsl:value-of select="format-number(Grid/Elevation, $DecPl8, 'Standard')">
297        <xsl:call-template name="NewLine">
298  
299        <xsl:if test="msxsl:node-set($pointDesc)/controlCode != ''">
300          <xsl:call-template name="WriteControlCode">
301            <xsl:with-param name="controlCode" select="msxsl:node-set($pointDesc)/controlCode">
302            <xsl:with-param name="ptDesc" select="msxsl:node-set($pointDesc)/ptDesc">
303          
304        
305      
306      
307      <xsl:when test="ECEFDeltas or ECEF">  
308        
309        
310        
311        
312        <xsl:variable name="ptName" select="Name">
313        <xsl:variable name="ptCoords">
314          <xsl:choose>
315            <xsl:when test="count(/JOBFile/FieldBook/PointRecord[(Name = $ptName) and (Classification = 'Averaged') and (Deleted = 'false')]) != 0">
316              <xsl:for-each select="/JOBFile/FieldBook/PointRecord[(Name = $ptName) and (Classification = 'Averaged') and (Deleted = 'false')][last()]">
317                <north>
318                  <xsl:value-of select="ComputedGrid/North">
319                
320                <east>
321                  <xsl:value-of select="ComputedGrid/East">
322                
323                <elev>
324                  <xsl:value-of select="ComputedGrid/Elevation">
325                
326              
327            
328            <xsl:otherwise>
329              <north>
330                <xsl:value-of select="ComputedGrid/North">
331              
332              <east>
333                <xsl:value-of select="ComputedGrid/East">
334              
335              <elev>
336                <xsl:value-of select="ComputedGrid/Elevation">
337              
338            
339          
340        
341        <xsl:text>02		  
342        <xsl:variable name="pointDesc">
343          <xsl:call-template name="PointDescriptionOutput">
344        
345        <xsl:value-of select="msxsl:node-set($pointDesc)/ptDesc">
346        
347        <xsl:value-of select="format-number(msxsl:node-set($ptCoords)/east, $DecPl8, 'Standard')">
348        <xsl:text>	        
349        
350        <xsl:value-of select="format-number(msxsl:node-set($ptCoords)/north, $DecPl8, 'Standard')">
351        <xsl:text>	        
352        
353        <xsl:value-of select="format-number(msxsl:node-set($ptCoords)/elev, $DecPl8, 'Standard')">
354        <xsl:call-template name="NewLine">
355  
356        <xsl:if test="msxsl:node-set($pointDesc)/controlCode != ''">
357          <xsl:call-template name="WriteControlCode">
358            <xsl:with-param name="controlCode" select="msxsl:node-set($pointDesc)/controlCode">
359            <xsl:with-param name="ptDesc" select="msxsl:node-set($pointDesc)/ptDesc">
360          
361        
362      
363  
364      <xsl:when test="Circle">
365        
366        <xsl:variable name="firstBacksight">
367          <xsl:if test="Classification = 'BackSight'">
368            <xsl:variable name="stnID" select="StationID">
369            <xsl:if test="count(preceding-sibling::PointRecord[(StationID = $stnID) and (Classification = 'BackSight')]) = 0">true
370          
371        
372  
373        <xsl:choose>
374          <xsl:when test="(Classification = 'BackSight') and ($firstBacksight = 'true')">
375            <xsl:text>04		  
376            <xsl:variable name="pointDesc">
377              <xsl:call-template name="PointDescriptionOutput">
378                <xsl:with-param name="backsightObs">true
379              
380            
381            <xsl:value-of select="msxsl:node-set($pointDesc)/ptDesc">
382            <xsl:call-template name="CircleObservationOutput">
383              <xsl:with-param name="skipNewLine">true
384            
385            
386            <xsl:variable name="ptName" select="Name">
387            <xsl:if test="(string(number(/JOBFile/Reductions/Point[Name = $ptName]/Grid/North)) = 'NaN') or
388                          (string(number(/JOBFile/Reductions/Point[Name = $ptName]/Grid/East))  = 'NaN')">
389              <xsl:text>	        
390              <xsl:variable name="bsAzimuth">
391                <xsl:call-template name="GetBacksightAzimuth">
392              
393              <xsl:value-of select="format-number($bsAzimuth, $DecPl8, 'Standard')">
394            
395            <xsl:call-template name="NewLine">
396  
397            <xsl:if test="msxsl:node-set($pointDesc)/controlCode != ''">
398              <xsl:call-template name="WriteControlCode">
399                <xsl:with-param name="controlCode" select="msxsl:node-set($pointDesc)/controlCode">
400                <xsl:with-param name="ptDesc" select="msxsl:node-set($pointDesc)/ptDesc">
401              
402            
403          
404          
405          <xsl:when test="Classification = 'Check'">
406            <xsl:text>06		  
407            <xsl:call-template name="PointDescriptionOutput">
408            <xsl:call-template name="CircleObservationOutput">
409          
410  
411          <xsl:otherwise>
412            <xsl:text>07		  
413            <xsl:call-template name="PointDescriptionOutput">
414            <xsl:call-template name="CircleObservationOutput">
415  
416            <xsl:if test="Method = 'CircularObject'">
417              
418              <xsl:text>18		  
419              <xsl:value-of select="format-number(CircularObject/Radius, $DecPl8, 'Standard')">
420              <xsl:call-template name="NewLine">
421            
422          
423        
424      
425    
426    
427    
428    <xsl:if test="Description1 != ''">
429      <xsl:text>41		  
430      <xsl:value-of select="Description1">
431      <xsl:call-template name="NewLine">
432    
433  
434    <xsl:if test="Description2 != ''">
435      <xsl:text>41		  
436      <xsl:value-of select="Description2">
437      <xsl:call-template name="NewLine">
438    
439  
440    <xsl:for-each select="Notes/Note[. != '']">
441      <xsl:text>41		  
442      <xsl:value-of select=".">
443      <xsl:call-template name="NewLine">
444    
445  
446    
447    <xsl:for-each select="Features/Feature/Attribute[Value != '']">
448      <xsl:choose>
449        <xsl:when test="(Type = 'Text') or (Type = 'Menu') or (Type = 'File') or
450                        (Type = 'Photo') or (Type = 'Date') or (Type = 'Time')">
451          <xsl:text>73		  
452          <xsl:value-of select="Name">
453          <xsl:text>	
454          <xsl:value-of select="Value">
455          <xsl:call-template name="NewLine">
456        
457        
458        <xsl:when test="(Type = 'Numeric') and contains(Value, '.')">
459          <xsl:text>72		  
460          <xsl:value-of select="Name">
461          <xsl:text>	
462          <xsl:value-of select="Value">
463          <xsl:call-template name="NewLine">
464        
465        
466        <xsl:otherwise>
467          <xsl:text>71		  
468          <xsl:value-of select="Name">
469          <xsl:text>	
470          <xsl:value-of select="Value">
471          <xsl:call-template name="NewLine">
472        
473      
474    
475    
476    
477    <xsl:if test="($includeGNSSQCAsAttributes = 'Yes') and QualityControl1">
478      
479      <xsl:text>72		  
480      <xsl:text>PDOP
481      <xsl:text>	
482      <xsl:value-of select="format-number(QualityControl1/PDOP, $DecPl1, 'Standard')">
483      <xsl:call-template name="NewLine">
484  
485      
486      <xsl:text>71		  
487      <xsl:text>Nbr of satellites
488      <xsl:text>	
489      <xsl:value-of select="QualityControl1/NumberOfSatellites">
490      <xsl:call-template name="NewLine">
491  
492      
493      <xsl:text>71		  
494      <xsl:text>Positions used
495      <xsl:text>	
496      <xsl:value-of select="QualityControl1/NumberOfPositionsUsed">
497      <xsl:call-template name="NewLine">
498  
499      
500      <xsl:text>72		  
501      <xsl:text>Hz precision
502      <xsl:text>	
503      <xsl:value-of select="format-number(Precision/Horizontal, $DecPl3, 'Standard')">
504      <xsl:call-template name="NewLine">
505  
506      
507      <xsl:text>72		  
508      <xsl:text>Hz precision
509      <xsl:text>	
510      <xsl:value-of select="format-number(Precision/Vertical, $DecPl3, 'Standard')">
511      <xsl:call-template name="NewLine">
512    
513    
514    <xsl:if test="($includeDateTimeAsAttributes = 'Yes') and (@TimeStamp != '') and (QualityControl1 or TargetID)">
515      
516      <xsl:text>73		  
517      <xsl:text>Date
518      <xsl:text>	
519      <xsl:value-of select="substring-before(@TimeStamp, 'T')">
520      <xsl:call-template name="NewLine">
521  
522      
523      <xsl:text>73		  
524      <xsl:text>Time
525      <xsl:text>	
526      <xsl:value-of select="substring-after(@TimeStamp, 'T')">
527      <xsl:call-template name="NewLine">
528    
529    
530    <xsl:if test="($includeTargetInstDetailsAsAttributes = 'Yes') and TargetID">
531      
532      <xsl:text>72		  
533      <xsl:text>Target height
534      <xsl:text>	
535      <xsl:value-of select="format-number(key('tgtID-search', TargetID)[1]/TargetHeight, $DecPl3, 'Standard')">
536      <xsl:call-template name="NewLine">
537  
538      
539      <xsl:text>72		  
540      <xsl:text>Prism constant
541      <xsl:text>	
542      <xsl:value-of select="format-number(key('tgtID-search', TargetID)[1]/PrismConstant * 1000.0, $DecPl1, 'Standard')">
543      <xsl:text>mm
544      <xsl:call-template name="NewLine">
545    
546  
547  
548  
549  
550  
551  
552  <xsl:template name="WriteControlCode">
553    <xsl:param name="controlCode">
554    <xsl:param name="ptDesc">
555    
556    <xsl:choose>
557      <xsl:when test="$controlCode = 'startArc'">61
558      <xsl:when test="$controlCode = 'endArc'">62
559      <xsl:when test="$controlCode = 'close'">
560        <xsl:text>20		
561        <xsl:value-of select="$ptDesc">
562      
563      <xsl:when test="$controlCode = 'removeHeight'">30
564    
565    <xsl:call-template name="NewLine">
566  
567  
568  
569  
570  
571  
572  <xsl:template match="TargetRecord">
573  
574  <xsl:variable name="tgtHt">
575    <xsl:choose>
576      <xsl:when test="string(number(TargetHeight)) != 'NaN'">
577        <xsl:value-of select="TargetHeight">
578      
579      <xsl:otherwise>0   
580    
581    
582    <xsl:text>05		  
583    <xsl:value-of select="format-number($tgtHt, $DecPl8, 'Standard')">
584    <xsl:call-template name="NewLine">
585  
586  
587  
588  
589  
590  
591  <xsl:template match="NoteRecord">
592  
593    <xsl:for-each select="Notes/Note[. != '']">
594      <xsl:text>29		  
595      <xsl:value-of select=".">
596      <xsl:call-template name="NewLine">
597    
598  
599  
600  
601  
602  
603  
604  <xsl:template name="PointDescriptionOutput">
605    <xsl:param name="skipStringOutput">false
606    <xsl:param name="backsightObs">false
607  
608    
609    
610    
611    
612    
613    
614    <xsl:variable name="codeFields">
615      <xsl:variable name="code">
616        <xsl:choose>
617          <xsl:when test="contains(Code, $codePtTextSeparator)">
618            <xsl:value-of select="substring-before(Code, $codePtTextSeparator)">
619          
620          <xsl:otherwise>
621            <xsl:value-of select="Code">
622          
623        
624      
625  
626      
627      
628      
629      <xsl:variable name="upperCaseStrAfter" select="translate(substring-after(Code, $codePtTextSeparator),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')">
630      <xsl:choose>
631        <xsl:when test="$upperCaseStrAfter = $startArcCode">
632          <xsl:element name="controlCode" namespace="">startArc
633        
634        <xsl:when test="$upperCaseStrAfter = $endArcCode">
635          <xsl:element name="controlCode" namespace="">endArc
636        
637        <xsl:when test="$upperCaseStrAfter = $closeCode">
638          <xsl:element name="controlCode" namespace="">close
639        
640        <xsl:when test="$upperCaseStrAfter = $removeHtCode">
641          <xsl:element name="controlCode" namespace="">removeHeight
642        
643        <xsl:otherwise>
644          <xsl:element name="pointText" namespace="">
645            <xsl:value-of select="substring-after(Code, $codePtTextSeparator)">
646          
647        
648      
649  
650      <xsl:choose>
651        <xsl:when test="(string(number(substring($code, string-length($code), 1))) != 'NaN') and ($skipStringOutput = 'false')">
652          
653          <xsl:variable name="stringNbr" select="translate($code, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+={}[]\|:;<>,/?', '')">
654          <xsl:variable name="codeStr" select="translate($code, '-0123456789.', '')">
655          <xsl:choose>
656            <xsl:when test="$codeStr != ''">  
657              <xsl:element name="code" namespace="">
658                <xsl:value-of select="$codeStr">
659              
660              <xsl:element name="stringNumber" namespace="">
661                <xsl:value-of select="$stringNbr">
662              
663            
664            <xsl:otherwise>   
665              <xsl:element name="code" namespace="">
666                <xsl:value-of select="$code">
667              
668            
669          
670        
671        <xsl:otherwise>
672          <xsl:element name="code" namespace="">
673            <xsl:value-of select="$code">
674          
675        
676      
677    
678  
679    
680    <xsl:element name="ptDesc" namespace="">
681      <xsl:value-of select="msxsl:node-set($codeFields)/code">
682      <xsl:text>	        
683      
684      <xsl:value-of select="msxsl:node-set($codeFields)/stringNumber">
685      <xsl:text>	        
686      <xsl:value-of select="Name">     
687      <xsl:text>	        
688      
689      <xsl:if test="$copyAlphaNames != 'No'">
690        <xsl:variable name="isNumericPtNbr" select="string(number(Name))">
691        <xsl:if test="($isNumericPtNbr = 'NaN') or ($backsightObs != 'false')">
692          
693          <xsl:value-of select="Name">
694        
695      
696      <xsl:text>	        
697      
698      <xsl:value-of select="msxsl:node-set($codeFields)/pointText">
699      <xsl:text>	        
700    
701    <xsl:element name="controlCode" namespace="">
702      <xsl:if test="msxsl:node-set($codeFields)/controlCode != ''">
703        <xsl:value-of select="msxsl:node-set($codeFields)/controlCode">
Posted
Updated 7-Jun-21 7:40am
v5
Comments
RedDk 5-Jun-21 15:32pm    
Sorry about that; I mispoke.
Best to look here:
https://www.codeproject.com/search.aspx?q=XSL&x=0&y=0&sbo=kw
Brendan Jackson 5-Jun-21 16:07pm    
yeah i have been through alot of that already and i just cant see where im going wrong
Richard Deeming 7-Jun-21 12:42pm    
Well, for a start, dumping over 700 lines of XSL in a question and expecting someone to wade through it to find the problem for you. All without any access to the input data.

Start by narrowing the problem down, removing any XSL from your question which is not related to the problem, and providing a small sample input file.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900