Here is the xml:
<_text_column min_width="0" max_width="2031051">
<PF_Para_Base align="center">
<_char data_tag="PricesGoodText" font_size="35270" bold="true" italic="false" font_name="/ITC Franklin Gothic Demi" text_color="White">PricesGoodText</_char>
</PF_Para_Base>
</_text_column>
I am opening and appending a root to the file because I was getting a multiple root error with the file
using (var fs = new StreamReader(fullFileName))
using (var xr = XmlReader.Create(fs, settings))
{
while (xr.Read())
{
if (xr.NodeType == XmlNodeType.Element)
{
rootElement.Add(XElement.Load(xr.ReadSubtree()));
}
}
}
var attr = rootElement.Elements("char").Attribute("data_tag");
I need to get the attribute data_tag
out of the node _char
. It comes back as null
.