Get the namespaces
#201
-
I am building a XSD/WSDL/Swagger/OpenAPI to Kotlin code generator and I need to get the referenced namespace: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="Foo"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
targetNamespace="http://www.example.com"
xmlns:css="http://www.example.com/css"
>
<wsdl:message name="fooMessage">
<wsdl:part element="css:fooMessage" name="parameters"/>
</wsdl:message>
</wsdl:definitions> Is there any api to get the namespaces or the namespace for a specific prefix, like |
Beta Was this translation helpful? Give feedback.
Answered by
hfhbd
Apr 15, 2024
Replies: 1 comment 1 reply
-
Wow, this was easier than expected: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hfhbd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow, this was easier than expected:
XMLReader
exposes the method:getNamespaceURI(prefix)