giotto

giotto

  • NA
  • 1
  • 0

URGENT: how to reach the XmlNodeType.Element's attribute at the XmlNodeType.EndElement?

Aug 6 2008 11:32 AM
Hi how can reach the opening tag when I'm at the Endelement??

<node param="asdf'>
...inner xml...
</node>

I'd like to get the param when I'm at the </node>

This is how I process the XML document....

while (nodeReader.Read()){
    // Move to fist element
    nodeReader.MoveToElement();

    switch (nodeReader.NodeType){
        case XmlNodeType.Attribute:
        case XmlNodeType.CDATA:
        case XmlNodeType.Comment:
        case XmlNodeType.Document:
        case XmlNodeType.DocumentFragment:
        case XmlNodeType.DocumentType:
            break;
        case XmlNodeType.Element:
            // do something
            break;
        case XmlNodeType.EndElement:
            // has to get the first parameter of the opening element
            break;
        case XmlNodeType.EndEntity:
        case XmlNodeType.Entity:
        case XmlNodeType.EntityReference:
        case XmlNodeType.None:
        case XmlNodeType.Notation:
        case XmlNodeType.ProcessingInstruction:
        case XmlNodeType.SignificantWhitespace:
            break;
        case XmlNodeType.Text:
            // do something
            break;
        case XmlNodeType.Whitespace:
        case XmlNodeType.XmlDeclaration:
        default:
            break;
    }
}



Any Idea???

Thnx giotto

Answers (1)