Java javax.xml.stream package provides an API for streaming XML documents. XMLStreamWriter is a main interface that writes XML streams. It is used to set the namespace prefix for the current element being written. The setPrefix() method of the XMLStreamWriter interface takes two arguments, a string prefix and a string namespace. The prefix is the namespace prefix to be declared and namespace is the namespace URI to be associated with that prefix.
This example sets the prefix "ns" for the namespace "http://www.example.com/namespace".
These code examples belong to the javax.xml.stream package library.
Java XMLStreamWriter.setPrefix - 29 examples found. These are the top rated real world Java examples of javax.xml.stream.XMLStreamWriter.setPrefix extracted from open source projects. You can rate examples to help us improve the quality of examples.