File: Poco.XML.NamespaceSupport.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (152 lines) | stat: -rw-r--r-- 16,513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::XML::NamespaceSupport</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.XML.html" class="namespace">Poco::XML</a></h1>
<h1 class="symbol">class NamespaceSupport</h1>
</div>
<div class="body">
<p>
<b>Library:</b> XML<br />
<b>Package:</b> SAX<br />
<b>Header:</b> Poco/SAX/NamespaceSupport.h</p>
<h2>Description</h2>
<div class="description">
<p>Encapsulate Namespace logic for use by SAX drivers.  This class encapsulates the logic of Namespace processing:  it tracks the declarations currently in force for each context and automatically processes qualified <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 names into their Namespace  parts; it can also be used in reverse for generating <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 from Namespaces. Namespace support objects are reusable, but the reset method  must be invoked between each session. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.XML.NamespaceSupport.html#19075" title="Poco::XML::NamespaceSupport::declarePrefix()">declarePrefix</a>, <a href="Poco.XML.NamespaceSupport.html#19080" title="Poco::XML::NamespaceSupport::getDeclaredPrefixes()">getDeclaredPrefixes</a>, <a href="Poco.XML.NamespaceSupport.html#19082" title="Poco::XML::NamespaceSupport::getPrefix()">getPrefix</a>, <a href="Poco.XML.NamespaceSupport.html#19086" title="Poco::XML::NamespaceSupport::getPrefixes()">getPrefixes</a>, <a href="Poco.XML.NamespaceSupport.html#19091" title="Poco::XML::NamespaceSupport::getURI()">getURI</a>, <a href="Poco.XML.NamespaceSupport.html#19084" title="Poco::XML::NamespaceSupport::isMapped()">isMapped</a>, <a href="Poco.XML.NamespaceSupport.html#19094" title="Poco::XML::NamespaceSupport::popContext()">popContext</a>, <a href="Poco.XML.NamespaceSupport.html#19095" title="Poco::XML::NamespaceSupport::processName()">processName</a>, <a href="Poco.XML.NamespaceSupport.html#19093" title="Poco::XML::NamespaceSupport::pushContext()">pushContext</a>, <a href="Poco.XML.NamespaceSupport.html#19100" title="Poco::XML::NamespaceSupport::reset()">reset</a>, <a href="Poco.XML.NamespaceSupport.html#19078" title="Poco::XML::NamespaceSupport::undeclarePrefix()">undeclarePrefix</a></p>
<h2>Types</h2>
<h3><a name="19072">PrefixSet</a></h3>
<p class="decl">typedef std::set &lt; <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &gt; <a href="Poco.XML.NamespaceSupport.html#19072" title="Poco::XML::NamespaceSupport::PrefixSet">PrefixSet</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="19073">NamespaceSupport</a></h3>
<p class="decl"><a href="Poco.XML.NamespaceSupport.html" title="class Poco::XML::NamespaceSupport">NamespaceSupport</a>();</p>
<div class="description">
<p>Creates a <a href="Poco.XML.NamespaceSupport.html" title="class Poco::XML::NamespaceSupport">NamespaceSupport</a> object. </p>
</div>
<h2>Destructor</h2>
<h3><a name="19074">~NamespaceSupport</a></h3>
<p class="decl">~<a href="Poco.XML.NamespaceSupport.html" title="class Poco::XML::NamespaceSupport">NamespaceSupport</a>();</p>
<div class="description">
<p>Destroys a <a href="Poco.XML.NamespaceSupport.html" title="class Poco::XML::NamespaceSupport">NamespaceSupport</a> object. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="19075">declarePrefix</a></h3>
<p class="decl">bool declarePrefix(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; prefix,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; namespaceURI<br />);</p>
<div class="description">
<p>Declare a Namespace prefix. All prefixes must be declared before they are referenced. For example, a SAX driver (parser) would scan an element's attributes in two passes: first for namespace declarations, then a second pass using <a href="Poco.XML.NamespaceSupport.html#19095" title="Poco::XML::NamespaceSupport::processName()">processName</a>() to interpret prefixes against (potentially redefined) prefixes. </p>
<p>This method declares a prefix in the current Namespace context; the prefix will remain in force until this context is popped, unless it is shadowed in a descendant context. </p>
<p>To declare the default element Namespace, use the empty string as the prefix. </p>
<p>Note that you must not declare a prefix after you've pushed and popped another Namespace context, or treated the declarations phase as complete by processing a prefixed name. </p>
<p>Returns true if the prefix was legal, false otherwise. </p>
</div>
<h3><a name="19080">getDeclaredPrefixes</a></h3>
<p class="decl">void getDeclaredPrefixes(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.XML.NamespaceSupport.html#19072" title="Poco::XML::NamespaceSupport::PrefixSet">PrefixSet</a> &amp; prefixes<br />) const;</p>
<div class="description">
<p>Return an enumeration of all prefixes declared in this context. </p>
<p>The empty (default) prefix will be included in this enumeration; note that this behaviour differs from that of <a href="Poco.XML.NamespaceSupport.html#19082" title="Poco::XML::NamespaceSupport::getPrefix()">getPrefix</a>(java.lang.String) and <a href="Poco.XML.NamespaceSupport.html#19086" title="Poco::XML::NamespaceSupport::getPrefixes()">getPrefixes</a>(). </p>
</div>
<h3><a name="19082">getPrefix</a></h3>
<p class="decl">const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; getPrefix(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; namespaceURI<br />) const;</p>
<div class="description">
<p>Return one of the prefixes mapped to a Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a>. </p>
<p>If more than one prefix is currently mapped to the same <a href="Poco.URI.html" title="class Poco::URI">URI</a>, this method will make an arbitrary selection; if you want all of the prefixes, use the <a href="Poco.XML.NamespaceSupport.html#19086" title="Poco::XML::NamespaceSupport::getPrefixes()">getPrefixes</a>() method instead. </p>
</div>
<h3><a name="19086">getPrefixes</a></h3>
<p class="decl">void getPrefixes(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.XML.NamespaceSupport.html#19072" title="Poco::XML::NamespaceSupport::PrefixSet">PrefixSet</a> &amp; prefixes<br />) const;</p>
<div class="description">
<p>Return an enumeration of all prefixes whose declarations are active in the current context. This includes declarations from parent contexts that have not been overridden. </p>
<p>Note: if there is a default prefix, it will not be returned in this enumeration; check for the default prefix using the getURI with an argument of &quot;&quot;. </p>
</div>
<h3><a name="19088">getPrefixes</a></h3>
<p class="decl">void getPrefixes(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; namespaceURI,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.XML.NamespaceSupport.html#19072" title="Poco::XML::NamespaceSupport::PrefixSet">PrefixSet</a> &amp; prefixes<br />) const;</p>
<div class="description">
<p>Return an enumeration of all prefixes for a given <a href="Poco.URI.html" title="class Poco::URI">URI</a> whose declarations are active in the current context. This includes declarations from parent contexts that have not been overridden. </p>
<p>This method returns prefixes mapped to a specific Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a>. The xml: prefix will be included. If you want only one prefix that's mapped to the Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a>, and you don't care which one you get, use the <a href="Poco.XML.NamespaceSupport.html#19082" title="Poco::XML::NamespaceSupport::getPrefix()">getPrefix</a>() method instead. </p>
<p>Note: the empty (default) prefix is never included in this enumeration; to check for the presence of a default Namespace, use the <a href="Poco.XML.NamespaceSupport.html#19091" title="Poco::XML::NamespaceSupport::getURI()">getURI</a>() method with an argument of &quot;&quot;. </p>
</div>
<h3><a name="19091">getURI</a></h3>
<p class="decl">const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; getURI(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; prefix<br />) const;</p>
<div class="description">
<p>Look up a prefix and get the currently-mapped Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a>. </p>
<p>This method looks up the prefix in the current context. Use the empty string (&quot;&quot;) for the default Namespace. </p>
</div>
<h3><a name="19084">isMapped</a></h3>
<p class="decl">bool isMapped(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; namespaceURI<br />) const;</p>
<div class="description">
<p>Returns true if the given namespaceURI has been mapped to a prefix, false otherwise. </p>
</div>
<h3><a name="19094">popContext</a></h3>
<p class="decl">void popContext();</p>
<div class="description">
<p>Revert to the previous Namespace context. </p>
<p>Normally, you should pop the context at the end of each <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> element. After popping the context, all Namespace prefix mappings that were previously in force are restored. </p>
<p>You must not attempt to declare additional Namespace prefixes after popping a context, unless you push another context first. </p>
</div>
<h3><a name="19095">processName</a></h3>
<p class="decl">bool processName(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; qname,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; namespaceURI,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; localName,<br />&nbsp;&nbsp;&nbsp;&nbsp;bool isAttribute<br />) const;</p>
<div class="description">
<p><a href="Poco.Process.html" title="class Poco::Process">Process</a> a raw <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 name.  This method processes a raw <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 name in the current context  by removing the prefix and looking it up among the prefixes currently declared. The result will be returned in namespaceURI and localName. If the raw name has a prefix that has not been declared, then the return value will be false, otherwise true. </p>
<p>Note that attribute names are processed differently than element names:  an unprefixed element name will received the default Namespace (if any), while an unprefixed element name will not. </p>
</div>
<h3><a name="19093">pushContext</a></h3>
<p class="decl">void pushContext();</p>
<div class="description">
<p>Start a new Namespace context. The new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context. </p>
<p><a href="Poco.XML.Event.html" title="class Poco::XML::Event">Event</a> callback code should start a new context once per element. This means being ready to call this in either of two places. For elements that don't include namespace declarations, the <a href="Poco.XML.ContentHandler.html#18856" title="Poco::XML::ContentHandler::startElement()">ContentHandler::startElement</a>() callback is the right place. For elements with such a declaration, it'd done in the first <a href="Poco.XML.ContentHandler.html#18876" title="Poco::XML::ContentHandler::startPrefixMapping()">ContentHandler::startPrefixMapping</a>() callback. A boolean flag can be used to track whether a context has been started yet. When either of those methods is called, it checks the flag to see if a new context needs to be started. If so, it starts the context and sets the flag. After  <a href="Poco.XML.ContentHandler.html#18856" title="Poco::XML::ContentHandler::startElement()">ContentHandler::startElement</a>() does that, it always clears the flag. </p>
<p>Normally, SAX drivers would push a new context at the beginning of each <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> element. Then they perform a first pass over the attributes to process all namespace declarations, making <a href="Poco.XML.ContentHandler.html#18876" title="Poco::XML::ContentHandler::startPrefixMapping()">ContentHandler::startPrefixMapping</a>() callbacks. Then a second pass is made, to determine the namespace-qualified names for all attributes and for the element name. Finally all the information for the <a href="Poco.XML.ContentHandler.html#18856" title="Poco::XML::ContentHandler::startElement()">ContentHandler::startElement</a>() callback is available, so it can then be made. </p>
<p>The Namespace support object always starts with a base context already in force: in this context, only the &quot;xml&quot; prefix is declared. </p>
</div>
<h3><a name="19100">reset</a></h3>
<p class="decl">void reset();</p>
<div class="description">
<p>Reset this Namespace support object for reuse. </p>
<p>It is necessary to invoke this method before reusing the Namespace support object for a new session. If namespace declaration URIs are to be supported, that flag must also be set to a non-default value. Reset this Namespace support object for reuse. </p>
</div>
<h3><a name="19078">undeclarePrefix</a></h3>
<p class="decl">bool undeclarePrefix(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; prefix<br />);</p>
<div class="description">
<p>Remove the given namespace prefix. </p>
</div>
<h2>Variables</h2>
<h3><a name="19103">XMLNS_NAMESPACE</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.NamespaceSupport.html#19103" title="Poco::XML::NamespaceSupport::XMLNS_NAMESPACE">XMLNS_NAMESPACE</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19104">XMLNS_NAMESPACE_PREFIX</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.NamespaceSupport.html#19104" title="Poco::XML::NamespaceSupport::XMLNS_NAMESPACE_PREFIX">XMLNS_NAMESPACE_PREFIX</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19101">XML_NAMESPACE</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.NamespaceSupport.html#19101" title="Poco::XML::NamespaceSupport::XML_NAMESPACE">XML_NAMESPACE</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19102">XML_NAMESPACE_PREFIX</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.NamespaceSupport.html#19102" title="Poco::XML::NamespaceSupport::XML_NAMESPACE_PREFIX">XML_NAMESPACE_PREFIX</a>;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>