Sha256: ecdf812134b9fa283176920efc341ead0bd0fc450f26df867089719e6a2ba1ce

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>collection? (XMLProof::Proofreader)</title>
<link rel=StyleSheet href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body bgcolor="white">
<pre><span class="cmt"># File proofreader.rb, line 271</span>
    <span class="kw">def</span> collection?
      <span class="kw">if</span> @xml_document
        validity = <span class="kw">true</span>
        missing = {}
        @proof.collections.each <span class="kw">do</span> |collection, locator_array|
          missing[collection] = locator_array.dup
          locator_array.each <span class="kw">do</span> |locator|
            namespace = locator[0]
            xpath = locator[1]
            REXML::XPath.each(@xml_document, xpath) <span class="kw">do</span> |element_or_attribute|
              missing[collection].delete([namespace, xpath]) <span class="kw">if</span> element_or_attribute.inherited_namespace == namespace
            <span class="kw">end</span>
          <span class="kw">end</span>
        <span class="kw">end</span>
        missing.each <span class="kw">do</span> |collection, locator_array|
          <span class="kw">if</span> <span class="kw">not</span> locator_array.empty?
            validity = <span class="kw">false</span>
            error = &quot;COLLECTION #{collection}&quot;
            @errors &lt;&lt; [locator_array[0][0], locator_array[0][1], error]
          <span class="kw">end</span>
        <span class="kw">end</span>
        <span class="kw">return</span> validity
      <span class="kw">else</span>
        raise <span class="str">&quot;no XML document provided to validate collections against&quot;</span>
      <span class="kw">end</span>
    <span class="kw">end</span></pre>
</body>
</html>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mega-0.3.1 pub/xml/xmlproof/rdoc/classes/XMLProof/Proofreader.src/M000034.html