Matt (archive)
Usenet Archive
- Joined
- Jan 13, 2000
- Messages
- 739
- Reaction score
- 0
Hello,
I have an XML document similar to the following:
<DataItems>
<Data xmlns="http://www.me.com">
<DataInformation xmlns:a="http://www.me.com/ASettings" xsi:type="a:Stuff1"> <a:Name>Matt</a:Name> <a:TN>555-5555</a:TN> </DataInformation> </Data> <Data xmlns="http://www.me.com"> <DataInformation xmlns:b="http://www.me.com/BSettings" xsi:type="b:Stuff2"> <b:Name>Bob</b:Name> <b:TN>555-6666</b:TN> </DataInformation> </Data> </DataItems>
What I would like to do is take all the namespaces and throw them in the garbage! For example, I want to remove the xmlns attribute from the Data node, I want to remove all the "a" and "b" prefixes from all the nodes, etc. I want the final outcome to look like the following:
<DataItems>
<Data>
<DataInformation type="Stuff1">
<Name>Matt</Name>
<TN>555-5555</TN>
</DataInformation>
</Data>
<Data>
<DataInformation type="Stuff2">
<Name>Bob</Name>
<TN>555-6666</TN>
</DataInformation>
</Data>
</DataItems>
I am using C++ and Microsoft's xml implementation (DOM). I have no choice but to use the raw Microsoft interfaces.
Does anyone have a good idea of how to do this?
Thanks,
Matt
I have an XML document similar to the following:
<DataItems>
<Data xmlns="http://www.me.com">
<DataInformation xmlns:a="http://www.me.com/ASettings" xsi:type="a:Stuff1"> <a:Name>Matt</a:Name> <a:TN>555-5555</a:TN> </DataInformation> </Data> <Data xmlns="http://www.me.com"> <DataInformation xmlns:b="http://www.me.com/BSettings" xsi:type="b:Stuff2"> <b:Name>Bob</b:Name> <b:TN>555-6666</b:TN> </DataInformation> </Data> </DataItems>
What I would like to do is take all the namespaces and throw them in the garbage! For example, I want to remove the xmlns attribute from the Data node, I want to remove all the "a" and "b" prefixes from all the nodes, etc. I want the final outcome to look like the following:
<DataItems>
<Data>
<DataInformation type="Stuff1">
<Name>Matt</Name>
<TN>555-5555</TN>
</DataInformation>
</Data>
<Data>
<DataInformation type="Stuff2">
<Name>Bob</Name>
<TN>555-6666</TN>
</DataInformation>
</Data>
</DataItems>
I am using C++ and Microsoft's xml implementation (DOM). I have no choice but to use the raw Microsoft interfaces.
Does anyone have a good idea of how to do this?
Thanks,
Matt