java - Get XSD type while SAXParser -
i trying parse xml document saxparser. have xsd document validates against. while parsing e.g. in startelement/endelement method know type xsd e.g. xsd:integer etc. possible?
thanks
mike
you can use attributes.getvalue(string qname) method on attributes object passed parameter in startelement method, value of of element's attributes including type: attributes.getvalue("type")
.
depending on if in xml using qualified names or not, might have use attributes.getvalue(i)
, i
index of "type" attribute in element' attributes list. see https://stackoverflow.com/a/8451023/3132058 .
you can find more info on how use in sax api documentation.
Comments
Post a Comment