Package com.sun.xml.xsom
Class XmlString
- java.lang.Object
-
- com.sun.xml.xsom.XmlString
-
public final class XmlString extends java.lang.Object
String with in-scope namespace binding information.In a general case, text (PCDATA/attributes) that appear in XML schema cannot be correctly interpreted unless you also have in-scope namespace binding (a case in point is QName.) Therefore, it's convenient to handle the lexical representation and the in-scope namespace binding in a pair.
-
-
Field Summary
Fields Modifier and Type Field Description org.relaxng.datatype.ValidationContext
context
Used to resole in-scope namespace bindings.private static org.relaxng.datatype.ValidationContext
NULL_CONTEXT
java.lang.String
value
Textual value.
-
Constructor Summary
Constructors Constructor Description XmlString(java.lang.String value)
Creates a newXmlString
with empty in-scope namespace bindings.XmlString(java.lang.String value, org.relaxng.datatype.ValidationContext context)
Creates a newXmlString
from a lexical representation and in-scope namespaces.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
resolvePrefix(java.lang.String prefix)
Resolves a namespace prefix to the corresponding namespace URI.java.lang.String
toString()
-
-
-
Constructor Detail
-
XmlString
public XmlString(java.lang.String value, org.relaxng.datatype.ValidationContext context)
Creates a newXmlString
from a lexical representation and in-scope namespaces.
-
XmlString
public XmlString(java.lang.String value)
Creates a newXmlString
with empty in-scope namespace bindings.
-
-
Method Detail
-
resolvePrefix
public final java.lang.String resolvePrefix(java.lang.String prefix)
Resolves a namespace prefix to the corresponding namespace URI. This method is used for resolving prefixes in thevalue
(such as whenvalue
represents a QName type.)If the prefix is "" (empty string), the method returns the default namespace URI.
If the prefix is "xml", then the method returns "http://www.w3.org/XML/1998/namespace", as defined in the XML Namespaces Recommendation.
- Returns:
- namespace URI of this prefix. If the specified prefix is not declared, the implementation returns null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-