How to get the xsd file attribute name one by one using dom parser? how to use get_next_sibling?

131 Views Asked by At

I am new for this xsd. I want to get xsd file attribute name one by one using dom parser. I have tried with next_sibling but, not succeeded.

Here XSD fild:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Help" xmlns:tns="http://www.example.org/Help" elementFormDefault="qualified">
    <element name="Help">
        <complexType>
            <sequence>
                <element name="Test1" type="string"></element>
                <element name="Test2">
                    <complexType>
                        <sequence>
                            <element name="Test3" type="string"></element>
                            <element name="Test4" type="string"></element>
                            <element name="Test5" type="string"></element>
                            <element name="Test6" type="string"></element>
                            <element name="Test7" type="string"></element>
                        </sequence>
                    </complexType>
                </element>              
            </sequence>
        </complexType>
    </element>
</schema>

Code:

DomParser xsdparser;
xsdparser.parse_file(XsdFileName);

const Node* root = xsdparser.get_document()->get_root_node()->get_next_sibling();
cout << root->get_name() << endl;
0

There are 0 best solutions below