I am stuck in XML parsing that has a ":" in its element name.
An XML example is shown below:
val xml:String = <epp xmlns='urn:ietf:params:xml:ns:epp-1.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'> <command> <create> <host:create xmlns:host='urn:ietf:params:xml:ns:host-1.0' xsi:schemaLocation='urn:ietf:params:xml:ns:host-1.0host-1.0.xsd'> <host:name>ns-1.dns.net</host:name> </host:create> </create> <clTRID>TRID-1-100043434343</clTRID> </command> </epp> val dom = scala.xml.XML.loadString(xml) val name = dom \\ "host:name"
name always empty.
I need to get the tag value of the <host:name> element. Please let me know how to get this.
source share