473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to ignore xmlns attribute inside some xml tag?

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 <Resulttag 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 <Requesttag, 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 <Requesttag &
will get proper output as I mentioned above?

Thanks,

Amit
Jun 27 '08 #1
1 5477
Amit wrote:
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 <Resulttag 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>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
2
by: Jon Thackray | last post by:
I'm trying to use the MathML DTD and stylesheets, but get some problems with xmlns attributes. If I do something like <math xmlns="http://..."> .... </math> then xmllint and xalan in...
0
by: chris.stromberger | last post by:
New to SOAP. I am working on something that uses the paypal web services. All the examples have this as the first portion of the soap doc <?xml version="1.0" encoding="UTF-8"?>...
4
by: Shailendra Batham | last post by:
Hi guys,Does any1 know what this error is all about, what I am trying to do is deserialize a XML, below is my code, let me know what I am doing wrongpublic class test{xin = "<?xml version='1.0'...
1
by: Livrish | last post by:
Hey I have having a problem Deserializing a dataset. When I try to deserialize it (See below for my test code) I get the following exception {"Item has already been added. Key in dictionary:...
0
by: Zimri | last post by:
All, I am trying to read an XML of a set of records (an "order") from one machine and then turn it into a set of records on another machine. But some of the order's dependent records are...
0
by: jts2077 | last post by:
I am trying to create a large nested XML object using E4X methods. The problem is the, the XML I am trying to create can only have xmlns set at the top 2 element levels. Such as: <store ...
2
by: eliasen | last post by:
Hi I need to integrate to a system that has XML like this: <Calls xmlns="\\SomeMachine\Share\Schemas\Calls1_2.dtd" Version="1.2"> <Call> <CallRef>Call1</CallRef> <UserRef>286</UserRef>...
5
by: eggie5 | last post by:
I'm having trouble deserilizing an xml node that has empty tags. See XML: <ContentCampaigns> <ContentCampaign> <ad_id_source type="integer"></ad_id_source> <billing_code...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.