Skip to main content
deleted 72 characters in body; edited title
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

I need xsltXSLT to filter xmlXML by passing node values with pipe symbol

My input xml:

<InfoReturn>

 <?xml version = &lt;LicenseInfo>
"1.0" encoding = "UTF-8"?>
&lt;InfoReturn>
    &lt;LicenseInfo>
        &lt;licenseType>1&lt;/licenseType>
        &lt;licenseTypeDescAr>دائمة&lt;/licenseTypeDescAr>
        &lt;licenseTypeDescEn>Permanent&lt;/licenseTypeDescEn>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameA>مرور ديرة&lt;/centerNameA>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;interimExpiryDate>2018-09-30T00:00:00.000Z&lt;/interimExpiryDate>
        &lt;licenseStatusArabic>مع المالك&lt;/licenseStatusArabic>
        &lt;licenseStatusEnglish>With Owner&lt;/licenseStatusEnglish>
        &lt;hasEyeTest>0&lt;/hasEyeTest>
        &lt;personId>1004257701&lt;/personId>
        &lt;isSpecialExpiryDesA>لا&lt;/isSpecialExpiryDesA>
        &lt;isSpecialExpiryDesE>NO&lt;/isSpecialExpiryDesE>
      
    &lt;/LicenseInfo>           
&lt;/InfoReturn>

</InfoReturn>

allowedAllowed fields will be passed as centerId|centerNameE|personIdcenterId | centerNameE | personId

The out put xmloutput XML which iI am looking will be

<InfoReturn>for is:

<?xml version = "1.0" &lt;LicenseInfo>
encoding = "UTF-8"?>
&lt;InfoReturn>     
       &lt;LicenseInfo>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;personId>1004257701&lt;/personId>
        
      
    &lt;/LicenseInfo>           
&lt;/InfoReturn>

</InfoReturn>

pleasePlease provide xsltXSLT for this solution.

I need xslt to filter xml by passing node values with pipe symbol

My input xml:

<InfoReturn>

    &lt;LicenseInfo>
       
        &lt;licenseType>1&lt;/licenseType>
        &lt;licenseTypeDescAr>دائمة&lt;/licenseTypeDescAr>
        &lt;licenseTypeDescEn>Permanent&lt;/licenseTypeDescEn>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameA>مرور ديرة&lt;/centerNameA>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;interimExpiryDate>2018-09-30T00:00:00.000Z&lt;/interimExpiryDate>
        &lt;licenseStatusArabic>مع المالك&lt;/licenseStatusArabic>
        &lt;licenseStatusEnglish>With Owner&lt;/licenseStatusEnglish>
        &lt;hasEyeTest>0&lt;/hasEyeTest>
        &lt;personId>1004257701&lt;/personId>
        &lt;isSpecialExpiryDesA>لا&lt;/isSpecialExpiryDesA>
        &lt;isSpecialExpiryDesE>NO&lt;/isSpecialExpiryDesE>
      
    &lt;/LicenseInfo>           

</InfoReturn>

allowed fields will be passed as centerId|centerNameE|personId

The out put xml which i am looking will be

<InfoReturn>

    &lt;LicenseInfo>
       
       
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;personId>1004257701&lt;/personId>
        
      
    &lt;/LicenseInfo>           

</InfoReturn>

please provide xslt for this solution.

I need XSLT to filter XML by passing node values with pipe symbol

My input xml:

<?xml version = "1.0" encoding = "UTF-8"?>
&lt;InfoReturn>
    &lt;LicenseInfo>
        &lt;licenseType>1&lt;/licenseType>
        &lt;licenseTypeDescAr>دائمة&lt;/licenseTypeDescAr>
        &lt;licenseTypeDescEn>Permanent&lt;/licenseTypeDescEn>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameA>مرور ديرة&lt;/centerNameA>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;interimExpiryDate>2018-09-30T00:00:00.000Z&lt;/interimExpiryDate>
        &lt;licenseStatusArabic>مع المالك&lt;/licenseStatusArabic>
        &lt;licenseStatusEnglish>With Owner&lt;/licenseStatusEnglish>
        &lt;hasEyeTest>0&lt;/hasEyeTest>
        &lt;personId>1004257701&lt;/personId>
        &lt;isSpecialExpiryDesA>لا&lt;/isSpecialExpiryDesA>
        &lt;isSpecialExpiryDesE>NO&lt;/isSpecialExpiryDesE>
    &lt;/LicenseInfo>           
&lt;/InfoReturn>

Allowed fields will be passed as centerId | centerNameE | personId

The output XML which I am looking for is:

<?xml version = "1.0" encoding = "UTF-8"?>
&lt;InfoReturn>     
    &lt;LicenseInfo>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;personId>1004257701&lt;/personId>
    &lt;/LicenseInfo>           
&lt;/InfoReturn>

Please provide XSLT for this solution.

Source Link

I need xslt to filter xml by passing node values with pipe symbol

My input xml:

<InfoReturn>

    &lt;LicenseInfo>
       
        &lt;licenseType>1&lt;/licenseType>
        &lt;licenseTypeDescAr>دائمة&lt;/licenseTypeDescAr>
        &lt;licenseTypeDescEn>Permanent&lt;/licenseTypeDescEn>
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameA>مرور ديرة&lt;/centerNameA>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;interimExpiryDate>2018-09-30T00:00:00.000Z&lt;/interimExpiryDate>
        &lt;licenseStatusArabic>مع المالك&lt;/licenseStatusArabic>
        &lt;licenseStatusEnglish>With Owner&lt;/licenseStatusEnglish>
        &lt;hasEyeTest>0&lt;/hasEyeTest>
        &lt;personId>1004257701&lt;/personId>
        &lt;isSpecialExpiryDesA>لا&lt;/isSpecialExpiryDesA>
        &lt;isSpecialExpiryDesE>NO&lt;/isSpecialExpiryDesE>
      
    &lt;/LicenseInfo>           

</InfoReturn>

allowed fields will be passed as centerId|centerNameE|personId

The out put xml which i am looking will be

<InfoReturn>

    &lt;LicenseInfo>
       
       
        &lt;centerId>1&lt;/centerId>
        &lt;centerNameE>TRAFFIC DEIRA&lt;/centerNameE>
        &lt;personId>1004257701&lt;/personId>
        
      
    &lt;/LicenseInfo>           

</InfoReturn>

please provide xslt for this solution.