Examples for 'XML::compareXMLDocs'


Indicate differences between two XML documents

Aliases: compareXMLDocs

Keywords: IO

### ** Examples


tt =
 '<x>
     <a>text</a>
     <b foo="1"/>
     <c bar="me">
        <d>a phrase</d>
     </c>
  </x>'

  a = xmlParse(tt, asText = TRUE)
  b = xmlParse(tt, asText = TRUE)
  d = getNodeSet(b, "//d")[[1]]
  xmlName(d) = "bob"
  addSibling(xmlParent(d), newXMLNode("c"))
[[1]]
<c/> 
  compareXMLDocs(a, b)
$inA
d 
1 

$inB
bob 
  1 

$countDiffs
 c 
-1 

[Package XML version 3.99-0.10 Index]