File: test.xml

package info (click to toggle)
r-cran-xml 3.99-0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 3,688 kB
  • sloc: ansic: 6,659; xml: 2,890; asm: 486; sh: 12; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (7)
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
<?xml version="1.0" ?>
<!DOCTYPE foo [
  <!ENTITY % bar "for R and S">
  <!ENTITY % foo "for Omegahat">

  <!ENTITY testEnt "test entity bar">
  <!ENTITY logo SYSTEM "images/logo.gif" NDATA gif>
  <!ENTITY % extEnt SYSTEM "http://www.omegahat.net">   <!-- include the contents of the README file in the same directory as this one. -->

  <!ELEMENT x  (#PCDATA) >
  <!ELEMENT y  (x)* >
]>
<!-- A comment -->
<foo x="1">
 <element attrib1="my value" />
 &testEnt;
 <?R sum(rnorm(100)) ?>
 <a>
  <!-- A comment -->
  <b> 
    %extEnt;
  </b>
 </a>
<![CDATA[
 This is escaped data
 containing < and &.
]]>

Note that this caused a segmentation fault if replaceEntities was 
not TRUE.
That is,
<code>
xmlTreeParse("test.xml", replaceEntities = TRUE)
</code>
works, but 
<code>
xmlTreeParse("test.xml")
</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code 
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>