| re: Problem using XmlTextReader and XmlTextWriter.
You can create your own XmlWriter based on XmlTextWriter, overrite
WirteNode; do what you have to do and/or call base.WriteNode.
Yan
"Pete" <nospam@nospamever.com> wrote in message
news:VFjrc.7235$g71.2254@clgrps13...[color=blue]
> Thanks Paul,
>
> I wondered if there was a way to do this without a lengthy switch block.
> Have you seen any examples of this type of code that has been tested and
> ready to use? Just curious. I'm still debating whether it would be more
> robust to do this using xslt instead.
>
> In any case, thanks for the suggestion.
>
> Pete
>
>[color=green]
>> Pete,
>>
>> You can do switch on NodeType for all types of nodes XmlReader
>> handles. It's not much, only 18 case statements and you will have more
>> granular control of the output xml in future. You can use WriteNode()
>> if you absolutely sure current node doesn't have any children you need
>> to modify like if(reader.Name != "ThisNodeHasSomeSuffToModify")
>> writer.WriteNode(reader, false).
>>
>> Paul
>>[/color]
>[/color] |