Subject: Re: [xsl] xsl transform on xml with namespaces returns no output From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 06 Aug 2009 13:17:18 +0200 |
I want to apply xsl on the xml below to get a transformed xml as shown below.
Source xml ---
<input xmlns="http://tempuri.org/">
<InputParams
xmlns="http://schemas.datacontract.org/2004/07/GenericQuery">
<anyType xsi:type="q1:ResultSpecPagination"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns:q1="urn:cbc:message"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PageSize xmlns="">10</PageSize> </anyType>
<anyType xsi:type="q2:AccountFilter"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns:q2="urn:cbc:clientinfo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AccountFilter xmlns="">
<O>101</O> <F>173</A> </AccountFilter>
</anyType>
<anyType xsi:type="xsd:string"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">677</anyType> <anyType xsi:type="xsd:string"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">A</anyType> </InputParams>
</input>
Expected Result:
- <pSearch xmlns="http://tempuri.org/">
- <p1>
<PageSize xmlns="">10</PageSize> </p1>
- <p2>
-<AccountFilter xmlns="">
<O>101</O> <F>173</F> </AccountFilter>
</p2>
<p3>677</p3> <p4>A</p4> </pSearch>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:df="http://tempuri.org/" xmlns="http://tempuri.org/" xmlns:gq="http://schemas.datacontract.org/2004/07/GenericQuery" xmlns:sa="http://schemas.microsoft.com/2003/10/Serialization/Arrays" exclude-result-prefixes="df gq sa" version="2.0">
<xsl:template match="df:input"> <pSearch> <xsl:apply-templates select="gq:InputParams/sa:anyType"/> </pSearch> </xsl:template>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl transform on xml with nam, Raveendran, Reshma | Thread | [xsl] outputting an ampersand in an, tom a |
Re: [xsl] How to select for ' , Hermann Stamm-Wilbra | Date | Re: [xsl] How to select for ' , David Carlisle |
Month |