I'm having difficulty in trying to get the namespace prefix.
 
When I get the SchemaGrammar and recurse down through the model, when I get to the simpleTypes (eg "xs:string") I can recover both the name and the namespace of the simpleType, but I can't work out how to recover the namespace prefix.
 
ie
xsSimpleTypeDecl.getName()  will give me "string"
xsSimpleTypeDecl.getNamespace() will give me http://www.w3.org/2001/XMLSchema
 
how do I get "xs" (defined in the example below)
 
I would be very grateful if someone would point me in the right direction.
 
Many trhanks
Nick
 
 
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    >
    <xs:element name="responsemodel">
        <xs:annotation>
            <xs:documentation>filesystems response model</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="response" type="xs:string"/>
                <xs:element name="exceptionThrown" type="xs:boolean"/>
                <xs:element name="exceptionMessage" minOccurs="0" type="xs:string"/>
                <xs:sequence>
                    <xs:element name="children" minOccurs="0"
                        maxOccurs="unbounded" type="xs:string"/>
                </xs:sequence>
                <xs:element name="booleanResponse" minOccurs="0" type="xs:boolean"/>
                <xs:element name="byteResponse" minOccurs="0" type="xs:base64Binary"/>
                <xs:element name="calendarResponse" minOccurs="0" type="xs:date"/>
                <xs:element name="longResponse" minOccurs="0" type="xs:int"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Reply via email to