Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:44:22+00:00 2026-06-13T23:44:22+00:00

I did the XSLT transformation. What I missing is nil attribute. I mean that

  • 0

I did the XSLT transformation.

What I missing is nil attribute. I mean that if source element has nil element true
I want to map it to destination XML.

<xsl:if 
test="string-length(soapenv:Envelope/soapenv:Body/b:getBLResponse/b:result/BResult:BLOut/Class:ID)=0">
    <xsl:attribute name="i:nil">true</xsl:attribute>
</xsl:if>

The if above working for specific node , but I want to make it as general template,
not to check every field

May be it is possible to create template which will receive xml node, than will be validation if node has nil attribute if it is , it will return with the nil attribute
otherwise without nil attribute.

Below is example

With nil: Input:

<TEST>
    <Child i:nil="true">asdf</Child>
</TEST>
Output:

<TEST xmlns:i="whatever" >
    <OutputChild i:nil="true">asdf</OutputChild >
</TEST>

Without nil: Input + Output the same

<TEST>
    <OutputChild >example</OutputChild >
</TEST>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:44:23+00:00Added an answer on June 13, 2026 at 11:44 pm

    In order to solve it , I wrote the template, which receives mapping node, and new element name. After checking if element is null, the template return nil attribute

    <xsl:template name="TransformNode" >
            <xsl:param name="pCurrentNode"/>
            <xsl:param name="elementName"/>
            <xsl:element name = "{$elementName}">
                <xsl:if test="$pCurrentNode/@i:nil='true'"><xsl:attribute name="nil">true</xsl:attribute></xsl:if>      
                <xsl:value-of select="$pCurrentNode"/>
            </xsl:element>
        </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Never did XSLT before. Is that possible to inherit a doc and replace just
I just wrote an XSLT that did not work at first. I had to
Did actually someone make already a tutorial that shows how to customize an UITableView?
Did I understood correctly that you can't subscribe to an event other than using
Hello people is it true that we cannot integrate Saxon with Visual Studio? Because
I am having a problem that has had me stuck for a day and
what i did was to open a ABC.xml file and performing XSLT on it
i have a XML datadump from a database that i want to present using
I'm new to XML/XSLT. What I did is I've created an XML file with
I have this XSLT stylesheet, where I'm trying to find nodes that contain an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.