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

  • SEARCH
  • Home
  • 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 8347609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:24:37+00:00 2026-06-09T07:24:37+00:00

I have XML <getInquiryAboutListReturn xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance> <inquiryAbouts> <inquiryAbout> <code>Code</code> <nameKk>Something</nameKk> <nameRu>Something</nameRu> <documents xsi:nil=true/> </inquiryAbout> </inquiryAbouts>

  • 0

I have XML

<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <inquiryAbouts>
        <inquiryAbout>
            <code>Code</code>
            <nameKk>Something</nameKk>
            <nameRu>Something</nameRu>
            <documents xsi:nil="true"/>
        </inquiryAbout>
    </inquiryAbouts>
</getInquiryAboutListReturn>

And I want to process it with XSLT to copy all XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output indent="yes" />
    <xsl:template match="/">
        <xsl:copy-of select="//getInquiryAboutListReturn/inquiryAbouts"/>
    </xsl:template>
</xsl:stylesheet>

How could I copy all XML without <documents xsi:nil="true"/> or without xsi:nil=”true”?

Desired output XML

<getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <inquiryAbouts>
        <inquiryAbout>
            <code>Code</code>
            <nameKk>Something</nameKk>
            <nameRu>Something</nameRu>
        </inquiryAbout>
    </inquiryAbouts>
</getInquiryAboutListReturn>
  • 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-09T07:24:39+00:00Added an answer on June 9, 2026 at 7:24 am

    This simple XSLT:

    <?xml version="1.0"?>
    <xsl:stylesheet 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      version="1.0">
    
      <xsl:output omit-xml-declaration="no" indent="yes"/>
      <xsl:strip-space elements="*"/>
    
      <!-- TEMPLATE #1 -->
      <xsl:template match="node()|@*">
        <xsl:copy>
          <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
      </xsl:template>
    
      <!-- TEMPLATE #2 -->
      <xsl:template match="*[@xsi:nil = 'true']" />
    
    </xsl:stylesheet>
    

    …when applied to the OP’s source XML:

    <?xml version="1.0"?>
    <getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <inquiryAbouts>
        <inquiryAbout>
          <code>Code</code>
          <nameKk>Something</nameKk>
          <nameRu>Something</nameRu>
          <documents xsi:nil="true"/>
        </inquiryAbout>
      </inquiryAbouts>
    </getInquiryAboutListReturn>
    

    …produces the expected result XML:

    <?xml version="1.0"?>
    <getInquiryAboutListReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <inquiryAbouts>
        <inquiryAbout>
          <code>Code</code>
          <nameKk>Something</nameKk>
          <nameRu>Something</nameRu>
        </inquiryAbout>
      </inquiryAbouts>
    </getInquiryAboutListReturn>
    

    EXPLANATION:

    1. The first template — the Identity Template — copies all nodes and attributes from the source XML document as-is.
    2. The second template, which matches all elements with the specified, namespaced attribute equalling “true”, effectively removes those elements.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Xml which looks like this: <DataMapper xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <SqlTable /> <Level_01s> <DataParameter>
I have xml document like below, <chapter xmlns:xi=http://www.w3.org/2001/XInclude xml:id=chapter1> <title>First chapter</title> <section xml:id=section1> <imageobject>
I have xml files with escaped HTML code in them, and I want to
I have XML files that are representation of a portion of HTML code. Those
I have XML like this: <article> <title>Article 1 title</title> <text>Lorem ipsum...</text> <image>http://example.com/img_01.jpg</image> </article> <article>
I have xml records with javascript code embedded in an element. Like: <?xml version=1.0
I have xml http://weather.yahooapis.com/forecastrss?w=20070458&u=c how can i parse from tag (which is twice or
I have xml http://weather.yahooapis.com/forecastrss?w=20070458&u=c and I want that when xml is updated my data
I have xml file with such structure: ... <outer> ... <inner/> ... </outer> ...
I have XML in the following form that I want to parse with PHP

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.