Why does XmlTextReader skip lines after the style: name = Closing tag "T103"?

My program is designed to read the content.xml file.
So after he reads the closing tag style:name="T103", he will use the function reader.Read(), and then move on to the tag </office:automatic-styles>.
Skip everything to this tag.
Why is this?

<style:style style:name="T101" style:family="text">
  <style:text-properties style:font-name="Arial1" fo:font-size="10pt" style:font-size-asian="10pt" style:font-name-complex="Arial3"/>
</style:style>
<style:style style:name="T102" style:family="text">
  <style:text-properties style:font-name="Arial1" fo:font-style="normal" style:font-style-asian="normal" style:font-name-complex="Arial3"/>
</style:style>
<style:style style:name="T103" style:family="text">
  <style:text-properties style:font-name="Arial1" fo:font-style="normal" style:font-style-asian="normal" style:font-name-complex="Arial3" style:font-size-complex="12pt"/>
</style:style>
<style:style style:name="T104" style:family="text">
  <style:text-properties style:font-name="Arial1" fo:font-style="normal" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:font-style-asian="normal" style:font-name-complex="Arial3" style:font-size-complex="12pt"/>
</style:style>

Code for tag <style:style>:

public void style_style()
{
    reader.MoveToFirstAttribute();
    if (reader.Name == "style:name")
    {
        if (!(reader.Value.StartsWith("Table")))
            if (reader.Value.StartsWith("T"))
                styleName = reader.Value;
        if (styleName == "T103")
            Console.Write("");
    }

}

and for <style:text-properties>:

public void style_text_properties()
{
    while (reader.MoveToNextAttribute())
    {
        if (styleName.Length > 1)
            switch (reader.Name)
            {
                case "fo:font-style":
                    if (reader.Value == "italic")
                        isItalic = true;
                    break;
                case "style:text-underline-style":
                    if (reader.Value == "solid")
                        isUnderline = true;
                    break;
                case "fo:font-weight":
                    if (reader.Value == "bold")
                        isBold = true;
                    break;
            }
    }
}

I tried to debug, and I just found out that after </style:style>node, for style:name="T103"it skips every node before </office:automatic-styles>.
This node is the last closing tag after all the style nodes.

Why is he doing this?

+3
source share

All Articles