Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / May 2008

Tip: Looking for answers? Try searching our database.

how to ignore xmlns attribute inside some xml tag?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amit - 20 May 2008 14:43 GMT
Suppose I am having this input xml:<Event><Test></Test><Result
Value="true"><Request xmlns='http://tempuri.org/AtoB.xsd' RequestID=""
MessageID="" UniqueID="000172581"/><Application></Application></
Result></Event>

and I want this xml output:<Event><Test></Test><Request xmlns='http://
tempuri.org/AtoB.xsd' RequestID="" MessageID="" UniqueID="000172581"/
><Application></Application></Event>
i.e removing of <Result> tag in the output xml string & For this I
wrote an xslt but I am getting one problem.

Problem: the xmlns attribute in the Request tag is precluding XSLT to
parse input xml ahead of <Request> tag, i.e I am
getting :<Event><Test></Test></Event>

Question: Could anybody tell me what can i do in my XSLT sothat xmlns
will not prevent  generation of output xml ahead of <Request> tag &
will get proper output as I mentioned above?

Thanks,

Amit
Martin Honnen - 20 May 2008 14:55 GMT
> Suppose I am having this input xml:<Event><Test></Test><Result
> Value="true"><Request xmlns='http://tempuri.org/AtoB.xsd' RequestID=""
[quoted text clipped - 5 lines]
>> <Application></Application></Event>
> i.e removing of <Result> tag in the output xml string

Here is an XSLT stylesheet

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="Result">
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.