Sample input XML...
<Publication>
<FilingMetadata>
<Id>38EA51240E6643208DB1B6D52F779A82</Id>
<Cycle>BC</Cycle>
</FilingMetadata>
<PublicationComponent Role="Main" MediaType="Text">
<TextContentItem>
<Language>en-us</Language>
<DataContent>
<nitf>
<body.content>
<block>
<p>The dollar dropped versus the yen again
Thursday, extending the sharp losses seen in recent
sessions amid a violent reversal from months of betting heavily against
the Japanese currency.</p>
<p>However, the dollar gained modestly
against the euro, helped by solid economic data and also aided by the
yen's advance versus the euro.</p>
</block>
</body.content>
</nitf>
</DataContent>
</TextContentItem>
</PublicationComponent>
<Publication>
Target Class into which I want to eventually deserialize the above
xml...
class Publication
{
public string ID; // Will contain
"38EA51240E6643208DB1B6D52F779A82"
public string Cycle; // will contain BC
public string DataContentXML;
}
This is a two-step process.
Step one is to use an xslt to transform the input into something like
this:
<TextContent>
<Id>38EA51240E6643208DB1B6D52F779A82</id>
<FullText>
<nitf>
<body.content>
<block>
<p>The dollar dropped versus the yen again
Thursday, extending the sharp losses seen in recent sessions amid a
violent
reversal from months of betting heavily against the Japanese
currency.</p>
<p>However, the dollar gained modestly
against the euro, helped by solid economic data and also aided by the
yen's advance versus the euro.</p>
</block>
</body.content>
</nitf>
</FullText>
<TextContent>
The <ID> and <Cycle> tags works just fine.
I want to use xsl:copy-of (I think) to get all of the contents of the
<DataContent> tag, including xml tags loaded into a string so that all
tags are preserved.
Xsl:copy-of is not working. All I get is "There is an error in the XML
file" with no further explanation. If I use xsl:value-of, I can get
all the text but no tags. The tags are important for later processing.
Step two will be to deserialize the xml above into an object as
outlined in the Publication class with everything between the
<FullText> tags loaded into the Publication.DataContentXML property as
one complete string, including the child tags.
I am not yet an XML or XSLT expert.
Question 1: Is this possible?
Question 2: How do I do this?
Oleg Tkachenko [MVP] - 31 Oct 2006 09:21 GMT
> Step one is to use an xslt to transform the input into something like
> this:
[quoted text clipped - 30 lines]
> file" with no further explanation. If I use xsl:value-of, I can get
> all the text but no tags. The tags are important for later processing.
Show us your XSLt stylesheet. That's hard to say why xsl:copy-of won't
work without seeing your code.

Signature
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net